SystemControl API Usage

This document describes new usages of Samsung Product SystemControl API for Tizen 6.5 and higher, and differences with SSSP B2BControl API.


Related Info


Generals

  • Privilege: http://developer.samsung.com/privilege/systemcontrol
  • Privilege level: Partner

API Usages

webapis.systemcontrol.getVersion

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); 
    }
    

webapis.systemcontrol.captureScreen

This interface provides a method to capture the screen.
Saved path: /opt/share/magicinfo/ScreenCapture.jpg

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    try {
      webapis.systemcontrol.captureScreen(); 
    } catch (e) {
      console.log("[captureScreen] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    

webapis.systemcontrol.rebootDevice

This interface provides a method to reboot the device (power off the device and restart).

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    try {
      webapis.systemcontrol.rebootDevice(); 
    } catch (e) {
      console.log("[rebootDevice] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    

webapis.systemcontrol.getSerialNumber

This interface provides a method to get the device serial number.

  • SSSP API sample code:

    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); 
    }
    
  • Samsung Product API sample code:

    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); 
    }
    

webapis.systemcontrol.updateFirmware

This interface provides a method to update firmware.

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    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);
    

webapis.productinfo.getFirmware

This interface provides methods to retrieve firmware version.

  • SSSP API sample code:

    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);
    }
    
  • Samsung Product API sample code:

    try {
      var value = webapis.productinfo.getFirmware();
      console.log(" Firmware value = " + value);
    } catch (error) {
      console.log(" error code = " + error.code);
    }
    

webapis.systemcontrol.setUpdateFirmwareListener

This method adds the asynchronous onChange callback for the firmware update progress to a module.

  • SSSP API sample code:

    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);
    }
    
  • Samsung Product API sample code:

    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);
    }
    

webapis.systemcontrol.unsetUpdateFirmwareListener

This method removes the asynchronous onChange callback for the firmware update progress from a module.

  • SSSP API sample code:

    try {
      console.log("begin unsetUpdateFirmwareProgressChangeListener"); 
      b2bapis.b2bcontrol.unsetUpdateFirmwareProgressChangeListener();
    } catch (e) {
      console.log("unsetUpdateFirmwareProgressChangeListener exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    
  • Samsung Product API sample code:

    try {
      console.log("begin unsetUpdateFirmwareListener");     
      webapis.systemcontrol.unsetUpdateFirmwareListener();
    } catch (e) {
      console.log("unsetUpdateFirmwareListener exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    

webapis.systemcontrol.setScreenLampSchedule

This interface provides a method to set the screen lamp schedule, which contains values for time and lamp level value.

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    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);
    }
    

webapis.systemcontrol.getScreenLampSchedule

This interface provides a method to get screen lamp schedule information.

  • SSSP API sample code:

    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); 
    }
    
  • Samsung Product API sample code:

    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);
    }
    

webapis.systemcontrol.setPanelMute

This interface provides a method to set the panel mute state of a device.

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    try {
      webapis.systemcontrol.setPanelMute("ON"); 
    } catch (e) {
      console.log("[setPanelMute] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    

webapis.systemcontrol.getPanelMute

This interface provides a method to get the current panel mute state of a device.

  • SSSP API sample code:

    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);
    }
    
  • Samsung Product API sample code:

    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); 
    }
    

webapis.systemcontrol.setSafetyLock

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.

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    try {
      webapis.systemcontrol.setSafetyLock("ON"); 
    } catch (e) {
      console.log("[setSafetyLock] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    

webapis.systemcontrol.getSafetyLock

This interface provides a method to get the current safety lock status of a device.

  • SSSP API sample code:

    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); 
    }
    
  • Samsung Product API sample code:

    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); 
    }
    

webapis.systemcontrol.getOnScreenMenuOrientation

This interface provides a method to get the current menu orientation of a device.

  • SSSP API sample code:

    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);
    }
    
  • Samsung Product API sample code:

    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);
    }
    

webapis.systemcontrol.getSourceOrientation

This interface provides a method to get the current source orientation of the device.

  • SSSP API sample code:

    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");
    
  • Samsung Product API sample code:

    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);
    

webapis.systemcontrol.setPCConnection

This interface provides a method to set the PCConnection value of a device.

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    try {
      webapis.systemcontrol.setPCConnection("RJ45"); 
    } catch (e) {
      console.log("[setPCConnection] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    

webapis.systemcontrol.getPCConnection

This interface provides a method to get the PCConnection value of a device.

  • SSSP API sample code:

    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); 
    }
    
  • Samsung Product API sample code:

    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); 
    }
    

webapis.systemcontrol.setMessageDisplay

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.

  • SSSP API sample code:

    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);
    
  • Samsung Product API sample code:

    try {
      webapis.systemcontrol.setMessageDisplay("ON"); 
    } catch (e) {
      console.log("[setMessageDisplay] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }
    

webapis.systemcontrol.getMessageDisplay

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.

  • SSSP API sample code:

    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); 
    }
    
  • Samsung Product API sample code:

    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);
    }