Get battery information
GET_BATTERY code is 0x0C
Gets battery level and charging status. The battery level is a percentage.
Input parameters
none
Result
Result name |
Value |
Description |
SUCCESS |
0x00 |
Command accepted. |
Output parameters
param[0]: battery level in range between 0 and 100 (%)
param[1]: battery charging status
0 - discharging
1 - charging
Example
Form message for encryption,
Command Value |
0x0C |
Encrypt prepared message,
Send it on API commands characteristic,
Receive response on API commands characteristic,
Decrypt received response discarding first header byte,
Parse response
Result |
param[0] |
param[1] |
0x00 (SUCCESS) |
0 - 100% |
0 or 1 |