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

The AIROC Mesh Sensor Server module provides a way for an application to implement a functionality for the devices that can be controlled using sensor. More...

Typedefs

typedef void( wiced_bt_mesh_sensor_server_config_callback_t )(uint8_t element_idx, uint16_t event, void *p_data)
 
typedef void( wiced_bt_mesh_sensor_server_report_callback_t )(uint16_t event, uint8_t element_idx, void *p_get_params, void *p_ref_data)
 

Functions

void wiced_bt_mesh_model_sensor_server_init (uint8_t element_idx, wiced_bt_mesh_sensor_server_report_callback_t *p_report_callback, wiced_bt_mesh_sensor_server_config_callback_t *p_config_change_callback, wiced_bool_t is_provisioned)
 Sensor Senosr Module initialization. More...
 
wiced_bool_t wiced_bt_mesh_model_sensor_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Sensor Server Message Handler. More...
 
wiced_bool_t wiced_bt_mesh_model_sensor_setup_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Sensor Setup Server Message Handler. More...
 
wiced_result_t wiced_bt_mesh_model_sensor_server_series_status_send (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_sensor_series_status_data_t *series_status_data)
 Sensor Series Status send status. More...
 
wiced_result_t wiced_bt_mesh_model_sensor_server_column_status_send (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_sensor_column_status_data_t *column_status_data)
 Sensor Column Status send status. More...
 
uint16_t wiced_bt_mesh_model_format_sensor_server_data (uint8_t element_idx, uint16_t property_id, uint8_t *p_buffer, uint16_t buffer_len)
 Format Sensor Data. More...
 
wiced_result_t wiced_bt_mesh_model_sensor_server_data (uint8_t element_idx, uint16_t property_id, void *p_ref_data)
 Sensor Status send. More...
 
wiced_result_t wiced_bt_mesh_model_sensor_server_setting_status_send (wiced_bt_mesh_event_t *p_event, uint16_t property_id, uint16_t setting_property_id)
 Sensor Setting status. More...
 

Detailed Description

The AIROC Mesh Sensor Server module provides a way for an application to implement a functionality for the devices that can be controlled using sensor.

To include the Mesh Models support for the Sensor Server module the application shall contain the WICED_BT_MESH_MODEL_SENSOR_SERVER

TBD

Function Documentation

uint16_t wiced_bt_mesh_model_format_sensor_server_data ( uint8_t  element_idx,
uint16_t  property_id,
uint8_t *  p_buffer,
uint16_t  buffer_len 
)

Format Sensor Data.

An Application can call this function to format sensor data to be sent out. Function returns length of the data filled in the buffer. Property_id 0 means that we need to send data for all sensors of the element.

Parameters
element_idxElement Index where the sensor is located
property_idProperty ID of the sensor for which sensor data shall be used. If Property ID is zero, the data will include all sensors of the element.
p_bufferBuffer to be filled with information
buffer_lensize of the buffer
Returns
number of bytess filled in the buffer.
wiced_result_t wiced_bt_mesh_model_sensor_server_column_status_send ( wiced_bt_mesh_event_t p_event,
wiced_bt_mesh_sensor_column_status_data_t column_status_data 
)

Sensor Column Status send status.

Parameters
p_eventMesh event with the information about the message that has been received in the request, or created by the app for unsolicited message.
column_status_datapointer to the column data
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
wiced_result_t wiced_bt_mesh_model_sensor_server_data ( uint8_t  element_idx,
uint16_t  property_id,
void *  p_ref_data 
)

Sensor Status send.

Parameters
element_idxElement Index where the sensor is located
property_idProperty ID of the sensor for which sensor data shall be reported. If Property ID is zero, the Status will include all sensors of the element.
p_ref_dataIf application is sending data based on the Get request from the library, the parameter should contain the values passed in the GET request. Should be zero otherwise.
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
void wiced_bt_mesh_model_sensor_server_init ( uint8_t  element_idx,
wiced_bt_mesh_sensor_server_report_callback_t *  p_report_callback,
wiced_bt_mesh_sensor_server_config_callback_t *  p_config_change_callback,
wiced_bool_t  is_provisioned 
)

Sensor Senosr Module initialization.

Parameters
element_idxDevice element to where model is used
p_report_callbackThe application callback that will be executed on receiving a sensor get messages.
p_config_change_callbackThe application callback that will be executed to notify cadenence and setting changes.
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_sensor_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Sensor Server Message Handler.

An application or a parent model can call this models library function to process a message received from the Sensor Client device. The function parses the message and if appropriate calls the parent back 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/Element Index combination, WICED_FALSE otherwise.
wiced_result_t wiced_bt_mesh_model_sensor_server_series_status_send ( wiced_bt_mesh_event_t p_event,
wiced_bt_mesh_sensor_series_status_data_t series_status_data 
)

Sensor Series Status send status.

Parameters
p_eventMesh event with the information about the message that has been received in the request, or created by the app for unsolicited message.
series_status_datapointer to the series data
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
wiced_result_t wiced_bt_mesh_model_sensor_server_setting_status_send ( wiced_bt_mesh_event_t p_event,
uint16_t  property_id,
uint16_t  setting_property_id 
)

Sensor Setting status.

Parameters
p_eventMesh event with the information about the message that has been received in the request, or created by the app for unsolicited message.
property_idProperty ID of the sensor for which Sensor Setting status shall be reported
setting_property_idProperty ID of the Sensor Setting, that the Sensor Setting status shall be reported
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
wiced_bool_t wiced_bt_mesh_model_sensor_setup_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Sensor Setup Server Message Handler.

An application or a parent model can call this models library function to process a message received from the Sensor Client device. The function parses the message and if appropriate calls the parent back 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/Element Index combination, WICED_FALSE otherwise.