Class Signage#registerSystemMonitor
Signage
- Defined in: signage.js
| 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.
Property Type Description Required fan Boolean Receive events from the sensor that monitors the fan optional signal Boolean Receive events from the signal receiver optional lamp Boolean Receive events from the sensor that monitors the lamp optional screen Boolean Receive events from the sensor that monitors the screen optional temperature Boolean Receive events from the sensor that monitors the audio optional - {Function} options.eventHandler
- The function for handling system monitor events.
This function has an event object as a parameter, which contains following properties.
Property Type Description Required source Signage.MonitoringSource The source of this event required type Signage.EventType Event Type required data Object Additional Data. Format may vary for event type optional
- 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.