---
sidebar_position: 0
---

# mdc

The `sos.native.mdc` API groups together methods for controlling Tizen devices using MDC commands.

:::warning
This API is currently available on Tizen devices only.
:::

<details>
    <summary>MDC Management Capabilities</summary>
		| Capability | Description |
		|:------------|:-------------|
		| `NATIVE_COMMANDS_MDC` | If device supports performing MDC commands |

		If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
</details>

## Methods

### sendOne()

The `sendOne()` method sends an MDC command to another Tizen device on the same network or to the localhost.

```ts expandable
sendOne(ipAddress: IpAddressType, command: CodesMDC, data?: number[]): Promise<IMDCResponse>;
// show-more
/**
 * Response object returned by Tizen Core App.
 */
interface IMDCResponse {
    /**
     * The type of the response, either 'ACK' for acknowledgment or 'NACK' for negative acknowledgment.
     */
    type: 'ACK' | 'NACK';
    /**
     * The command type that was executed, represented as a number.
     * Should match the command number in {@link CodesMDC}.
     */
    commandType: number;
    /**
     * The result of the command execution, represented as a number.
     * This value can vary depending on the command executed.
     */
    result: number;
}

/**
 * This enum contains valid command codes for Tizen MDC communication.
 */
enum CodesMDC {
    STATUS_CONTROL = 0,
    VIDEO_CONTROL = 4,
    RGB_CONTROL = 6,
    PIP_STATUS_CONTROL = 7,
    MAINTENANCE_CONTROL = 8,
    SOUND_CONTROL = 9,
    SERIAL_NUMBER_CONTROL = 11,
    DISPLAY_STATUS_CONTROL = 13,
    SW_VERSION_CONTROL = 14,
    AUTO_MOTION_PLUS = 15,
    MODEL_NUMBER_CONTROL = 16,
    POWER_CONTROL = 17,
    VOLUME_CONTROL = 18,
    MUTE_CONTROL = 19,
    INPUT_SOURCE = 20,
    IMAGE_SIZE_CONTROL = 21,
    DIRECT_CHANNEL_CONTROL = 23,
    SCREEN_MODE_CONTROL = 24,
    SCREEN_SIZE_CONTROL = 25,
    OUTDOOR = 26,
    SYSTEM_CONFIGURATION = 27,
    MAGIC_INFO_CONTROL = 28,
    MDC_CONNECTION_TYPE = 29,
    STILL_CONTROL = 31,
    PICTURE_CONTROL = 33,
    CONTRAST_CONTROL = 36,
    BRIGHTNESS_CONTROL = 37,
    SHARPNESS_CONTROL = 38,
    COLOR_CONTROL = 39,
    TINT_CONTROL = 40,
    COARSE_CONTROL = 47,
    FINE_CONTROL = 48,
    H_POSITION_CONTROL = 49,
    V_POSITION_CONTROL = 50,
    AUTO_POWER = 51,
    CLEAR_MENU_CONTROL = 52,
    REMOTE_CONTROL = 54,
    RGB_CONTRAST_CONTROL = 55,
    RGB_BRIGHTNESS_CONTROL = 56,
    PIP_CONTROL = 60,
    AUTO_ADJUST_CONTROL = 61,
    COLOR_TONE_CONTROL = 62,
    COLOR_TEMPERATURE_CONTROL = 63,
    PIP_SOURCE_CONTROL = 64,
    PIP_SIZE_CONTROL = 66,
    PIP_LOCATE_CONTROL = 67,
    FAN_SPEED_SETTING = 68,
    USER_AUTO_COLOR = 69,
    SOUND_SELECT_CONTROL = 71,
    AUTO_VOLUME = 72,
    STANDBY_CONTROL = 74,
    VIDEO_PICTURE_POSITION_AND_SIZE = 75,
    PIXEL_SHIFT_CONTROL = 76,
    SENSOR_CONTROL = 80,
    EQ_100HZ_CONTROL = 81,
    EQ_300HZ_CONTROL = 82,
    EQ_1KHZ_CONTROL = 83,
    EQ_3KHZ_CONTROL = 84,
    EQ_10KHZ_CONTROL = 85,
    ENERGY_SAVING_LFG = 86,
    AUTO_LAMP_CONTROL = 87,
    MANUAL_LAMP_CONTROL_BACKLIGHT = 88,
    SAFETY_SCREEN_RUN_CONTROL = 89,
    INVERSE_CONTROL = 90,
    SAFETY_SCREEN_CONTROL_MFM = 91,
    VIDEO_WALL_MODE_CONTROL = 92,
    SAFETY_LOCK = 93,
    KEY_LOCK_CONTROL_MFM = 95,
    CHANNEL_UP_DOWN = 97,
    VOLUME_UP_DOWN = 98,
    TICKER = 99,
    PC_MODULE_DETECT = 102,
    DEVICE_NAME = 103,
    SPEAKER_SELECT = 104,
    OSD_OFF_ON = 112,
    PICTURE_MODE_CONTROL = 113,
    SOUND_MODE_CONTROL = 114,
    DIGITAL_NR = 115,
    PC_COLOR_TONE_CONTROL = 117,
    AUTO_AUTO_ADJUSTMENT = 118,
    ALL_KEYS_LOCK = 119,
    SRS_TSXT_CONTROL = 120,
    FILM_MODE = 121,
    PANEL_ON_TIME = 131,
    VIDEO_WALL_ON = 132,
    TEMPERATURE_CONTROL = 133,
    BRIGHTNESS_SENSOR = 134,
    DYNAMIC_CONTRAST = 135,
    VIDEO_WALL_USER_CONTROL = 137,
    MODEL_NAME = 138,
    VIDEO_WALL_DIRECT_USER_CONTROL = 139,
    VIDEO_WALL_FEATURE_CONTROL = 140,
    FRAME_ALIGNMENT = 129,
    FAN = 143,
    GAME_MODE = 144,
    ENERGY_SAVING = 146,
    HDMI_BLACK_LEVEL = 148,
    BLACK_ADJUST = 149,
    GAMMA = 150,
    EDGE_ENHANCEMENT = 156,
    COLOR_SPACE = 157,
    XVYCC = 158,
    RESET_CONTROL = 159,
    AMBIENT_BRIGHTNESS_MODE = 161,
    OSD_DISPLAY_TYPE = 163,
    TIMER_1_CONTROL_MFM = 164,
    TIMER_2_CONTROL_MFM = 165,
    TIMER_3_CONTROL_MFM = 166,
    CLOCK_CONTROL_MFM = 167,
    HOLIDAY_CONTROL = 168,
    HOLIDAY_GET_CONTROL = 169,
    TIMER_4_CONTROL = 171,
    TIMER_5_CONTROL = 172,
    TIMER_6_CONTROL = 173,
    TIMER_7_CONTROL = 174,
    EDIT_NAME_CONTROL = 175,
    VIRTUAL_REMOTE_CONTROL = 176,
    DISPLAY_PORT_DAISY_CHAIN = 177,
    /**
     * 3Screen/4Screen Mode Control
     */
    THREESCREEN_MODE_CONTROL = 178,
    VIDEO_CONFERENCE_SOUND_MODE_CONTROL = 179,
    VIDEO_STANDBY_CONTROL = 181,
    DAYLIGHT_SAVING_TIME_CONTROL = 182,
    CUSTOM_PIP_CONTROL = 183,
    AUTO_ID_SETTING_STATUS_CONTROL = 184,
    DISPLAY_ID_INFORMATION = 185,
    APPLY_CALIBRATED_DATA_FOR_ALL_SOURCE_OR_CURRENT_SOURCE = 195,
    CLOCK_CONTROL_MFM_2 = 197,
    ECO_SOLUTION = 198,
    EXECUTE_LAUNCHER = 199,
    ONSCREEN_DISPLAY_MENU_CONTROL = 200,
    SOUND_MENU_CONTROL = 201,
    SYSTEM_MENU_CONTROL = 202,
    OTHER_PROTOCOL_INTERFACE = 207,
    LED_PRODUCT_FEATURE = 208,
    LARGE_SIZE_AND_GENERAL_REPLY_FUNCTIONS = 210,
    NET_PIP_COMMAND = 224,
    APPLY_TO_CONTROL = 228,
    PANEL_ON_OFF = 249,
    AUTO_ID = 253,
    WHITE_BALANCE_MDC_CONTROL = 254,
    REPLY = 255
}

```

#### Params

| Name        | Type       | Required         | Description                                          |
|-------------|------------|------------------|------------------------------------------------------|
| `ipAddress` | `string`   |  <div>Yes</div>  | The IP address of the device to send the command to. |
| `command`   | `CodesMDC` |  <div>Yes</div>  | The MDC command to send                              |
| `data`      | `number[]` |  <div>No</div>   | The optional data to send with the command.          |

#### Return value

MDC response object containing the result of the command execution.

#### Possible errors


- If the `ipAddress` is not a valid string or if the `command` is not a valid number.
- If the `data` is not an array of numbers.
- If any error occurs during the command execution.

#### Example

```ts
await sos.native.mdc.sendOne('localhost', CodesMDC.BRIGHTNESS_CONTROL);
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.VOLUME_CONTROL, [50]);
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.PICTURE_CONTROL, [0x54, 0x03]);

// You can also send custom number if we don't have predefined command in our enum
await sos.native.mdc.sendOne('192.168.0.10', 0x01, []);
```

<Separator />

### sendOneRaw()

The `sendOneRaw()` method sends an MDC command to another Tizen device on the same network or to the localhost,
but without explicitly specifying the command.

```ts expandable
sendOneRaw(ipAddress: IpAddressType, data: number[] | [
]): Promise<IMDCResponse>;
// show-more
/**
 * Response object returned by Tizen Core App.
 */
interface IMDCResponse {
    /**
     * The type of the response, either 'ACK' for acknowledgment or 'NACK' for negative acknowledgment.
     */
    type: 'ACK' | 'NACK';
    /**
     * The command type that was executed, represented as a number.
     * Should match the command number in {@link CodesMDC}.
     */
    commandType: number;
    /**
     * The result of the command execution, represented as a number.
     * This value can vary depending on the command executed.
     */
    result: number;
}

```

#### Params

| Name        | Type             | Required         | Description                                                                        |
|-------------|------------------|------------------|------------------------------------------------------------------------------------|
| `ipAddress` | `string`         |  <div>Yes</div>  | The IP address of the device to send the command to.                               |
| `data`      | `number[] \| []` |  <div>Yes</div>  | The data as array of numbers to send with the command. It can be also empty array. |

#### Return value

MDC response object containing the result of the command execution.

#### Possible errors


- If the `ipAddress` is not a valid string or if the `command` is not a valid number.
- If the `data` is not an array of numbers.
- If any error occurs during the command execution.

#### Example

```ts
await sos.native.mdc.sendOneRaw('localhost', [0x1B, 0x00, 0x01, 0x74]); // Promise<IMDCResponse>

// Example of returned object
{
    "type": "ACK", // or NACK
    "commandType": 4,
    "result": 0, // Value what command returned
}
```