ezeio2:scriptref:updatedevicestatus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ezeio2:scriptref:updatedevicestatus [2020-06-15 18:57] – created andrehezeio2:scriptref:updatedevicestatus [2025-07-10 18:21] (current) andreh
Line 5: Line 5:
 === Description === === Description ===
  
-<code>UpdateDeviceStatus( deviceno, commStatus, opStatus, appStatus, signal, voltage )</code>+<code>UpdateDeviceStatus( deviceno, commStatus, opStatus, appStatus, signal, voltage, returnvalue=1 )</code>
  
 Updates the device status. Updates the device status.
Line 17: Line 17:
 | ''signal'' | Integer value, -127 to 127, typically signal strength where applicable | | ''signal'' | Integer value, -127 to 127, typically signal strength where applicable |
 | ''voltage'' | Voltage (if applicable) in mV (max 65V) | | ''voltage'' | Voltage (if applicable) in mV (max 65V) |
 +| ''returnvalue'' | return value (default 1) |
  
 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) 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)
Line 22: Line 23:
 === Return value === === Return value ===
  
-This function does not return a value.+Returns 1 by default, or the value of the ''returnvalue'' parameter.
  
 === Example usage === === Example usage ===
  
 <code javascript>    <code javascript>   
-   UpdateDeviceStatus( 3, DS_COM_OK, _, DS_APP_OK );+    
 +   // 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 ); 
 +   
 </code> </code>
  
  • ezeio2/scriptref/updatedevicestatus.1592247420.txt.gz
  • Last modified: 2020-06-15 18:57
  • by andreh