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

The AIROC Mesh Light LC Server module provides a way for an application to implement a Light Control Server device which can be a client to a Sensor Server model and controls the Light Lightness Actual state via defined state bindings. More...

Typedefs

typedef void( wiced_bt_mesh_light_lc_server_callback_t )(uint8_t element_idx, uint16_t event, void *p_data)
 Light Control Setup Server callback is called by the Mesh Models library on receiving a message from the peer Application or higher level model should be able process messages for the Light LC Setup server model as well as bound models including generic Light Lightness, Power On/Off, Generic Level and Generic On/Off. More...
 

Functions

wiced_bool_t wiced_bt_mesh_model_light_lc_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Light LC Server Message Handler. More...
 
wiced_bool_t wiced_bt_mesh_model_light_lc_setup_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Light LC Setup Server Message Handler. More...
 
wiced_result_t wiced_bt_mesh_model_light_lc_server_send_status (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_light_lightness_status_data_t *p_data)
 An application or a a parent model can call this function to send Light Lightness Status message to the Client. More...
 
void wiced_bt_mesh_model_light_lc_mode_changed (uint8_t element_idx, wiced_bt_mesh_light_lc_mode_set_data_t *p_status)
 Light LC Server Mode Changed. More...
 
void wiced_bt_mesh_model_light_lc_occupancy_mode_changed (uint8_t element_idx, wiced_bt_mesh_light_lc_occupancy_mode_set_data_t *p_status)
 Light LC Server Occupancy Mode Changed. More...
 
void wiced_bt_mesh_model_light_lc_occupancy_detected (uint8_t element_idx)
 Light LC Server Occupancy Detected. More...
 
void wiced_bt_mesh_model_light_lc_onoff_changed (uint8_t element_idx, wiced_bt_mesh_onoff_set_data_t *p_status)
 Light LC Server OnOff Changed. More...
 
void wiced_bt_mesh_model_light_lc_property_changed (uint8_t element_idx)
 Light LC Property Changed. More...
 
uint16_t wiced_bt_mesh_model_light_lc_server_scene_store_handler (uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)
 Light LC Server Scene Store Handler. More...
 
uint16_t wiced_bt_mesh_model_light_lc_server_scene_recall_handler (uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)
 Light LC Server Scene Store Handler. More...
 
void wiced_bt_mesh_model_light_lc_server_init (uint8_t element_idx, wiced_bt_mesh_light_lc_server_callback_t *p_callback, wiced_bool_t is_provisioned)
 Light LC Setup Server Module initialization. More...
 

Detailed Description

The AIROC Mesh Light LC Server module provides a way for an application to implement a Light Control Server device which can be a client to a Sensor Server model and controls the Light Lightness Actual state via defined state bindings.

To include the Mesh Models support for the LC Server module the application shall contain the WICED_BT_MESH_MODEL_LIGHT_LC_SERVER

TBD

Typedef Documentation

typedef void( wiced_bt_mesh_light_lc_server_callback_t)(uint8_t element_idx, uint16_t event, void *p_data)

Light Control Setup Server callback is called by the Mesh Models library on receiving a message from the peer Application or higher level model should be able process messages for the Light LC Setup server model as well as bound models including generic Light Lightness, Power On/Off, Generic Level and Generic On/Off.

Parameters
eventThe event that the application should process (see LIGHT_LIGHTNESS_EVENT Light Lightness Events, On/Off Events, LEVEL_EVENT Level Events")
p_eventinformation about the message received. The same pointer should be used in the reply if required.
p_dataPointer to the data structure specific to the event
Returns
None

Function Documentation

void wiced_bt_mesh_model_light_lc_mode_changed ( uint8_t  element_idx,
wiced_bt_mesh_light_lc_mode_set_data_t p_status 
)

Light LC Server Mode Changed.

Application should call this function when LC Mode is changed locally

Parameters
element_idxElement index where the LC Model is located
p_statusPointer to the structure with the new mode
Returns
None
void wiced_bt_mesh_model_light_lc_occupancy_detected ( uint8_t  element_idx)

Light LC Server Occupancy Detected.

Application should call this function when LC Occupancy is detected locally

Parameters
element_idxElement index where the LC Model is located
Returns
None
void wiced_bt_mesh_model_light_lc_occupancy_mode_changed ( uint8_t  element_idx,
wiced_bt_mesh_light_lc_occupancy_mode_set_data_t p_status 
)

Light LC Server Occupancy Mode Changed.

Application should call this function when LC Occupancy Mode is changed locally

Parameters
element_idxElement index where the LC Model is located
p_statusPointer to the structure with the new mode
Returns
None
void wiced_bt_mesh_model_light_lc_onoff_changed ( uint8_t  element_idx,
wiced_bt_mesh_onoff_set_data_t p_status 
)

Light LC Server OnOff Changed.

Application should call this function when LC Light OnOff is changed locally

Parameters
element_idxElement index where the LC Model is located
p_statusPointer to the structure with the new Light OnOff State
Returns
None
void wiced_bt_mesh_model_light_lc_property_changed ( uint8_t  element_idx)

Light LC Property Changed.

Application should call this function when an LC LC property is changed locally

Parameters
element_idxElement index where the LC Model is located
Returns
None
void wiced_bt_mesh_model_light_lc_server_init ( uint8_t  element_idx,
wiced_bt_mesh_light_lc_server_callback_t p_callback,
wiced_bool_t  is_provisioned 
)

Light LC Setup Server Module initialization.

A Mesh application which contains Light LC Setup Server (for example a dimmable bulb) should call this function for each element where the Light LC Server is present (for example for each bulb).

Parameters
element_idxDevice element to where model is used
p_callbackApplication or Parent model callback that will be executed on receiving a message
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
WICED_TRUE if initialization was successful
wiced_bool_t wiced_bt_mesh_model_light_lc_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Light LC Server Message Handler.

The Mesh Core library calls this function for each message received. The function returns WICED_TRUE if the message is destined for this specific model and successfully processed, 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.
uint16_t wiced_bt_mesh_model_light_lc_server_scene_recall_handler ( uint8_t  element_idx,
uint8_t *  p_buffer,
uint16_t  buffer_len,
uint32_t  transition_time,
uint32_t  delay 
)

Light LC Server Scene Store Handler.

When Scene Server receives Scene Recall message it calls this function with data previously stored in the NVRAM.

Parameters
element_idxElement index for which scene information is being recalled
p_bufferPointer to a buffer where model's data is located
buf_sizeMaximum amount of data a model can get from the buffer
transition_timeSpecified time in milliseconds to transition to the target state
delaySpecifies time in milliseconds before starting to transition to the target state
Returns
Number of bytes the model read from the provided buffer
uint16_t wiced_bt_mesh_model_light_lc_server_scene_store_handler ( uint8_t  element_idx,
uint8_t *  p_buffer,
uint16_t  buffer_len 
)

Light LC Server Scene Store Handler.

The mesh Scene Server calls this function so that the module can store required data for the scene.

Parameters
element_idxElement index for which scene information is being stored
p_bufferPointer to a buffer where data should be stored
buf_sizeMaximum amount of data a model can store
Returns
Number of bytes the model wrote into the provided buffer
wiced_result_t wiced_bt_mesh_model_light_lc_server_send_status ( wiced_bt_mesh_event_t p_event,
wiced_bt_mesh_light_lightness_status_data_t p_data 
)

An application or a a parent model can call this function to send Light Lightness Status message to the Client.

The mesh event should contain information if this is a reply or an unsolicited message.

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.
p_dataPointer to the status data
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
wiced_bool_t wiced_bt_mesh_model_light_lc_setup_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Light LC Setup Server Message Handler.

The Mesh Core library calls this function for each message received. The function returns WICED_TRUE if the message is destined for this specific model and successfully processed, 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.