Battery#
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.
Modules#
Enumerations#
Battery value can range from 0 to 100 (0x00 to 0x64) representing the battery level in percentage from 0 to 100%.
Typedefs#
Used to store the last reported battery level.
Functions#
Send unsolicited battery report.
Get current battery level from application.
Function for periodically checking if the battery level differs from what was last reported.
Gets the reporting decrements value.
Enumeration Documentation#
cc_battery_level_t#
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 |
39
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/inc/CC_Battery.h
Typedef Documentation#
SBatteryData#
typedef struct SBatteryData SBatteryData
Used to store the last reported battery level.
54
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/inc/CC_Battery.h
Function Documentation#
CC_Battery_LevelReport_tx#
bool CC_Battery_LevelReport_tx (const AGI_PROFILE * pProfile, uint8_t sourceEndpoint, void(*)(TRANSMISSION_RESULT *pTransmissionResult) pCbFunc)
Send unsolicited battery report.
[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.
63
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/inc/CC_Battery.h
CC_Battery_BatteryGet_handler#
uint8_t CC_Battery_BatteryGet_handler (uint8_t endpoint)
Get current battery level from application.
[in] | endpoint | binary switch endpoint |
This function must be implemented in the application code. Called by battery command class handler.
Returns
current battery level
77
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/inc/CC_Battery.h
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.
N/A |
Returns
true if the battery level has changed since last reported
false if the battery level hasn't changed
85
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/inc/CC_Battery.h
cc_battery_config_get_reporting_decrements#
uint8_t cc_battery_config_get_reporting_decrements (void )
Gets the reporting decrements value.
N/A |
Returns
uint8_t reporting decrements value
92
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/inc/CC_Battery.h
cc_battery_write#
bool cc_battery_write (SBatteryData * battery_data)
N/A | battery_data |
17
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/src/cc_battery_io.h
cc_battery_read#
bool cc_battery_read (SBatteryData * battery_data)
N/A | battery_data |
18
of file /mnt/raid/workspaces/ws.OEhokVcbw/overlay/gsdk/protocol/z-wave/ZAF/CommandClasses/Battery/src/cc_battery_io.h