ezeio2:scriptref:updatedevicestatus

Update the status of a given device

Description

UpdateDeviceStatus( deviceno, commStatus, opStatus, appStatus, signal, voltage )

Updates the device status.

Parameters

deviceno Device number to request status from (or 0 for all devices)
commStatus Communication status, one of:
DS_COM_UNKNOWN
DS_COM_ERROR
DS_COM_ISSUE
DS_COM_OK
DS_COM_BEST
opStatus Operational status, one of:
DS_OP_UNKNOWN
DS_OP_ERROR
DS_OP_PART
DS_OP_FULL
appStatus Application status, one of:
DS_APP_UNKNOWN
DS_APP_ERROR
DS_APP_WARNING
DS_APP_OK
DS_APP_OK1
DS_APP_OK2
DS_APP_OK3
DS_APP_OK4
signal Integer value, -127 to 127, typically signal strength where applicable
voltage Voltage (if applicable) in mV (max 65V)

Only the first parameter, deviceno, is required. All other parameters are optional. Use _ (underscore) to skip parameters (eg UpdateDeviceStatus( 3, DS_COM_OK, _, DS_APP_OK ); will set Comm and App status only on device 3)

Return value

This function does not return a value.

Example usage

 
   // Indicate normal condition
   UpdateDeviceStatus( 3, DS_COM_OK, DS_OP_FULL, DS_APP_OK );
 
   // Indicate marginal communication condition
   UpdateDeviceStatus( 3, DS_COM_ERROR, DS_OP_UNKNOWN, DS_APP_UNKNOWN );
 
   // Indicate application status
   new batteryVoltage = 12345; // read the battery voltage from the device
   UpdateDeviceStatus( 3, _, _, DS_APP_OK, _, batteryVoltage );
 
  • ezeio2/scriptref/updatedevicestatus.txt
  • Last modified: 2020-06-15 19:01
  • by andreh