Writing Status Commands
Status commands are special commands used in status reporting. If a handler implements a “status” command, Edge Agent will invoke this command to fetch the status of the handler while compiling the status report for the system. The result of the "status" command execution should be printed to standard output and should be a JSON document - a list of statuses for each capability exposed by the handler. Here is an example of the result of a "status" command:
[
{
"capabilityId": "Wifi1",
"capabilityVersion": "1.2.1",
"status": "On"
},
{
"capabilityId": "Zigbee1",
"capabilityVersion": "1.0.0",
"status": "Stand-By"
},
{
"capabilityId": "DCMotor1",
"capabilityVersion": "2.0.0",
"status": "Off"
}
]
Please note that each object in the list must have these fields: capabilityId
, capabilityVersion
and status
. However, the contents of these fields are not validated. It is the developer's responsibility to match capabilities against the capabilities the handler exposes, however, it is not mandatory.