User Manual

Table Of Contents
4-10 Millennial Net
Using the MeshScape API
10. ibApi_DEVICESTATUS
struct ibApi_DEVICESTATUS_s {
ibApi_UINT16 struct_size;
ibApi_UINT16 hop_count;
ibApi_DEVICEID first_hop_router;
ibApi_DEVICEID last_hop_router;
ibApi_FLOAT battery_level;
ibApi_UINT16 seq_num;
ibApi_GROUPID group_id;
};
typedef struct ibApi_DEVICESTATUS_s ibApi_DEVICESTATUS;
This struct is used by ibApi_FUNC ibApi_GetDeviceStatus() to report read-only
device properties that change with time.
Structure Fields:
struct_size The value size of (ibApi_DEVICESTATUS) should be assigned to this
field prior to calling ibApi_GetDeviceStatus(). This allows future versions of the API
to extend the struct without breaking binary compatibility.
hop_count The hop count measures a device's topological distance from the
gateway. If the device talking directly to the gateway (i.e., no mesh
nodes), then the hop count is 1.
first_hop_router These fields store the device ID of the first and last router that the
device's packets passed through on their way to the gateway. If the
hop count is 1, then these fields are NULL.
last_hop_router These fields store the device ID of the first and last router that the
device's packets passed through on their way to the gateway. If the
hop count is 1, then these fields are NULL.
battery_level This reports the device battery level measured in raw data, not voltage.
If battery information is unavailable, the value is 0.
Application can use ibApi_Utils_ConvertBatteryReadingToVoltage() to
convert raw data to voltage.
seq_num The sequence number increments whenever an update occurs.
group_id This reports the group ID currently assigned to the device.