Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
+ Collaboration diagram for Battery:

Data Structures

struct  SBatteryData
 

Typedefs

typedef struct SBatteryData SBatteryData
 

Enumerations

enum  cc_battery_level_t {
  CMD_CLASS_BATTERY_LEVEL_LOW = 0x00 ,
  CMD_CLASS_BATTERY_LEVEL_HIGH = 0x10 ,
  CMD_CLASS_BATTERY_LEVEL_FULL = 0x64 ,
  CMD_CLASS_BATTERY_LEVEL_WARNING = 0xFF
}
 

Functions

bool CC_Battery_LevelReport_tx (const AGI_PROFILE *pProfile, uint8_t sourceEndpoint, void(*pCbFunc)(TRANSMISSION_RESULT *pTransmissionResult))
 
uint8_t CC_Battery_BatteryGet_handler (uint8_t endpoint)
 
bool cc_battery_check_level_changed (void)
 
uint8_t cc_battery_config_get_reporting_decrements (void)
 
bool cc_battery_write (SBatteryData *battery_data)
 
bool cc_battery_read (SBatteryData *battery_data)
 

Detailed Description

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.

Typedef Documentation

◆ SBatteryData

typedef struct SBatteryData SBatteryData

Used to store the last reported battery level

Enumeration Type Documentation

◆ 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

Function Documentation

◆ 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]endpointbinary 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()

bool CC_Battery_LevelReport_tx ( const AGI_PROFILE * pProfile,
uint8_t sourceEndpoint,
void(*)(TRANSMISSION_RESULT *pTransmissionResult) pCbFunc )

Send unsolicited battery report

Parameters
[in]pProfilepointer to AGI profile
[in]sourceEndpointsource endpoint
[out]pCbFunccallback funtion returning status destination node receive job.
Returns
true if a Battery Report was succesfully enqueued for transmission, false otherwise.

◆ cc_battery_read()

bool cc_battery_read ( SBatteryData * battery_data)

◆ cc_battery_write()

bool cc_battery_write ( SBatteryData * battery_data)