Class Signage#registerSystemMonitor

Signage

Class Summary
Constructor Attributes Constructor Name and Description
 
Signage#registerSystemMonitor(successCallback, errorCallback, options)

Registers system monitoring setting.

Class Detail

Signage#registerSystemMonitor(successCallback, errorCallback, options)

Registers system monitoring setting. If one of the attributes is set to true, corresponding sensor events will be received. When this method is called, all the previously registered monitoring event setup will be reset.


function registerSystemMonitor() {
   var eventHandler = function(event){
     console.log("Received Event from : " + event.source);
     console.log("Event Type is : " + event.type);
     console.log("Additional Info : " + JSON.stringify(event.data));
   };

   var options = { 
     monitorConfiguration: {
        fan: true,
        signal : true,
        lamp : true,
        screen : true,
     },
     eventHandler : eventHandler	
   };
 
   var successCb = function (){
     console.log("successfully Set");
   };

   var failureCb = function(cbObject){
     var errorCode = cbObject.errorCode;
     var errorText = cbObject.errorText;
     console.log( " Error Code [" + errorCode + "]: " + errorText); 
   };

   var signage = new Signage();
   signage.registerSystemMonitor(successCb, failureCb, options);

}
Parameters:
{Function} successCallback
success callback function.
{Function} errorCallback
failure callback function.
{Object} options
parameter list.
{Object} options.monitorConfiguration
monitorConfiguration object for setting. Only attributes that exist will be set.
PropertyTypeDescriptionRequired
fanBooleanReceive events from the sensor that monitors the fan optional
signalBooleanReceive events from the signal receiveroptional
lampBooleanReceive events from the sensor that monitors the lampoptional
screenBooleanReceive events from the sensor that monitors the screenoptional
temperatureBooleanReceive events from the sensor that monitors the audiooptional
{Function} options.eventHandler
The function for handling system monitor events. This function has an event object as a parameter, which contains following properties.
PropertyTypeDescriptionRequired
sourceSignage.MonitoringSourceThe source of this eventrequired
typeSignage.EventTypeEvent Typerequired
dataObjectAdditional Data. Format may vary for event typeoptional
Since:
1.0
Returns:

After the method is successfully executed, successCallback is called without any parameter.
If an error occurs, errorCallback is called with errorCode and errorText.