Skip to main content
Version: 7.2.0

Native Commands (MDC)

Native Commands API allows you to control the device using native commands.

warning
  • This API is supported only on Tizen devices.
  • You can ensure that the device supports MDC commands via sos.management.supports("NATIVE_COMMANDS_MDC").

All methods​

MethodDescriptionSupported since
sendOne()Send MDC command on one IP address (or localhost)6.5.1
sendOneRaw()Send MDC command on one IP address (or localhost) with subcommands6.7.1

sendOne()​

Method sendOne() will send MDC command on one IP address (or localhost).

ParamTypeRequiredDescription
ipAddressstring
Yes
IP address or localhost
commandnumber
Yes
Command to send
dataarray
No
Data for command/subcommands

Javascript example​

await sos.native.mdc.sendOne('localhost', CodesMDC.BRIGHTNESS_CONTROL); // Promise<IMDCResponse>
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.VOLUME_CONTROL, [50]); // Promise<IMDCResponse>
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.PICTURE_CONTROL, [0x54, 0x03]); // Promise<IMDCResponse>

// 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, []); // Promise<IMDCResponse>

sendOneRaw()​

Method sendOneRaw() will send MDC command on one IP address (or localhost) with subcommands .

ParamTypeRequiredDescription
ipAddressstring
Yes
IP address or localhost
datanumber
Yes
Data for command/subcommands

Javascript example​

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
}

CodesMDC​

CodesMDC is an enum with all predefined commands, it's useful if you are writing applet in JavaScript or TypeScript.

Example of few commands​

import { CodesMDC } from '@signageos/front-applet/es6/FrontApplet/NativeCommands/MDC/CodesMDC';
export enum CodesMDC {
STATUS_CONTROL = 0x00,
VIDEO_CONTROL = 0x04,
RGB_CONTROL = 0x06,
PIP_STATUS_CONTROL = 0x07,
MAINTENANCE_CONTROL = 0x08,
SOUND_CONTROL = 0x09,
// ...
}