This document describes new usages of Samsung Product SystemControl API for Tizen 6.5 and higher, and differences with SSSP B2BControl API.
This interface provides methods to get systemcontrol module version.
SSSP API sample code:
var Version = null; try { Version = b2bapis.b2bcontrol.getVersion(); } catch (e) { console.log("[getVersion] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== Version) { console.log("[getVersion] call syncFunction type: " + Version); }
Samsung Product API sample code:
var Version = null; try { Version = webapis.systemcontrol.getVersion(); } catch (e) { console.log("[getVersion] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== Version) { console.log("[getVersion] call syncFunction type: " + Version); }
This interface provides a method to capture the screen. Saved path: /opt/share/magicinfo/ScreenCapture.jpg
/opt/share/magicinfo/ScreenCapture.jpg
var onSuccess = function(val) { console.log("[captureScreen] success : " + val); }; var onError = function(error) { console.log("[captureScreen] code :" + error.code + " error name: " + error.name + " message " + error.message); }; console.log("[captureScreen] "); b2bapis.b2bcontrol.captureScreen(onSuccess, onError);
try { webapis.systemcontrol.captureScreen(); } catch (e) { console.log("[captureScreen] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to reboot the device (power off the device and restart).
var onSuccess = function(val) { console.log("[rebootDevice] success : " + val); }; var onError = function(error) { console.log("[rebootDevice] code :" + error.code + " error name: " + error.name + " message " + error.message); }; console.log("[rebootDevice] "); b2bapis.b2bcontrol.rebootDevice(onSuccess, onError);
try { webapis.systemcontrol.rebootDevice(); } catch (e) { console.log("[rebootDevice] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to get the device serial number.
var SerialNumber = null; try { SerialNumber = b2bapis.b2bcontrol.getSerialNumber(); } catch (e) { console.log("[getSerialNumber] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== SerialNumber) { console.log("[getSerialNumber] call syncFunction type: " + SerialNumber); }
var SerialNumber = null; try { SerialNumber = webapis.systemcontrol.getSerialNumber(); } catch (e) { console.log("[getSerialNumber] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== SerialNumber) { console.log("[getSerialNumber] call syncFunction type: " + SerialNumber); }
This interface provides a method to update firmware.
var onSuccess = function(val) { console.log("[updateFirmware] success : " + val); }; var onError = function(error) { console.log("[updateFirmware] code :" + error.code + " error name: " + error.name + " message " + error.message); }; var SoftwareID = "0"; var SWUFileName = "upgrade.bem"; var SWVersion = "T-HKMLAKUC 0227.20"; var SWURL = "http://IP/T-HKMLAKUC_0227_20/image/upgrade.bem"; var SWTotalBytes = 1007396825; b2bapis.b2bcontrol.updateFirmware(SoftwareID, SWUFileName, SWVersion, SWURL, SWTotalBytes, onSuccess, onError);
var SoftwareID = "0"; var SWUFileName = "upgrade.bem"; var SWVersion = "T-HKMLAKUC 0227.20"; var SWURL = "http://IP/T-HKMLAKUC_0227_20/image/upgrade.bem";; var SWTotalBytes = 1007396825; webapis.systemcontrol.updateFirmware(SoftwareID, SWUFileName, SWVersion, SWURL, SWTotalBytes);
This interface provides methods to retrieve firmware version.
var FirmwareVersion = null; try { FirmwareVersion = b2bapis.b2bcontrol.getFirmwareVersion(); } catch (e) { console.log("[getFirmwareVersion] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== FirmwareVersion) { console.log("[getFirmwareVersion] call syncFunction type: " + FirmwareVersion); }
try { var value = webapis.productinfo.getFirmware(); console.log(" Firmware value = " + value); } catch (error) { console.log(" error code = " + error.code); }
This method adds the asynchronous onChange callback for the firmware update progress to a module.
var onchange = function(data) { console.log("[UpdateFirmwareProgressChangedCallback] progress :" + data + " changed"); }; try { b2bapis.b2bcontrol.setUpdateFirmwareProgressChangeListener(onchange); } catch (e) { console.log("setUpdateFirmwareProgressChangeListener exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
var onchange = function(data) { console.log("[UpdateFirmwareProgressChangedCallback] progress :" + data + " changed"); }; try { webapis.systemcontrol.setUpdateFirmwareListener(onchange); } catch (e) { console.log("setUpdateFirmwareListener exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This method removes the asynchronous onChange callback for the firmware update progress from a module.
try { console.log("begin unsetUpdateFirmwareProgressChangeListener"); b2bapis.b2bcontrol.unsetUpdateFirmwareProgressChangeListener(); } catch (e) { console.log("unsetUpdateFirmwareProgressChangeListener exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
try { console.log("begin unsetUpdateFirmwareListener"); webapis.systemcontrol.unsetUpdateFirmwareListener(); } catch (e) { console.log("unsetUpdateFirmwareListener exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to set the screen lamp schedule, which contains values for time and lamp level value.
var onSuccess = function(val) { console.log("[setLampSchedule] success : " + val); }; var onError = function(error) { console.log("[setLampSchedule] code :" + error.code + " error name: " + error.name + " message " + error.message); }; console.log("[setLampSchedule] "); b2bapis.b2bcontrol.setLampSchedule("ON","10:30",100,"20:30",50, onSuccess, onError);
var info = { "use" : "ON", "firstTime" : "08:55", "level1" : 30, "secondTime" : "16:50", "level2" : 80 }; try { webapis.systemcontrol.setScreenLampSchedule(info); } catch (e) { console.log("[setScreenLampSchedule] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to get screen lamp schedule information.
var LampSchedule = null; try { LampSchedule = b2bapis.b2bcontrol.getLampSchedule(); } catch (e) { console.log("[getLampSchedule] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== LampSchedule) { console.log("[getLampSchedule] call syncFunction type: " + LampSchedule); }
var ScreenLampSchedule = null; try { ScreenLampSchedule = webapis.systemcontrol.getScreenLampSchedule(); } catch (e) { console.log("[getScreenLampSchedule] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== ScreenLampSchedule) { console.log("[getScreenLampSchedule] call syncFunction type: " + ScreenLampSchedule); }
This interface provides a method to set the panel mute state of a device.
var onSuccess = function(val) { console.log("[setPanelMute] success : " + val); }; var onError = function(error) { console.log("[setPanelMute] code :" + error.code + " error name: " + error.name + " message " + error.message); }; b2bapis.b2bcontrol.setPanelMute("ON", onSuccess, onError);
try { webapis.systemcontrol.setPanelMute("ON"); } catch (e) { console.log("[setPanelMute] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to get the current panel mute state of a device.
var PanelMuteOnOff = null; try { PanelMuteOnOff = b2bapis.b2bcontrol.getPanelMuteStatus(); } catch (e) { console.log("[getPanelMuteStatus] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== PanelMuteOnOff) { console.log("[getPanelMuteStatus] call syncFunction type: " + PanelMuteOnOff); }
var PanelMuteOnOff = null; try { PanelMuteOnOff = webapis.systemcontrol.getPanelMute(); } catch (e) { console.log("[getPanelMute] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== PanelMuteOnOff) { console.log("[getPanelMute] call syncFunction type: " + PanelMuteOnOff); }
This interface provides a method to set the safety lock status of a device. When the safety lock is set to ON, a PIN number input window appears when an input signal is received by the device.
var onSuccess = function(val) { console.log("[setSafetyLock] success : " + val); }; var onError = function(error) { console.log("[setSafetyLock] code :" + error.code + " error name: " + error.name + " message " + error.message); }; b2bapis.b2bcontrol.setSafetyLock("ON", onSuccess, onError);
try { webapis.systemcontrol.setSafetyLock("ON"); } catch (e) { console.log("[setSafetyLock] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to get the current safety lock status of a device.
var SafetyLock = null; try { SafetyLock = b2bapis.b2bcontrol.getSafetyLock(); } catch (e) { console.log("[getSafetyLock] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if(null !== SafetyLock){ console.log("[getSafetyLock] call syncFunction type: " + SafetyLock); }
var SafetyLock = null; try { SafetyLock = webapis.systemcontrol.getSafetyLock(); } catch (e) { console.log("[getSafetyLock] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== SafetyLock) { console.log("[getSafetyLock] call syncFunction type: " + SafetyLock); }
This interface provides a method to get the current menu orientation of a device.
var MenuOrientation = null; try { MenuOrientation = b2bapis.b2bcontrol.getMenuOrientation(); } catch (e) { console.log("[getMenuOrientation] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== MenuOrientation) { console.log("[getMenuOrientation] call syncFunction type: " + MenuOrientation); }
var onScreenMenuOrientation = null; try { onScreenMenuOrientation = webapis.systemcontrol.getOnScreenMenuOrientation(); } catch (e) { console.log("[getOnScreenMenuOrientation] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== onScreenMenuOrientation) { console.log("[getOnScreenMenuOrientation] call syncFunction type: " + onScreenMenuOrientation); }
This interface provides a method to get the current source orientation of the device.
var onSuccess = function(val) { console.log("[getSourceOrientation] success : " + val); }; var onError = function(error) { console.log("[getSourceOrientation] code :" + error.code + " error name: " + error.name + " message " + error.message); }; b2bapis.b2bcontrol.getSourceOrientation("HDMI1");
var Result = null; try { Result = webapis.systemcontrol.getSourceOrientation(); } catch (e) { console.log("[getSourceOrientation] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } console.log("[getSourceOrientation] call syncFunction type: " + Result);
This interface provides a method to set the PCConnection value of a device.
var onSuccess = function(val) { console.log("[setPCConnection] success : " + val); }; var onError = function(error) { console.log("[setPCConnection] code :" + error.code + " error name: " + error.name + " message " + error.message); }; b2bapis.b2bcontrol.setPCConnection("RJ45", onSuccess, onError);
try { webapis.systemcontrol.setPCConnection("RJ45"); } catch (e) { console.log("[setPCConnection] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to get the PCConnection value of a device.
var PCConnection = null; try { PCConnection = b2bapis.b2bcontrol.getPCConnection(); } catch (e) { console.log("[getPCConnection] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== PCConnection) { console.log("[getPCConnection] call syncFunction type: " + PCConnection); }
var PCConnection = null; try { PCConnection = webapis.systemcontrol.getPCConnection(); } catch (e) { console.log("[getPCConnection] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== PCConnection) { console.log("[getPCConnection] call syncFunction type: " + PCConnection); }
This interface provides a method to enable or disable OSD (On Screen Display) messages on the device. This controls the display of system messages on the device screen. The following messages are affected by this setting: Source Info, No Signal message, MDC message, Download Status message.
var onSuccess = function(val) { console.log("[setOsdMute] success : " + val); }; var onError = function(error) { console.log("[setOsdMute] code :" + error.code + " error name: " + error.name + " message " + error.message); }; b2bapis.b2bcontrol.setOsdMute("ON", onSuccess, onError);
try { webapis.systemcontrol.setMessageDisplay("ON"); } catch (e) { console.log("[setMessageDisplay] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
This interface provides a method to get the OSD message display status of the device. The following messages are affected by this setting: Source Info, No Signal message, MDC message, Download Status message.
var OsdMute = null; try { OsdMute = b2bapis.b2bcontrol.getOsdMute(); } catch (e) { console.log("[getOsdMute] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== OsdMute) { console.log("[getOsdMute] call syncFunction type: " + OsdMute); }
var MessageDisplay = null; try { MessageDisplay = webapis.systemcontrol.getMessageDisplay(); } catch (e) { console.log("[getMessageDisplay] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== MessageDisplay) { console.log("[getMessageDisplay] call syncFunction type: " + MessageDisplay); }