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

The AIROC Mesh Power On/Off Client module of the Mesh Models library provides a way for an application to manage the On Power Up behavior of other mesh devices. More...

Typedefs

typedef void( wiced_bt_mesh_power_onoff_client_callback_t )(uint16_t event, wiced_bt_mesh_event_t *p_event, void *p_data)
 Power On/Off Client callback is called by the Mesh Models library on receiving WICED_BT_MESH_POWER_ONOFF_ONPOWERUP_STATUS message from the peer. More...
 

Functions

void wiced_bt_mesh_model_power_onoff_client_init (uint8_t element_idx, wiced_bt_mesh_power_onoff_client_callback_t *p_callback, wiced_bool_t is_provisioned)
 Power On/Off Client Module initialization. More...
 
wiced_bool_t wiced_bt_mesh_model_power_onoff_client_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Generic Power OnOff Client Message Handler. More...
 
wiced_result_t wiced_bt_mesh_model_power_onoff_client_send_onpowerup_get (wiced_bt_mesh_event_t *p_event)
 The application can call this function to send the Get Power On/Off state client message to the server. More...
 
wiced_result_t wiced_bt_mesh_model_power_onoff_client_send_onpowerup_set (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_power_onoff_data_t *p_data)
 The application can call this function to send Set OnOff client message to the server. More...
 

Detailed Description

The AIROC Mesh Power On/Off Client module of the Mesh Models library provides a way for an application to manage the On Power Up behavior of other mesh devices.

It is typicallly used by the applications running on devices which performs mesh network configuration.

To include Power On/Off functionality, the device description shall contain WICED_BT_MESH_MODEL_POWER_ONOFF_CLIENT. The application shall also initialize the Power On/Off Client calling the wiced_bt_mesh_model_power_onoff_client_init registering a callback to receive Power OnOff status messages

To find out the current On Power Up state set on a particular device and to modify the behavior the application shall use wiced_bt_mesh_model_power_onoff_client_send_onpowerup_get. and wiced_bt_mesh_model_power_onoff_client_send_onpowerup_set methods respectively. These functions require to use the p_event parameter which include among others the address of the desgination device, the application key index, the retrnansmission parameters, the TTL, and various others.

Typedef Documentation

typedef void( wiced_bt_mesh_power_onoff_client_callback_t)(uint16_t event, wiced_bt_mesh_event_t *p_event, void *p_data)

Power On/Off Client callback is called by the Mesh Models library on receiving WICED_BT_MESH_POWER_ONOFF_ONPOWERUP_STATUS message from the peer.

The function is also called when transmission of the request has been completed WICED_BT_MESH_TX_COMPLETE with tx_failed field of the p_event parameter indicating if the request has been sent out successfully.

Parameters
eventThe event that the application should process (see Mesh Power On/Off Events)
p_eventinformation about the message received.
p_dataPointer to the data with the status information
Returns
None

Function Documentation

void wiced_bt_mesh_model_power_onoff_client_init ( uint8_t  element_idx,
wiced_bt_mesh_power_onoff_client_callback_t p_callback,
wiced_bool_t  is_provisioned 
)

Power On/Off Client Module initialization.

Parameters
element_idxDevice element to where model is used
p_callbackThe application callback function that will be executed by the Mesh Models library when a request has been sent out, or failed, 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_power_onoff_client_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Generic Power OnOff Client Message Handler.

This is an internal Mesh Models library function and does not need to be implemented or called by the application, unless application wants to replace the library functionality. The Mesh Core library calls this function for each message received. The function shall return WICED_TRUE if the message is destined for this specific model, and returns WICED_FALSE otherwise.

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/Element Index combination, WICED_FALSE otherwise.
wiced_result_t wiced_bt_mesh_model_power_onoff_client_send_onpowerup_get ( wiced_bt_mesh_event_t p_event)

The application can call this function to send the Get Power On/Off state client message to the server.

Parameters
p_eventMesh event with the information about the message that has been created by the application.
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
wiced_result_t wiced_bt_mesh_model_power_onoff_client_send_onpowerup_set ( wiced_bt_mesh_event_t p_event,
wiced_bt_mesh_power_onoff_data_t p_data 
)

The application can call this function to send Set OnOff client message to the server.

Parameters
p_eventMesh event with the information about the message that has been created by the application. The p_event->reply specifies if application wants to receive Status from the peer.
p_dataPointer to the data to send
Returns
WICED_BT_SUCCESS if message has been queued for transmission.