dwm_dev_status_get
Reads the device status. The user can use ADC when the battery level is unavailable in the user application (when used as on-chip library).
-
void dwm_dev_status_get(dwm_mac_addr_list_t *mac_addr_list)
- Parameters
input – (none)
output – Status code, uptime, battery_level, temperature
uptime – ? 32-bit unsigned integer? (uptime in seconds)
battery_level – ? 8-bit unsigned integer ? (battery level in percents, not available in the user application library)
temperature – ? 16-bit integer? (temperature in °C)
C code example
dwm_dev_status_t status;
int rv;
if (rv == DWM_OK) {
printf("uptime=%lu\n", status.uptime);
printf("temperature=%d\n", status.temperature);
} else {
printf("can't read device status, error %d\n", rv);
}
Caution
this example code is wrong. It will be checked with actual implementation again.
SPI/UART example
TLV Request |
|
---|---|
Type |
Length |
0x25 |
0x00 |
Type 0x25 (37 dec) means command dwm_dev_status_get
TLV Response |
|||||
---|---|---|---|---|---|
Type |
Length |
Value (see error codes) |
Type |
Length |
Value |
0x40 |
0x01 |
0x00 |
0x59 |
0x08 |
uptime (byte 0-3) battery_level (byte 4) reserved (byte 5) temperature (byte 6-7) |
0x9d 0x16 0x00 0x00 0x64 0x00 0x21 0x00 |