This command class can be used for reporting the device's battery level with additional features. Additional functionality may be added to the application, if needed. See CC_Battery_BatteryGet_handler() in zwave_soc_sensor_pir's app.c source file as an example.
◆ SBatteryData
typedef struct SBatteryData SBatteryData |
Used to store the last reported battery level
◆ cc_battery_level_t
Battery value can range from 0 to 100 (0x00 to 0x64) representing the battery level in percentage from 0 to 100%. The value 255 (0xFF) is used to indicate low-battery warning. All other values are reserved and SHALL be ignored by the receiving device.
Enumerator |
---|
CMD_CLASS_BATTERY_LEVEL_LOW | battery level low
|
CMD_CLASS_BATTERY_LEVEL_HIGH | battery level high
|
CMD_CLASS_BATTERY_LEVEL_FULL | battery level full
|
CMD_CLASS_BATTERY_LEVEL_WARNING | battery low-level warning
|
◆ CC_Battery_BatteryGet_handler()
uint8_t CC_Battery_BatteryGet_handler |
( |
uint8_t | endpoint | ) |
|
Get current battery level from application.
This function must be implemented in the application code. Called by battery command class handler.
- Parameters
-
[in] | endpoint | binary switch endpoint |
- Returns
- current battery level
◆ cc_battery_check_level_changed()
bool cc_battery_check_level_changed |
( |
void | | ) |
|
Function for periodically checking if the battery level differs from what was last reported.
- Returns
- true if the battery level has changed since last reported
-
false if the battery level hasn't changed
◆ cc_battery_config_get_reporting_decrements()
uint8_t cc_battery_config_get_reporting_decrements |
( |
void | | ) |
|
Gets the reporting decrements value
- Returns
- uint8_t reporting decrements value
◆ CC_Battery_LevelReport_tx()
Send unsolicited battery report
- Parameters
-
[in] | pProfile | pointer to AGI profile |
[in] | sourceEndpoint | source endpoint |
[out] | pCbFunc | callback funtion returning status destination node receive job. |
- Returns
- true if a Battery Report was succesfully enqueued for transmission, false otherwise.
◆ cc_battery_read()
◆ cc_battery_write()