AIROC™ BTSDK v4.0 - Documentation | ||||
The AIROC Mesh Battery Client module provides a way for an application to retrieve the battery status of a mesh node. More...
Typedefs | |
typedef void( | wiced_bt_mesh_battery_client_callback_t )(uint16_t event, wiced_bt_mesh_event_t *p_event, mesh_battery_event_t *p_data) |
Battery Client callback. More... | |
Functions | |
void | wiced_bt_mesh_model_battery_client_init (wiced_bt_mesh_battery_client_callback_t *p_callback, wiced_bool_t is_provisioned) |
Battery Client Module initialization. More... | |
wiced_bool_t | wiced_bt_mesh_model_battery_client_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len) |
Battery Client Message Handler. More... | |
wiced_result_t | wiced_bt_mesh_battery_client_send_get (wiced_bt_mesh_event_t *p_event) |
Battery Client Send. More... | |
The AIROC Mesh Battery Client module provides a way for an application to retrieve the battery status of a mesh node.
The module can also process unsolicited status messages from mesh nodes.
On startup the application should call wiced_bt_mesh_model_battery_client_init function providing the callback that will be called when battery status message is received. The application can call the wiced_bt_mesh_battery_client_send_get function to retrieve the battery status of a mesh device.
typedef void( wiced_bt_mesh_battery_client_callback_t)(uint16_t event, wiced_bt_mesh_event_t *p_event, mesh_battery_event_t *p_data) |
Battery Client callback.
The Battery Client callback is called by the Mesh Models library on receiving a Battery Status message from the peer
event | Event that the application should process (see Mesh Battery Events) |
p_event | The information about the message received. The same pointer should be used in the reply if required. |
wiced_result_t wiced_bt_mesh_battery_client_send_get | ( | wiced_bt_mesh_event_t * | p_event | ) |
Battery Client Send.
The application can call this function to send get request to the Battery Server. The mesh event should contain the destination address and the application key index to be used to secure the message. In some cases the model can be configured by the provisioner to send the request to a specific address and use specific key. In that case application can use zeroes in the destination address and app key index fields.
p_event | Mesh event created by the app for unsolicited message. |
void wiced_bt_mesh_model_battery_client_init | ( | wiced_bt_mesh_battery_client_callback_t * | p_callback, |
wiced_bool_t | is_provisioned | ||
) |
Battery Client Module initialization.
Application should call this function during startup to register a callback which will be executed when received message requires application processing.
p_callback | The application callback function that will be executed by the mesh models library when application action is required, or when a reply for the application request has been received. |
is_provisioned | If TRUE, the application is being restarted after being provisioned or after a power loss. If FALSE the model cleans up NVRAM on startup. |
wiced_bool_t wiced_bt_mesh_model_battery_client_message_handler | ( | wiced_bt_mesh_event_t * | p_event, |
uint8_t * | p_data, | ||
uint16_t | data_len | ||
) |
Battery Client Message Handler.
The application should call this models library function to process a message received from the Battery Server. The function parses and validates the message and if appropriate calls the application to perform functionality.
p_event | Mesh event with information about received message. |
p_data | Pointer to the data portion of the message |
data_len | Length of the data in the message |