Infineon Logo AIROC BTSDK v4.7 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Mesh Models Library API

Mesh Models library of the AIROC BTSDK provide a simple method for an application to use various Mesh models defined in the Bluetooth Mesh Model specification. More...

Data Structures

struct  mesh_battery_event_t
 Mesh Battery Status Event used to report battery state to the client device. More...
 
struct  wiced_bt_mesh_location_global_data_t
 Global Location Data structure exchanged between the application Generic Location Model. More...
 
struct  wiced_bt_mesh_location_local_data_t
 Local Location Data structure exchanged between the application Generic Location Model. More...
 
struct  wiced_bt_mesh_onoff_set_data_t
 OnOff Set Data structure exchanged between the application Generic OnOff Model. More...
 
struct  wiced_bt_mesh_onoff_status_data_t
 OnOff Status Data structure exchanged between the application and Generic OnOff Model. More...
 
struct  wiced_bt_mesh_level_set_level_t
 Level Set Data structure exchanged between the application and the Generic Level Model. More...
 
struct  wiced_bt_mesh_level_set_delta_t
 Delta Set Data structure exchanged between the application and the Generic Level Model. More...
 
struct  wiced_bt_mesh_level_set_move_t
 Move Set Data structure exchanged between the application and the Generic Level Model. More...
 
struct  wiced_bt_mesh_level_status_data_t
 Level Status Data structure exchanged between the application and Generic Level Model. More...
 
struct  wiced_bt_mesh_default_transition_time_data_t
 Default Transition Time Data structure exchanged between an application and the Generic Default Transition Time Model. More...
 
struct  wiced_bt_mesh_power_onoff_data_t
 Power OnOff Data structure exchanged between an application and the Power OnOff Model. More...
 
struct  wiced_bt_mesh_power_level_status_data_t
 Power Level Status Data structure exchanged between the application and Generic Power Level Model. More...
 
struct  wiced_bt_mesh_power_level_last_data_t
 Power Level Last Status Data structure exchanged between the application and Generic Power Level Model. More...
 
struct  wiced_bt_mesh_power_default_data_t
 Power Level Default Status Data structure exchanged between the application and Generic Power Level Model. More...
 
struct  wiced_bt_mesh_power_level_range_set_data_t
 Power Level Set Range Data structure exchanged between the application and Generic Power Level Model. More...
 
struct  wiced_bt_mesh_power_range_status_data_t
 Power Range Status Data structure exchanged between the application and Generic Power Level Model. More...
 
struct  wiced_bt_mesh_power_level_set_level_t
 Level Set Data structure exchanged between the application and the Generic Power Level Model. More...
 
struct  wiced_bt_mesh_light_lightness_status_data_t
 Light Lightness Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_light_lightness_status_t
 
struct  wiced_bt_mesh_light_lightness_set_t
 Light Lightness Set Data structure exchanged between the application and the models Light Lightness Server library. More...
 
struct  wiced_bt_mesh_light_lightness_actual_set_t
 Light Lightness Actual Set Data structure exchanged between the application and the models Light Lightness Client library. More...
 
struct  wiced_bt_mesh_light_lightness_linear_set_t
 Light Lightness Linear Set Data structure exchanged between the application and the models Light Lightness Client library. More...
 
struct  wiced_bt_mesh_light_lightness_last_data_t
 Light Lightness Last Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_light_lightness_default_data_t
 Lightness Default Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_light_lightness_range_set_data_t
 Lightness Range Status Data structure exchanged between the application and Generic Power Level Model. More...
 
struct  wiced_bt_mesh_light_lightness_range_status_data_t
 Lightness Range Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_properties_get_data_t
 Properties Get Data for Generic Property Models. More...
 
struct  wiced_bt_mesh_property_get_data_t
 Property Get Data for Generic Property Models. More...
 
struct  wiced_bt_mesh_properties_status_data_t
 Properties Status Data for Generic Property Models. More...
 
struct  wiced_bt_mesh_property_set_data_t
 Property Set Data structure exchanged between the application Generic User Property Models. More...
 
struct  wiced_bt_mesh_property_status_data_t
 Property Status Data structure exchanged between the application Generic User Property Models. More...
 
struct  wiced_bt_mesh_light_ctl_data_t
 Data structure representing the state of Light Color Temperature device. More...
 
struct  wiced_bt_mesh_light_ctl_status_data_t
 Light CTL Status Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_ctl_set_t
 Light CTL Set Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_ctl_temperature_set_t
 Light Lightness Last Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_light_ctl_default_data_t
 Lightness Default Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_light_ctl_temperature_range_status_data_t
 Temperature Range Status Data structure exchanged between the application and Light CTL Temperature Model. More...
 
struct  wiced_bt_mesh_light_ctl_temperature_range_data_t
 Temperature Range Set Data structure exchanged between the application and Light CTL Temperature Model. More...
 
struct  wiced_bt_mesh_light_delta_uv_set_level_t
 Light Lightness Set Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_delta_uv_last_data_t
 Light Lightness Last Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_light_delta_uv_default_data_t
 Lightness Default Status Data structure exchanged between the application and Light Lightness Model. More...
 
struct  wiced_bt_mesh_light_delta_uv_range_data_t
 Lightness Range Status Data structure exchanged between the application and Generic Power Level Model. More...
 
struct  wiced_bt_mesh_light_hsl_data_t
 Data structure representing the state of Light HSL device. More...
 
struct  wiced_bt_mesh_light_hsl_status_data_t
 Light HSL Status Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_hsl_target_status_data_t
 Light HSL Target Status Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_hsl_set_t
 Light HSL Set Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_hsl_hue_set_t
 Light HSL Hue Set Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_hsl_saturation_set_t
 Light HSL Saturation Set Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_hsl_default_data_t
 Light HSL Set Default Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_hsl_hue_status_data_t
 Light HSL Hue status Data structure exchanged between the application and Light HSL Model. More...
 
struct  wiced_bt_mesh_light_hsl_saturation_status_data_t
 Light HSL Saturation Status Data structure exchanged between the application and Light HSL Model. More...
 
struct  wiced_bt_mesh_light_hsl_range_set_data_t
 Light HSL Range Set Data structure exchanged between the application and Light HSL Level Model. More...
 
struct  wiced_bt_mesh_light_hsl_range_status_data_t
 Light HSL Range Set Data structure exchanged between the application and Light HSL Level Model. More...
 
struct  wiced_bt_mesh_light_hsl_default_status_data_t
 Light HSL Range Default Status structure exchanged between the application and Light HSL Level Model. More...
 
struct  wiced_bt_mesh_light_xyl_data_t
 Data structure reppresenting the state of the Light xyL device. More...
 
struct  wiced_bt_mesh_light_xyl_xy_settings_t
 Light xyL x_y_default and range settings. More...
 
struct  wiced_bt_mesh_light_xyl_status_data_t
 Light xyL Status Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_xyl_target_status_data_t
 Light xyL Target Value Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_xyl_set_t
 Light xyL Set Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_xyl_default_data_t
 Light xyL Set Default Data structure exchanged between the application and the models library. More...
 
struct  wiced_bt_mesh_light_xyl_range_set_data_t
 Light xyL Range Set Data structure exchanged between the application and Light xyL Level Model. More...
 
struct  wiced_bt_mesh_light_xyl_range_status_data_t
 Light xyL Range Set Data structure exchanged between the application and Light xyL Level Model. More...
 
struct  wiced_bt_mesh_light_xyl_default_status_data_t
 Light xyL Range Default Status structure exchanged between the application and Light xyL Level Model. More...
 
struct  wiced_bt_mesh_light_lc_mode_set_data_t
 Light LC Mode Set data structure exchanged between the application and Light LC library. More...
 
struct  wiced_bt_mesh_light_lc_occupancy_mode_set_data_t
 Light LC Occupancy Mode Set data structure exchanged between the application and Light LC library. More...
 
struct  wiced_bt_mesh_light_lc_light_onoff_set_data_t
 Light LC Light OnOff Set data structure exchanged between the application and Light LC library. More...
 
struct  wiced_bt_mesh_light_lc_light_onoff_status_data_t
 Light LC Light OnOff Status data structure exchanged between the application and Light LC library. More...
 
struct  wiced_bt_mesh_light_lc_linear_out_set_data_t
 Light LC Light OnOff Set data structure exchanged between the application and Light LC library. More...
 
struct  wiced_bt_mesh_light_lc_property_get_data_t
 Light LC Property Get Data structure exchanged between the application and Light LC library. More...
 
struct  wiced_bt_mesh_light_lc_property_set_data_t
 Light LC Property Set Data structure exchanged between the application and Light LC library. More...
 
struct  wiced_bt_mesh_light_lc_property_status_data_t
 Light LC Property Status Data structure exchanged between the application and Light LC library. More...
 

Modules

 Mesh Battery Client
 The AIROC Mesh Battery Client module provides a way for an application to retrieve the battery status of a mesh node.
 
 Mesh Battery Server
 The AIROC Mesh Battery Server module provides a way for a client to retrieve the Battery status of this device.
 
 Mesh Default Transition Time Client
 The AIROC Mesh Default Transition Time Client module of the Mesh Models library provides a way for a controlling device to set default transition time for the devices in the mesh network.
 
 Mesh Default Transition Time Server
 The AIROC Mesh Default Transition Time Server module of the Mesh Models library provides implementation of the Default Transition Time model.
 
 Mesh Level Client
 The AIROC Mesh Level Client module of the Mesh Models library provides a way for an application to send Level commands (set, delta and move) to the server and optionally receive status information.
 
 Mesh Level Server
 The AIROC Mesh Level Server module of the Mesh Models library provides a way to implement functionality for the devices that can be controlled using a simple level slider, aka Level client.
 
 Mesh Light CTL Client
 The AIROC Mesh Light CTL Client module of the Mesh Models library provides a way for an application to configure and control color lights that support Color Temperature adjustments.
 
 Mesh Light CTL Server
 The AIROC Mesh Color Temperature Lightness (CTL) Server module provides a way for an application to implement a dimmable light device with color temperature support.
 
 Mesh Light HSL Client
 The AIROC Mesh Light HSL Client module of the Mesh Models library provides a way for an application to configure and control color lights that support Hue/Saturation control.
 
 Mesh Light HSL Server
 The AIROC Mesh Hue Saturation Lightness (HSL) Server module provides a way for an application to implement a dimmable light device with hue/saturation support.
 
 Mesh Light LC Client
 The AIROC Mesh Light LC Client module of the Mesh Models library provides a way for an application to configure and control lights that support LC control.
 
 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.
 
 Mesh Light Lightness Client
 The AIROC Mesh Light Lightness Client module of the Mesh Models library provides a way for an application to control brightness level of the Light Lightness Servers in the mesh network optionally receive status information.
 
 Mesh Light Lightness Server
 The AIROC Mesh Light Lightness Server module provides a way for an application to implement a dimmable light device which can be controlled specifically by setting the brightness, but also can be can be controlled using a Level slider (Generic Level client) and On/Off switch (Generic On/Off client).
 
 Mesh Light xyL Client
 The AIROC Mesh Light XYL Client module of the Mesh Models library provides a way for an application to configure and control color lights that support xyL control.
 
 Mesh Light xyL Server
 The AIROC Mesh Light xyL Server module provides a way for an application to implement a dimmable light device with x and y chromaticity coordinates support.
 
 Mesh Location Client
 The AIROC Mesh Location Client module provides a way for an application to configure the device with a Global or a Local Location data or to retrieve this data.
 
 Mesh Location Server
 The AIROC Mesh Location Server module provides a way for a client to set the Global and Local location for a mesh device.
 
 Mesh OnOff Client
 The AIROC Mesh On/Off Client module of the Mesh Models library provides a way for an application to send OnOff commands to the server and optionally receive status information.
 
 Mesh OnOff Server
 The AIROC Mesh OnOff Server module of the Mesh Models library provides a way to implement functionality for the devices that can be controlled using a simple On/Off switch, aka On/Off client.
 
 Mesh Power Level Client
 The AIROC Mesh Power Level Client module of the Mesh Models library provides a way for an application to control power level of the Power Level Servers in the mesh network optionally receive status information.
 
 Mesh Power Level Server
 The AIROC Mesh Power Level Server module of the Mesh Models library provides a way to implement functionality of a power plug type of a device that can be controlled using a Level slider (Generic Level client) and On/Off switch (Generic On/Off client).
 
 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.
 
 Mesh Power OnOff Server
 The AIROC Mesh Power OnOff Server module of the Mesh Models library provides a way to implement functionality for the devices that can be controlled using a simple On/Off switch, aka On/Off client.
 
 Mesh Scene Client
 The AIROC Mesh Scene Client module provides a way for an application to control Scene Servers in the mesh network.
 
 Mesh Scene Server
 The AIROC Mesh Scene Server module provides a way for an application to implement a functionality for the devices that support scene state.
 
 Mesh Scheduler Client
 The AIROC Mesh Scheduler Client module provides a way for an application to control Scheduler Servers in the mesh network.
 
 Mesh Scheduler Server
 The AIROC Mesh Scheduler Server module provides a way for an application to implement a functionality for the devices that support Scheduler.
 
 Mesh Sensor Client
 The AIROC Mesh Sensor Client module provides a way for an application to control Sensor Servers in the mesh network.
 
 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.
 
 Mesh Time Client
 The AIROC Mesh Time Client module provides a way for an application to control Time Servers in the mesh network.
 
 Mesh Time Server
 The AIROC Mesh Time Server module provides a way for an application to implement a functionality for the devices that support time state.
 

Macros

#define WICED_BT_BATTERY_LEVEL_UNKNOWN   0xff
 Current battery level unknown.
 
#define WICED_BT_BATTERY_TIME_TO_DISCHARGE_UNKNOWN   0xffffff
 Time to full discharge unknown.
 
#define WICED_BT_BATTERY_TIME_TO_CHARGE_UNKNOWN   0xffffff
 Time to full charge unknown.
 
#define CONVERT_TOLERANCE_PERCENTAGE_TO_MESH(A)   ((4095 * A)/100)
 
#define WICED_BT_MESH_ONOFF_MAX_RETRANSMIT_TIME   6
 Max retransmit duration for on/off set command in seconds.
 
#define WICED_BT_MESH_TRANSITION_TIME_DEFAULT   0xFFFFFFFF
 Application or parent model should use default setting for transition time.
 
#define WICED_BT_MESH_LEVEL_MAX_RETRANSMIT_TIME   6
 Max retransmit duration for level set command in seconds. More...
 
#define WICED_BT_MESH_LEVEL_MOVE_MAX_TRANSITION_TIME   0x3E
 Max transition time for Move command.
 
#define WICED_BT_MESH_PROPERTY_TYPE_CLIENT   0
 Property types defined in the Mesh Models specifications wiced_bt_mesh_property_type enumeration. More...
 
#define WICED_BT_MESH_PROPERTY_TYPE_ADMIN   1
 Property type admin.
 
#define WICED_BT_MESH_PROPERTY_TYPE_MANUFACTURER   2
 Property type manufacturer.
 
#define WICED_BT_MESH_PROPERTY_TYPE_USER   3
 Property type user.
 

Typedefs

typedef uint8_t wiced_bt_mesh_battery_presence_t
 Generic Battery Flags Presence State (see Battery Presence Flags)
 
typedef uint8_t wiced_bt_mesh_battery_indicator_t
 Generic Battery Flags Indicator States (see Battery Indicator Flags)
 
typedef uint8_t wiced_bt_mesh_battery_charging_t
 Generic Battery Flags Charging States (see Battery Charging Flags)
 
typedef uint8_t wiced_bt_mesh_battery_servicibility_t
 Generic Battery Flags Serviceability States (see Battery Service Required Flags)
 
typedef uint16_t(* wiced_model_scene_store_handler_t )(uint8_t element_idx, uint8_t *p_buffer, uint16_t buf_size)
 Scene store message handler. More...
 
typedef uint16_t(* wiced_model_scene_recall_handler_t )(uint8_t element_idx, uint8_t *p_buffer, uint16_t buf_size, uint32_t transition_time, uint32_t delay)
 Scene retrieve message handler. More...
 
typedef void( wiced_bt_mesh_property_server_callback_t )(uint8_t element_idx, uint16_t event, void *p_data)
 Generic User Property Server callback is called by the Mesh Models library on receiving a message from the peer. More...
 
typedef void( wiced_bt_mesh_property_client_callback_t )(uint16_t event, wiced_bt_mesh_event_t *p_event, void *p_data)
 Property Client callback is called by the Mesh Models library on receiving a message from the peer. More...
 
typedef void(* wiced_bt_mesh_unprovisioned_device_cb_t )(uint8_t *p_uuid, uint16_t oob, uint32_t uri_hash, int8_t rssi)
 

Functions

void wiced_bt_mesh_model_property_server_init (uint8_t element_idx, wiced_bt_mesh_property_server_callback_t *p_callback, wiced_bool_t is_provisioned)
 Property Module initialization. More...
 
wiced_bool_t wiced_bt_mesh_model_user_property_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 User Property Server Message Handler. More...
 
wiced_bool_t wiced_bt_mesh_model_admin_property_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Admin Property Server Message Handler. More...
 
wiced_bool_t wiced_bt_mesh_model_manufacturer_property_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Manufacturer Property Server Message Handler. More...
 
wiced_bool_t wiced_bt_mesh_model_client_property_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Client Property Server Message Handler. More...
 
wiced_result_t wiced_bt_mesh_model_property_server_send_properties_status (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_properties_status_data_t *p_data)
 
wiced_result_t wiced_bt_mesh_model_property_server_send_property_status (wiced_bt_mesh_event_t *p_event, uint8_t type, wiced_bt_mesh_core_config_property_t *p_property)
 
void wiced_bt_mesh_model_property_client_init (uint8_t element_idx, wiced_bt_mesh_property_client_callback_t *p_callback, wiced_bool_t is_provisioned)
 Property Client Module initialization. More...
 
wiced_bool_t wiced_bt_mesh_model_property_client_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Property Client Message Handler. More...
 
wiced_result_t wiced_bt_mesh_model_property_client_send_properties_get (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_properties_get_data_t *p_data)
 The application can call this function to send Properties Get client message to the server. More...
 
wiced_result_t wiced_bt_mesh_model_property_client_send_property_get (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_property_get_data_t *p_get)
 The application can call this function to send Property Get client message to the server. More...
 
wiced_result_t wiced_bt_mesh_model_property_client_send_property_set (wiced_bt_mesh_event_t *p_event, wiced_bt_mesh_property_set_data_t *p_sata)
 The application can call this function to send Property Set client message to the server. More...
 
void wiced_bt_mesh_remote_provisioning_server_init (void)
 Remote Provisioning Server initialization. More...
 
void wiced_bt_mesh_remote_provisioning_server_set_min_rssi (int8_t min_rssi)
 Configures Remote Provisioning Server shall drop all unprovisioned beacons and provisioning service adverts with RSSI less than min_rssi. More...
 
wiced_bool_t wiced_bt_mesh_remote_provisioning_scan_rsp (wiced_bt_ble_scan_results_t *p_adv_report, uint8_t *p_adv_data)
 Process Scan Response Packets to check if the packet is for remote provisioning server. More...
 
wiced_bool_t wiced_bt_mesh_remote_provisioning_connectable_adv_packet (wiced_bt_ble_scan_results_t *p_adv_report, uint8_t *p_adv_data)
 Process Connectable Advertising Packets to check if the packet is for remote provisioning server. More...
 
wiced_bool_t wiced_bt_mesh_remote_provisioning_nonconnectable_adv_packet (wiced_bt_ble_scan_results_t *p_adv_report, uint8_t *p_adv_data)
 Process None Connectable Advertising Packets to check if the packet is for remote provisioning server. More...
 
void wiced_bt_mesh_models_set_trace_level (uint8_t level)
 Sets trace level for mesh_models_lib and mesh_provisioner_lib. More...
 
int wiced_bt_mesh_model_find_element_idx (uint16_t company_id, uint16_t model_id, uint8_t start_idx)
 Find model in the node configuration starting with specified element index. More...
 
wiced_bool_t wiced_bt_mesh_config_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 Config Server Model Message Handler. More...
 
void wiced_bt_mesh_config_server_send_reply (wiced_bt_mesh_event_t *p_event, uint16_t opcode, uint8_t *p_buffer, uint16_t len)
 This function can be called to send message through the core. More...
 
void wiced_bt_mesh_config_server_send_segmented (wiced_bool_t enable)
 This function can be called to configure configuration server to send always segmented messages regardless of the message size. More...
 

Variables

uint8_t wiced_bt_mesh_model_timer_server_get_interval
 Interval in seconds to send time get message while the time isn't set yet. More...
 

Following macros can be used instantiate the mesh models

Following macros instantiate the mesh models on a given element.

Based on the device definition the mesh core creates a device composition data that can be read by the the provisioner.

There certain rules that application shall follow when building device composition data.

  1. The first element of the device shall always contain WICED_BT_MESH_DEVICE which instantiates models that shall be present on every device, including the Configuration Server Model and the Health Server Model.
  2. Each model consists of the model definition itself (company ID and model ID) and callback function which is executed by the Mesh Core library on receiving a mesh message. Application can use Mesh Library's callback. In that case all validation of the messages, sending responses, and other protocol requirements are executed by the model. Alternatively application can implement callback itself. In that case, customer will be required to perform certification.
  3. A model cannot be repeated twice in the same element.
wiced_bool_t wiced_bt_mesh_remote_provisioning_server_message_handler (wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
 
#define WICED_BT_MESH_DEVICE
 Mesh Device includes Configuration Server and Health Server models. More...
 
#define WICED_BT_MESH_MODEL_CONFIG_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_CONFIG_CLNT, wiced_bt_mesh_config_client_message_handler, NULL, NULL }
 Mesh Configuration Client Model.
 
#define WICED_BT_MESH_MODEL_HEALTH_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_HEALTH_CLNT, wiced_bt_mesh_model_health_client_message_handler, NULL, NULL }
 Mesh Health Client Model.
 
#define WICED_BT_MESH_MODEL_REMOTE_PROVISION_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_REMOTE_PROVISION_CLNT, wiced_bt_mesh_config_client_message_handler, NULL, NULL }
 Mesh Remote Provisioning Model.
 
#define WICED_BT_MESH_MODEL_REMOTE_PROVISION_SERVER   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_REMOTE_PROVISION_SRV, wiced_bt_mesh_remote_provisioning_server_message_handler, NULL, NULL }
 Mesh Remote Provisioning Server Model. More...
 
#define WICED_BT_MESH_MODEL_LOCATION_SERVER
 Mesh Location Server Device. More...
 
#define WICED_BT_MESH_MODEL_USER_PROPERTY_SERVER   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_USER_PROPERTY_SRV, wiced_bt_mesh_model_user_property_server_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_ADMIN_PROPERTY_SERVER   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ADMIN_PROPERTY_SRV, wiced_bt_mesh_model_admin_property_server_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_MANUFACTURER_PROPERTY_SERVER   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_MANUFACT_PROPERTY_SRV, wiced_bt_mesh_model_manufacturer_property_server_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_CLIENT_PROPERTY_SERVER   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_CLIENT_PROPERTY_SRV, wiced_bt_mesh_model_client_property_server_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_LIGHT_HSL_CTL_SERVER
 Mesh Light HSL/CTL Server Device. More...
 
#define WICED_BT_MESH_MODEL_LIGHT_HSL_CTL_XYL_SERVER
 Mesh Light HSL/CTL/XYL Server Device. More...
 
#define WICED_BT_MESH_MODEL_LIGHT_LC_SERVER
 Mesh Light Controller Device. More...
 
#define WICED_BT_MESH_MODEL_SENSOR_SERVER
 
#define WICED_BT_MESH_MODEL_TIME_SERVER
 
#define WICED_BT_MESH_MODEL_LEVEL_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_CLNT, wiced_bt_mesh_model_level_client_message_handler, NULL, NULL }
 Mesh Level Client Device. More...
 
#define WICED_BT_MESH_MODEL_DEFAULT_TRANSITION_TIME_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_DEFTT_CLNT, wiced_bt_mesh_model_default_transition_time_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_POWER_ONOFF_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_POWER_ONOFF_CLNT, wiced_bt_mesh_model_power_onoff_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_BATTERY_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_BATTERY_CLNT, wiced_bt_mesh_model_battery_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_LOCATION_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LOCATION_CLNT, wiced_bt_mesh_model_location_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_PROPERTY_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_PROPERTY_CLNT, wiced_bt_mesh_model_property_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_SENSOR_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SENSOR_CLNT, wiced_bt_mesh_model_sensor_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_SCENE_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_CLNT, wiced_bt_mesh_model_scene_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_SCHEDULER_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCHEDULER_CLNT, wiced_bt_mesh_model_scheduler_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_TIME_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_TIME_CLNT, wiced_bt_mesh_model_time_client_message_handler, NULL, NULL }
 
#define WICED_BT_MESH_MODEL_LIGHT_LC_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LC_CLNT, wiced_bt_mesh_model_light_lc_client_message_handler, NULL, NULL }
 

Battery Presence Flags

#define WICED_BT_MESH_BATTERY_FLAG_NOT_PRESENT   0x00
 The battery is not present.
 
#define WICED_BT_MESH_BATTERY_FLAG_PRESENT_REMOVABLE   0x01
 The battery is present and is removable.
 
#define WICED_BT_MESH_BATTERY_FLAG_PRESENT_NON_REMOVABLE   0x02
 The battery is present and is non-removable.
 
#define WICED_BT_MESH_BATTERY_FLAG_PRESENCE_UNKNOWN   0x03
 The battery presence is unknown.
 

Battery Indicator Flags

#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_CRITICALLY_LOW   0x00
 The battery charge is Critically Low Level. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_LOW   0x01
 The battery charge is Low Level. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_GOOD   0x02
 The battery charge is Good Level. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_UNKNOWN   0x03
 The battery charge is unknown. More...
 

Battery Charging State Flags

#define WICED_BT_MESH_BATTERY_FLAG_NOT_CHARGABLE   0x00
 The battery is not chargeable. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_NOT_CHARGING   0x01
 The battery is chargeable and is not charging. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_CHARGING   0x02
 The battery is chargeable and is charging. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_CHARGING_UNKNOWN   0x03
 The battery charging state is unknown. More...
 

Battery Service Required State Flags

#define WICED_BT_MESH_BATTERY_FLAG_SERVICE_NOT_REQUIRED   0x01
 The battery does not require service. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_SERVICE_REQUIRED   0x02
 The battery requires service. More...
 
#define WICED_BT_MESH_BATTERY_FLAG_SERVICABILITY_UNKNOWN   0x03
 The battery serviceability is unknown. More...
 

Detailed Description

Mesh Models library of the AIROC BTSDK provide a simple method for an application to use various Mesh models defined in the Bluetooth Mesh Model specification.

Macro Definition Documentation

#define WICED_BT_MESH_BATTERY_FLAG_CHARGING   0x02

The battery is chargeable and is charging.

#define WICED_BT_MESH_BATTERY_FLAG_CHARGING_UNKNOWN   0x03

The battery charging state is unknown.

#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_CRITICALLY_LOW   0x00

The battery charge is Critically Low Level.

#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_GOOD   0x02

The battery charge is Good Level.

#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_LOW   0x01

The battery charge is Low Level.

#define WICED_BT_MESH_BATTERY_FLAG_LEVEL_UNKNOWN   0x03

The battery charge is unknown.

#define WICED_BT_MESH_BATTERY_FLAG_NOT_CHARGABLE   0x00

The battery is not chargeable.

#define WICED_BT_MESH_BATTERY_FLAG_NOT_CHARGING   0x01

The battery is chargeable and is not charging.

#define WICED_BT_MESH_BATTERY_FLAG_SERVICABILITY_UNKNOWN   0x03

The battery serviceability is unknown.

#define WICED_BT_MESH_BATTERY_FLAG_SERVICE_NOT_REQUIRED   0x01

The battery does not require service.

#define WICED_BT_MESH_BATTERY_FLAG_SERVICE_REQUIRED   0x02

The battery requires service.

#define WICED_BT_MESH_DEVICE
Value:
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_CONFIG_SRV, wiced_bt_mesh_config_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_HEALTH_SRV, NULL, NULL, NULL }
wiced_bool_t wiced_bt_mesh_config_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Config Server Model Message Handler.

Mesh Device includes Configuration Server and Health Server models.

This need to be included in the first element of the device.

#define WICED_BT_MESH_LEVEL_MAX_RETRANSMIT_TIME   6

Max retransmit duration for level set command in seconds.

This time is also indicates max duration of the delta command.

#define WICED_BT_MESH_MODEL_LEVEL_CLIENT   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_CLNT, wiced_bt_mesh_model_level_client_message_handler, NULL, NULL }

Mesh Level Client Device.

The device implements a Generic Level device. The device can be configured to control any device that supports Generic Level Server model (WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_SRV). For example, WICED_BT_MESH_MODEL_LIGHT_LIGHTNESS_SERVER, WICED_BT_MESH_MODEL_LIGHT_CTL_SERVER, WICED_BT_MESH_MODEL_LIGHT_HSL_SERVER,...

#define WICED_BT_MESH_MODEL_LIGHT_HSL_CTL_SERVER
Value:
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_DEFTT_SRV, wiced_bt_mesh_model_default_transition_time_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SRV, wiced_bt_mesh_model_scene_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SETUP_SRV, wiced_bt_mesh_model_scene_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_SRV, wiced_bt_mesh_model_onoff_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_POWER_ONOFF_SRV, wiced_bt_mesh_model_power_onoff_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_POWER_ONOFF_SETUP_SRV, wiced_bt_mesh_model_power_onoff_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_SRV, wiced_bt_mesh_model_level_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LIGHTNESS_SRV, wiced_bt_mesh_model_light_lightness_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV, wiced_bt_mesh_model_light_lightness_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_HSL_SETUP_SRV, wiced_bt_mesh_model_light_hsl_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_CTL_SETUP_SRV, wiced_bt_mesh_model_light_ctl_setup_server_message_handler, NULL, NULL }
uint16_t wiced_bt_mesh_model_light_hsl_server_scene_recall_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)
Light HSL Server Scene Recall Handler.
wiced_bool_t wiced_bt_mesh_model_power_onoff_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Power On/Off Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_lightness_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light Lightness Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_default_transition_time_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Default Transition Time Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_hsl_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light HSL Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_lightness_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light Lightness Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_scene_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Scene Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_ctl_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light CTL Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_onoff_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
On/Off Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_hsl_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light HSL Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_ctl_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light CTL Server Message Handler.
uint16_t wiced_bt_mesh_model_light_ctl_server_scene_recall_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)
Light CTL Server Scene Restore Handler.
wiced_bool_t wiced_bt_mesh_model_scene_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Scene Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_level_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Level Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_power_onoff_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Power On/Off Server Message Handler.
uint16_t wiced_bt_mesh_model_light_hsl_server_scene_store_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)
Light HSL Server Scene Store Handler.
uint16_t wiced_bt_mesh_model_light_ctl_server_scene_store_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)
Light CTL Server Scene Store Handler.

Mesh Light HSL/CTL Server Device.

The device implements all required models for the main element of a color bulb that supports brightness, hue and saturation but also a color temperature controls. Note that for the full color bulb implementation this device needs to be combined with hue server (WICED_BT_MESH_MODEL_LIGHT_HSL_HUE_SERVER), saturation server (WICED_BT_MESH_MODEL_LIGHT_HSL_SATURATION_SERVER) and color temperature server (WICED_BT_MESH_MODEL_LIGHT_CTL_TEMPERATURE_SERVER) on the consecutive elements. The time and scheduler models are optional and can be commented out to reduce memory footprint.

#define WICED_BT_MESH_MODEL_LIGHT_HSL_CTL_XYL_SERVER
Value:
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_DEFTT_SRV, wiced_bt_mesh_model_default_transition_time_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SRV, wiced_bt_mesh_model_scene_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SETUP_SRV, wiced_bt_mesh_model_scene_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_SRV, wiced_bt_mesh_model_onoff_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_POWER_ONOFF_SRV, wiced_bt_mesh_model_power_onoff_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_POWER_ONOFF_SETUP_SRV, wiced_bt_mesh_model_power_onoff_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_SRV, wiced_bt_mesh_model_level_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LIGHTNESS_SRV, wiced_bt_mesh_model_light_lightness_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV, wiced_bt_mesh_model_light_lightness_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_HSL_SETUP_SRV, wiced_bt_mesh_model_light_hsl_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_CTL_SETUP_SRV, wiced_bt_mesh_model_light_ctl_setup_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_XYL_SETUP_SRV, wiced_bt_mesh_model_light_xyl_setup_server_message_handler, NULL, NULL }
uint16_t wiced_bt_mesh_model_light_hsl_server_scene_recall_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)
Light HSL Server Scene Recall Handler.
wiced_bool_t wiced_bt_mesh_model_power_onoff_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Power On/Off Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_lightness_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light Lightness Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_default_transition_time_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Default Transition Time Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_hsl_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light HSL Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_xyl_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light XYL Server Message Handler.
uint16_t wiced_bt_mesh_model_light_xyl_server_scene_store_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)
Light xyL Server Scene Store Handler.
wiced_bool_t wiced_bt_mesh_model_light_xyl_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light XYL Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_lightness_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light Lightness Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_scene_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Scene Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_ctl_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light CTL Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_onoff_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
On/Off Server Message Handler.
uint16_t wiced_bt_mesh_model_light_xyl_server_scene_recall_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)
Light xyL Server Scene Store Handler.
wiced_bool_t wiced_bt_mesh_model_light_hsl_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light HSL Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_light_ctl_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Light CTL Server Message Handler.
uint16_t wiced_bt_mesh_model_light_ctl_server_scene_recall_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)
Light CTL Server Scene Restore Handler.
wiced_bool_t wiced_bt_mesh_model_scene_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Scene Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_level_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Level Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_power_onoff_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Power On/Off Server Message Handler.
uint16_t wiced_bt_mesh_model_light_hsl_server_scene_store_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)
Light HSL Server Scene Store Handler.
uint16_t wiced_bt_mesh_model_light_ctl_server_scene_store_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)
Light CTL Server Scene Store Handler.

Mesh Light HSL/CTL/XYL Server Device.

The device implements all required models for the main element of a color bulb that supports brightness, hue and saturation but also a color temperature controls and xyL controls. Note that for the full color bulb implementation this device needs to be combined with hue server (WICED_BT_MESH_MODEL_LIGHT_HSL_HUE_SERVER), saturation server (WICED_BT_MESH_MODEL_LIGHT_HSL_SATURATION_SERVER) and color temperature server (WICED_BT_MESH_MODEL_LIGHT_CTL_TEMPERATURE_SERVER) on the consecutive elements. The time and scheduler models are optional and can be commented out to reduce memory footprint.

#define WICED_BT_MESH_MODEL_LIGHT_LC_SERVER
Value:
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_SRV, wiced_bt_mesh_model_onoff_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LC_SETUP_SRV, wiced_bt_mesh_model_light_lc_setup_server_message_handler, NULL, NULL }
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.
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.
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.
wiced_bool_t wiced_bt_mesh_model_onoff_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
On/Off Server Message Handler.
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.

Mesh Light Controller Device.

This is an additional part of the light controller. The main part will contain one or more elements required to implement a dimmable or a colored bulb. The time and scheduler models are optional and can be commented out to reduce memory footprint.

#define WICED_BT_MESH_MODEL_LOCATION_SERVER
Value:
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LOCATION_SRV, wiced_bt_mesh_model_location_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LOCATION_SETUP_SRV, wiced_bt_mesh_model_location_setup_server_message_handler, NULL, NULL }
wiced_bool_t wiced_bt_mesh_model_location_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Location Setup Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_location_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Location Server Message Handler.

Mesh Location Server Device.

The device provides global and/or local location. The device can exist standalone and can be combined with other devices.

#define WICED_BT_MESH_MODEL_REMOTE_PROVISION_SERVER   { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_REMOTE_PROVISION_SRV, wiced_bt_mesh_remote_provisioning_server_message_handler, NULL, NULL }

Mesh Remote Provisioning Server Model.

The model is used by a Provisioner to provision new devices not in the immediate radio range, i.e. provision over mesh. This is an optional feature, but will provide additional flexibility for a mesh network. It is recommended to include in the first element space permitted.

#define WICED_BT_MESH_MODEL_SENSOR_SERVER
Value:
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SENSOR_SRV, wiced_bt_mesh_model_sensor_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SENSOR_SETUP_SRV, wiced_bt_mesh_model_sensor_setup_server_message_handler, NULL, NULL }
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.
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.
#define WICED_BT_MESH_MODEL_TIME_SERVER
Value:
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_TIME_SRV, wiced_bt_mesh_model_time_server_message_handler, NULL, NULL }, \
{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_TIME_SETUP_SRV, wiced_bt_mesh_model_time_setup_server_message_handler, NULL, NULL }
wiced_bool_t wiced_bt_mesh_model_time_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Time Server Message Handler.
wiced_bool_t wiced_bt_mesh_model_time_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)
Time Setup Server Message Handler.
#define WICED_BT_MESH_PROPERTY_TYPE_CLIENT   0

Property types defined in the Mesh Models specifications wiced_bt_mesh_property_type enumeration.

Property type client

Typedef Documentation

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

Property Client callback is called by the Mesh Models library on receiving a message from the peer.

Parameters
eventThe event that the application should process (see Mesh Property Events)
p_eventinformation about the message received. The same pointer should be used in the reply if required.
p_dataPointer to the data to send
Returns
None
typedef void( wiced_bt_mesh_property_server_callback_t)(uint8_t element_idx, uint16_t event, void *p_data)

Generic User Property Server callback is called by the Mesh Models library on receiving a message from the peer.

Parameters
element_idxElement Index of the model
eventThe event that the application should process (see User Property Events)
p_dataPointer to the property data
Returns
None
typedef uint16_t(* wiced_model_scene_recall_handler_t)(uint8_t element_idx, uint8_t *p_buffer, uint16_t buf_size, uint32_t transition_time, uint32_t delay)

Scene retrieve message handler.

Each model may define a message handler if it stores data per scene in the NVRAM. When Scene Server receives Scene Recall message it calls each model's handler.

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
Returns
Number of bytes the model read from the provided buffer
typedef uint16_t(* wiced_model_scene_store_handler_t)(uint8_t element_idx, uint8_t *p_buffer, uint16_t buf_size)

Scene store message handler.

Each model may define a message handler if it needs to store data per scene in the NVRAM. When Scene Server receives Scene Store message it calls each model's handler.

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

Function Documentation

wiced_bool_t wiced_bt_mesh_config_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Config Server Model Message Handler.

Application Library typically calls this function when function to process a message received from the Config Client. The function parses the message and if appropriate calls the application 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 combination, WICED_FALSE otherwise.
void wiced_bt_mesh_config_server_send_reply ( wiced_bt_mesh_event_t p_event,
uint16_t  opcode,
uint8_t *  p_buffer,
uint16_t  len 
)

This function can be called to send message through the core.

The function keeps track of the output event .

Parameters
p_eventFully prepared wiced_bt_mesh_event_t structure with information on where and how event should be sent
opcodeopcode to send
paramsPointer to the parameters data to be sent out.
lenSize of the parameters data to be sent out. The maximum length is about 377 bytes (depends on the size of the opcode).
void wiced_bt_mesh_config_server_send_segmented ( wiced_bool_t  enable)

This function can be called to configure configuration server to send always segmented messages regardless of the message size.

Parameters
enableWICED_TRUE enables the mode when config server always sends segmented messages. WICED_FALSE disables that mode.
wiced_bool_t wiced_bt_mesh_model_admin_property_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Admin Property 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.
wiced_bool_t wiced_bt_mesh_model_client_property_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Client Property 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.
int wiced_bt_mesh_model_find_element_idx ( uint16_t  company_id,
uint16_t  model_id,
uint8_t  start_idx 
)

Find model in the node configuration starting with specified element index.

Parameters
[in]company_idCompany ID of the model
[in]model_idModel ID of the model
[in]start_idxStarting element index
wiced_bool_t wiced_bt_mesh_model_manufacturer_property_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Manufacturer Property 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.
void wiced_bt_mesh_model_property_client_init ( uint8_t  element_idx,
wiced_bt_mesh_property_client_callback_t p_callback,
wiced_bool_t  is_provisioned 
)

Property 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 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_property_client_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

Property Client 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.
wiced_result_t wiced_bt_mesh_model_property_client_send_properties_get ( wiced_bt_mesh_event_t p_event,
wiced_bt_mesh_properties_get_data_t p_data 
)

The application can call this function to send Properties Get client message to the server.

Parameters
p_eventMesh event with the information about the message that has been created by the app for unsolicited message.
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
wiced_result_t wiced_bt_mesh_model_property_client_send_property_get ( wiced_bt_mesh_event_t p_event,
wiced_bt_mesh_property_get_data_t p_get 
)

The application can call this function to send Property Get client message to the server.

Parameters
p_eventMesh event with the information about the message that has been created by the app for unsolicited message.
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
wiced_result_t wiced_bt_mesh_model_property_client_send_property_set ( wiced_bt_mesh_event_t p_event,
wiced_bt_mesh_property_set_data_t p_sata 
)

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

Parameters
p_eventMesh event with the information about the message that has been created by the app for unsolicited message.
p_dataPointer to the data to send
Returns
WICED_BT_SUCCESS if message has been queued for transmission.
void wiced_bt_mesh_model_property_server_init ( uint8_t  element_idx,
wiced_bt_mesh_property_server_callback_t p_callback,
wiced_bool_t  is_provisioned 
)

Property Module initialization.

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
None
wiced_bool_t wiced_bt_mesh_model_user_property_server_message_handler ( wiced_bt_mesh_event_t p_event,
uint8_t *  p_data,
uint16_t  data_len 
)

User Property 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.
void wiced_bt_mesh_models_set_trace_level ( uint8_t  level)

Sets trace level for mesh_models_lib and mesh_provisioner_lib.

Application may call this function to set trace level for mesh_models_lib and mesh_provisioner_lib. By default trace level is 0(no trace).

Parameters
[in]levelTrace level to set. It can be any of WICED_BT_MESH_CORE_TRACE_XXX.
wiced_bool_t wiced_bt_mesh_remote_provisioning_connectable_adv_packet ( wiced_bt_ble_scan_results_t p_adv_report,
uint8_t *  p_adv_data 
)

Process Connectable Advertising Packets to check if the packet is for remote provisioning server.

Parameters
p_adv_reportAdvertising report paremeters
p_adv_dataAdvertising data
Returns
WICED_TRUE/WICED_FALSE - success/failed.
wiced_bool_t wiced_bt_mesh_remote_provisioning_nonconnectable_adv_packet ( wiced_bt_ble_scan_results_t p_adv_report,
uint8_t *  p_adv_data 
)

Process None Connectable Advertising Packets to check if the packet is for remote provisioning server.

Parameters
p_adv_reportAdvertising report paremeters
p_adv_dataAdvertising data
Returns
WICED_TRUE/WICED_FALSE - success/failed.
wiced_bool_t wiced_bt_mesh_remote_provisioning_scan_rsp ( wiced_bt_ble_scan_results_t p_adv_report,
uint8_t *  p_adv_data 
)

Process Scan Response Packets to check if the packet is for remote provisioning server.

Parameters
p_adv_reportAdvertising report paremeters
p_adv_dataAdvertising data
Returns
WICED_TRUE/WICED_FALSE - success/failed.
void wiced_bt_mesh_remote_provisioning_server_init ( void  )

Remote Provisioning Server initialization.

Parameters
None
Returns
None
void wiced_bt_mesh_remote_provisioning_server_set_min_rssi ( int8_t  min_rssi)

Configures Remote Provisioning Server shall drop all unprovisioned beacons and provisioning service adverts with RSSI less than min_rssi.

It shall be called after wiced_bt_mesh_remote_provisioning_server_init;

Parameters
min_rssimin RSSI to handle
Returns
None

Variable Documentation

uint8_t wiced_bt_mesh_model_timer_server_get_interval

Interval in seconds to send time get message while the time isn't set yet.

The value can be changed by the application. 0 means don't send time get message if time isn't initialized. Default value is 0.