ezeio2:scriptref:getdevicestatus

Fetch the Comm / Op / App status of a given device (or aggregate status)

Description

GetDeviceStatus( deviceno, status item )

Returns the given status item for.

Parameters

deviceno Device number to request status from (or 0 for all devices)
status item The status item to return (see below)
Parameter Description Aggregate
DVCSTAT_BATTVOLT The device battery/supply voltage in mV (if supported) YES
DVCSTAT_SIGNAL The reported device signal strength YES
DVCSTAT_COMMCOUNT Number of successful comm attempts NO
DVCSTAT_COMMERR Number of failed comm attempts NO
DVCSTAT_LASTCOMM Time of last status update NO
DVCSTAT_COMMSTAT Communication status, one of:
DS_COM_UNKNOWN
DS_COM_ERROR
DS_COM_ISSUE
DS_COM_OK
DS_COM_BEST
YES
DVCSTAT_OPSTAT Operational status, one of:
DS_OP_UNKNOWN
DS_OP_ERROR
DS_OP_PART
DS_OP_FULL
YES
DVCSTAT_APPSTAT 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
YES
DVCSTAT_STAT Aggregated status, one of:
DS_UNKNOWN
DS_ERROR
DS_WARNING
DS_OK
YES

Return value

Depends on parameter requested. See above.

Example usage

   if( GetDeviceStatus(0, DVCSTAT_STAT) < DS_OK ) {  // Get 'worst' status from all devices
      // DEVICE ERROR DETECTED -- SHUT OFF PROCESS
      SetOutput(1, 0);
   }   
  • ezeio2/scriptref/getdevicestatus.txt
  • Last modified: 2020-06-15 18:43
  • by andreh