Infineon Logo AIROC BTSDK v4.4 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Mesh Battery Client

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...
 

Detailed Description

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 Documentation

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

Parameters
eventEvent that the application should process (see Mesh Battery Events)
p_eventThe information about the message received. The same pointer should be used in the reply if required.
Returns
None

Function Documentation

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.

Parameters
p_eventMesh event created by the app for unsolicited message.
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
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.

Parameters
p_callbackThe 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_provisionedIf TRUE, the application is being restarted after being provisioned or after a power loss. If FALSE the model cleans up NVRAM on startup.
Returns
None
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.

Parameters
p_eventMesh event with information about received message.
p_dataPointer to the data portion of the message
data_lenLength of the data in the message
Returns
WICED_TRUE if the message is for this company ID/Model combination, WICED_FALSE otherwise.