![]() |
AIROC™ BTSDK v4.6 - Documentation | |||
Mesh Core library of the AIROC BTSDK provide a simple method for an application to integrate Bluetooth Mesh functionality. More...
Data Structures | |
struct | wiced_bt_mesh_sensor_config_descriptor_t |
Sensor descriptor structure exchanged between the application and the Sensor Model. More... | |
struct | wiced_bt_mesh_sensor_config_setting_t |
Sensor setting configuration exchanged between the application and the Sensor Model. More... | |
struct | wiced_bt_mesh_sensor_config_column_data_t |
Sensor column data configuration exchanged between the application and the Sensor Model. More... | |
struct | wiced_bt_mesh_sensor_config_cadence_t |
Defines Configuration of Sensor Cadence in the structure between the application and the Sensor Model. More... | |
struct | wiced_bt_mesh_core_config_sensor_t |
Defines configuration data of the one sensor in the array of structure wiced_bt_mesh_core_config_element_t. More... | |
struct | wiced_bt_mesh_core_state_iv_t |
Data for state type WICED_BT_MESH_CORE_STATE_IV. More... | |
struct | wiced_bt_mesh_core_state_seq_t |
Data for state type WICED_BT_MESH_CORE_STATE_TYPE_SEQ. More... | |
struct | wiced_bt_mesh_core_state_net_key_t |
Data for state types WICED_BT_MESH_CORE_STATE_NET_KEY_XXX. More... | |
struct | wiced_bt_mesh_core_state_app_key_t |
Data for state types WICED_BT_MESH_CORE_STATE_APP_KEY_XXX. More... | |
struct | wiced_bt_mesh_core_state_model_app_t |
Data for state types WICED_BT_MESH_CORE_STATE_APP_XXX. More... | |
struct | wiced_bt_mesh_core_state_node_state_t |
Data for state types WICED_BT_MESH_CORE_STATE_NODE_STATE. More... | |
struct | wiced_bt_mesh_core_state_friendship_t |
Data for state types WICED_BT_MESH_CORE_STATE_LPN_FRIENDSHIP and WICED_BT_MESH_CORE_STATE_FRND_FRIENDSHIP. More... | |
struct | wiced_bt_mesh_core_state_beacon_t |
Data for state types WICED_BT_MESH_CORE_STATE_PRIVATE_BEACON. More... | |
struct | wiced_bt_mesh_core_state_proxy_serivce_t |
Data for state types WICED_BT_MESH_CORE_STATE_PROXY_SERVICE_ADV. More... | |
union | wiced_bt_mesh_core_state_t |
struct | wiced_bt_mesh_core_init_t |
Data for wiced_bt_mesh_core_init. More... | |
struct | wiced_bt_mesh_core_hal_api_t |
hal api for wiced_bt_mesh_core_set_hal_api() Application has to implement all these functions and call wiced_bt_mesh_core_set_hal_api() at the startup. More... | |
struct | wiced_bt_mesh_core_provision_capabilities_t |
Defines Capabilities data of the provisioning device. More... | |
struct | wiced_bt_mesh_core_provision_start_t |
Defines Start data sent by Provisioner to the provisioning device. More... | |
struct | wiced_bt_mesh_core_precord_descriptor_t |
Provisioning Records Handler Descriptor. More... | |
struct | mesh_core_provision_cb_t |
Mesh Core Provisioning Control Block. More... | |
struct | wiced_bt_mesh_core_statistics_t |
Represents statistics of messages receiving, sending and handling by network and bearers layers. More... | |
struct | wiced_bt_mesh_core_transport_statistics_t |
Represents statistics of messages receiving, sending and handling by transport layers. More... | |
struct | wiced_bt_mesh_event__t |
Mesh event structure is exchanged between the app and the mesh models library. More... | |
Macros | |
#define | PACKED |
#define | WICED_BT_MESH_CORE_NVRAM_CHUNK_MAX_SIZE 255 |
#define | WICED_BT_MESH_PROVISION_PRIV_KEY_LEN 32 |
Size of the private key in bytes. | |
#define | WICED_BT_MESH_KEY_LEN 16 |
Size of the mesh keys. | |
#define | WICED_BT_MESH_PROVISIONING_RECORD_BUFF_MAX_SIZE WICED_BT_MESH_PROVISION_PUBLIC_KEY_LEN |
#define | WICED_BT_MESH_CORE_TRACE_FID_MESH_DISCOVERY 0x00000002 |
#define | WICED_BT_MESH_CORE_TRACE_FID_ACESS_LAYER 0x00000004 |
#define | WICED_BT_MESH_CORE_TRACE_FID_CORE_AES_CCM 0x00000008 |
#define | WICED_BT_MESH_CORE_TRACE_FID_IV_UPDT 0x00000010 |
#define | WICED_BT_MESH_CORE_TRACE_FID_KEY_REFRESH 0x00000020 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FOUNDATION 0x00000040 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FOUNDATION_CFG_MODEL 0x00000080 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FOUNDATION_CRT_MSG 0x00000100 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FOUNDATION_HEARTBEAT 0x00000200 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FOUNDATION_IDENTITY 0x00000400 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FOUNDATION_MSG_HANDLER 0x00000800 |
#define | WICED_BT_MESH_CORE_TRACE_FID_NETWORK_LAYER 0x00001000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_LOWER_TRANSPORT_LAYER 0x00002000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_UPPER_TRANSPORT_LAYER 0x00004000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_PB_TRANSPORT 0x00008000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_PROVISIONING 0x00010000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_MESH_CORE 0x00020000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_MESH_UTIL 0x00040000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FRIENDSHIP 0x00080000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_LOW_POWER 0x00100000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_FRIEND 0x00200000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_HEALTH 0x00400000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_MESH_EVENT 0x00800000 |
#define | WICED_BT_MESH_CORE_TRACE_FID_ALL 0xffffffff |
#define | WICED_BT_MESH_CORE_TRACE_DEBUG 4 |
#define | WICED_BT_MESH_CORE_TRACE_INFO 3 |
#define | WICED_BT_MESH_CORE_TRACE_WARNING 2 |
#define | WICED_BT_MESH_CORE_TRACE_CRITICAL 1 |
#define | WICED_BT_MESH_CORE_TRACE_NO 0 |
Typedefs | |
struct { | |
uint16_t company_id | |
Company ID of the model. More... | |
uint16_t model_id | |
Model ID. | |
void * p_message_handler | |
message handler for this model | |
void * p_scene_store_handler | |
function to call to store the scene contents | |
void * p_scene_recall_handler | |
function to call to recall the scene contents | |
} | wiced_bt_mesh_core_config_model_t |
Defines configuration data of the one model in the array models of the structure wiced_bt_mesh_core_config_element_t. | |
struct { | |
uint16_t id | |
Property ID of the property. More... | |
uint8_t type | |
Property type (client, admin, manufacturer or user. | |
uint8_t user_access | |
User Access state of the property. | |
uint8_t max_len | |
len for the property value | |
uint8_t * value | |
pointer to the property value | |
} | wiced_bt_mesh_core_config_property_t |
Defines configuration data of the one property in the array properties of the structure wiced_bt_mesh_core_config_element_t. | |
struct { | |
uint16_t location | |
A location description as defined in the GATT Bluetooth Namespace Descriptors section of the Bluetooth SIG Assigned Numbers. | |
uint32_t default_transition_time | |
Default transition time for models of the element in milliseconds. | |
uint8_t onpowerup_state | |
Default element behavior on power up. | |
uint16_t default_level | |
Default value of the variable controlled on this element (for example power, lightness, temperature, hue...) | |
uint16_t range_min | |
Minimum value of the variable controlled on this element (for example power, lightness, temperature, hue...) | |
uint16_t range_max | |
Maximum value of the variable controlled on this element (for example power, lightness, temperature, hue...) | |
uint8_t move_rollover | |
If true when level gets to range_max during move operation, it switches to min, otherwise move stops. More... | |
uint8_t properties_num | |
Number of properties in the properties array. | |
wiced_bt_mesh_core_config_property_t * properties | |
Array of properties of that element. More... | |
uint8_t sensors_num | |
Number of sensors in the sensor array. | |
wiced_bt_mesh_core_config_sensor_t * sensors | |
Array of sensors of that element. | |
uint8_t models_num | |
Number of models in the array models. | |
wiced_bt_mesh_core_config_model_t * models | |
Array of models located in that element. More... | |
} | wiced_bt_mesh_core_config_element_t |
Defines configuration data of the one element in the array elements of the structure wiced_bt_mesh_core_config_t. | |
struct { | |
uint8_t rssi_factor | |
The contribution of the RSSI measured by the Friend node used in Friend Offer Delay calculations.Must be <= 3. More... | |
uint8_t receive_window_factor | |
The contribution of the supported Receive Window used in Friend Offer Delay calculations.Must be <= 3. More... | |
uint8_t min_cache_size_log | |
The minimum number of messages that the Friend node can store in its Friend Cache.Must be >= 1 and <= 7. More... | |
uint8_t receive_delay | |
Receive delay in 1 ms units to be requested by the Low Power node. More... | |
uint32_t poll_timeout | |
Poll timeout in 100ms units to be requested by the Low Power node. More... | |
uint8_t startup_unprovisioned_adv_to | |
Interval in seconds of the advertisments of unprovisioned beacon and service on startup. More... | |
} | wiced_bt_mesh_core_config_low_power_t |
Defines configuration data for Low Power Feature in the wiced_bt_mesh_core_config_t. | |
struct { | |
uint8_t receive_window | |
Receive Window value in milliseconds supported by the Friend node. More... | |
uint16_t cache_buf_len | |
Length of the buffer for the cache. | |
uint16_t max_lpn_num | |
Max number of Low Power Nodes with established friendship. More... | |
} | wiced_bt_mesh_core_config_friend_t |
Defines configuration data for Friend Feature in the wiced_bt_mesh_core_config_t. | |
struct { | |
uint16_t company_id | |
Company identifier assigned by the Bluetooth SIG. | |
uint16_t product_id | |
Vendor-assigned product identifier. | |
uint16_t vendor_id | |
Vendor-assigned product version identifier. | |
uint16_t features | |
A bit field indicating the device features (see Supported features bitmap) | |
uint16_t oob | |
The OOB field (see OOB bitmap). More... | |
const char * uri | |
Optional URI (can be NULL) for advertising along with the Unprovisioned Device beacon. More... | |
wiced_bt_mesh_core_config_friend_t friend_cfg | |
Friend feature configuration. More... | |
wiced_bt_mesh_core_config_low_power_t low_power | |
Low Power configuration. More... | |
wiced_bool_t gatt_client_only | |
If TRUE, the device only connects to mesh over GATT proxy. More... | |
uint8_t elements_num | |
Number of elements in the following array elements. | |
wiced_bt_mesh_core_config_element_t * elements | |
Array of elements defined by tFND_ELEMENT with size elements_num. | |
} | wiced_bt_mesh_core_config_t |
To calculate max_lpn_num: #define MSG_OFFSET 20 // offset in friend structure defined internally in mesh core library is 20 bytes #define MSG_QUE_SIZE 33 // Each message in the queue takes 33 bytes #define FRIEND_LPN_STATE 140 // sizeof friend LPN structure defined internally in mesh core library is 140 bytes uint16_t max_lpn_msg_num; // number of messages user application needs in the queue uint64_t app_available_memory; // available user application memory. More... | |
struct { | |
uint8_t ctl | |
CTL field. More... | |
uint8_t ttl | |
TTL field. More... | |
uint8_t dst [2] | |
Destination address (LE) | |
uint8_t pdu [1] | |
TransportPDU set to between 1 and 16 inclusive octets of data. | |
} | wiced_bt_mesh_core_hci_cmd_network_layer_transmit_t |
struct { | |
uint8_t ctl | |
CTL field. More... | |
uint8_t ttl | |
TTL field. More... | |
uint8_t dst_len | |
Length of the destination address. More... | |
uint8_t dst [16] | |
BigEndian 2 bytes destination address or 16 bytes label UUID of the virtual address. | |
uint8_t szmic | |
0 - 4 bytes TransMIC size, 1 - 8 bytes TransMIC size | |
uint8_t pdu [1] | |
AccessPDU set to between 1 and 380 inclusive octets of data. | |
} | wiced_bt_mesh_core_hci_cmd_transport_layer_transmit_t |
struct { | |
uint8_t in_progress | |
1 - Transit to IV Update in Progress; 0 - Transit to Normal | |
} | wiced_bt_mesh_core_hci_cmd_ivupdate_signal_transit_t |
struct { | |
uint8_t conn_id [4] | |
connection id for provisioning. More... | |
uint8_t addr [2] | |
unicast address to assign to provisioning node | |
uint8_t uuid [16] | |
UUID of the node to provision. | |
uint8_t identify_duration | |
identify duration to pass to that provision start command | |
} | wiced_bt_mesh_core_hci_cmd_provision_t |
struct { | |
uint8_t test_id | |
Test ID of the faults array. | |
uint8_t company_id [2] | |
Company ID. | |
uint8_t faults [1] | |
faults array. More... | |
} | wiced_bt_mesh_core_hci_cmd_health_set_faults_t |
struct { | |
uint8_t ttl | |
TTL field. More... | |
uint8_t app_key_idx [2] | |
Global Index of the Application Key (LE). More... | |
uint8_t src [2] | |
Source address (LE) | |
uint8_t dst [2] | |
Destination address (LE) | |
uint8_t pdu [1] | |
Access PDU. | |
} | wiced_bt_mesh_core_hci_cmd_access_pdu_t |
struct { | |
uint8_t add | |
WICED_TRUE/WICED_FALSE - add/remove. | |
uint8_t addr [2] | |
Subscription address (LE) | |
} | wiced_bt_mesh_core_hci_cmd_send_subs_updt_t |
typedef wiced_bool_t(* | wiced_bt_mesh_core_received_msg_handler_t )(wiced_bt_mesh_event_t *p_event, const uint8_t *params, uint16_t params_len) |
Received message callback. More... | |
typedef wiced_bt_mesh_core_received_msg_handler_t(* | wiced_bt_mesh_core_get_msg_handler_callback_t )(uint16_t company_id, uint16_t opcode, uint16_t *p_model_id, uint8_t *p_rpl_flag) |
Get message handler callback. More... | |
typedef wiced_bool_t(* | wiced_bt_mesh_core_publication_callback_t )(uint8_t elem_idx, uint16_t company_id, uint16_t model_id, uint16_t period) |
Publication request callback. More... | |
typedef uint32_t(* | wiced_bt_core_nvram_access_t )(wiced_bool_t write, int inx, uint8_t *node_info, uint16_t len, wiced_result_t *p_result) |
Application provided function to read/write information from/to NVRAM. More... | |
typedef void(* | wiced_bt_mesh_core_scan_callback_t )(wiced_bool_t start, wiced_bool_t is_scan_type_active) |
Start/Stop scan callback. More... | |
typedef void(* | wiced_bt_mesh_core_proxy_send_cb_t )(uint32_t conn_id, uint32_t ref_data, const uint8_t *packet, uint32_t packet_len) |
Definition of the callback function to send proxy messages. More... | |
typedef uint8_t(* | wiced_bt_mesh_core_health_fault_test_cb_t )(uint8_t element, uint8_t test_id, uint16_t company_id, uint8_t fault_array_size, uint8_t *fault_array) |
Definition of the callback function to send proxy packet. More... | |
typedef void(* | wiced_bt_mesh_core_attention_cb_t )(uint8_t element, uint8_t time) |
Definition of the callback function to attract human attention by LED blinks or other. More... | |
typedef void(* | wiced_bt_mesh_core_state_changed_callback_t )(wiced_bt_mesh_core_state_type_t type, wiced_bt_mesh_core_state_t *p_state) |
typedef wiced_bool_t(* | wiced_bt_mesh_core_adv_send_cb_t )(uint8_t instance, uint8_t transmissions, uint32_t interval, uint8_t type, uint8_t *own_bd_addr, const uint8_t *adv_data, uint8_t adv_data_len, const uint8_t *scan_rsp_data, uint8_t scan_rsp_data_len) |
Definition of the callback function to send advert messages or stop sending it or reset all adverts. More... | |
typedef void(* | wiced_bt_mesh_core_hal_rand_gen_num_array_t )(uint32_t *randNumberArrayPtr, uint32_t length) |
Fills a given array with randomly generated 32-bit integers. More... | |
typedef uint32_t(* | wiced_bt_mesh_core_hal_get_pseudo_rand_number_t )(void) |
This functin returns a pseudo random number. More... | |
typedef uint32_t(* | wiced_bt_mesh_core_hal_rand_gen_num_t )(void) |
Generates and returns a random 32-bit integer. More... | |
typedef void(* | wiced_bt_mesh_core_hal_wdog_reset_system_t )(void) |
Execute a soft reset of the system. | |
typedef void(* | wiced_bt_mesh_core_hal_delete_nvram_t )(uint16_t vs_id, wiced_result_t *p_status) |
deletes data from NVRAM at specified VS id More... | |
typedef uint16_t(* | wiced_bt_mesh_core_hal_write_nvram_t )(uint16_t vs_id, uint16_t data_length, uint8_t *p_data, wiced_result_t *p_status) |
Writes the data to NVRAM, Application can write up to 255 bytes in one VS id section. More... | |
typedef uint16_t(* | wiced_bt_mesh_core_hal_read_nvram_t )(uint16_t vs_id, uint16_t data_length, uint8_t *p_data, wiced_result_t *p_status) |
Reads the data from NVRAM. More... | |
typedef void(* | wiced_bt_mesh_core_hal_aes_encrypt_t )(uint8_t *in_data, uint8_t *out_data, uint8_t *key) |
Calculate AES encryption by using Hardware acceleration. More... | |
typedef void(* | wiced_bt_mesh_core_send_complete_callback_t )(wiced_bt_mesh_event_t *p_event) |
Send message complete callback. More... | |
struct { | |
uint16_t extensions | |
Bitmask indicating the provisioning extensions supported by the device. | |
uint16_t list [WICED_BT_MESH_PROVISIONING_RECORD_ID_MAX_SIZE] | |
Lists the Record IDs of the provisioning records stored on the device. | |
uint16_t list_size | |
sizes of the record data in the list | |
} | wiced_bt_mesh_core_provisioning_list_t |
struct { | |
uint16_t record_id | |
Identifies the provisioning record for which the request is made. | |
uint16_t fragment_offset | |
The starting offset of the requested fragment in the provisioning record data. | |
uint16_t fragment_max_size | |
The maximum size of the provisioning record fragment that the provisioner can receive. | |
} | wiced_bt_mesh_core_provisioning_record_request_t |
Provisioning Record Request PDU parameters format. More... | |
struct { | |
uint16_t record_id | |
Identifies the provisioning record whose data fragment is sent in the response. | |
uint16_t fragment_offset | |
The starting offset of the data fragment in the provisioning record data. | |
uint16_t total_length | |
Total length of the provisioning record data stored on the device. | |
} | wiced_bt_mesh_core_provisioning_record_response_t |
struct { | |
uint8_t status | |
Indicates whether or not the request was handled successfully. | |
union { | |
wiced_bt_mesh_core_provisioning_record_request_t request | |
wiced_bt_mesh_core_provisioning_record_response_t response | |
} u | |
uint8_t data [WICED_BT_MESH_PROVISIONING_RECORD_BUFF_MAX_SIZE] | |
Provisioning record data fragment (Optional) | |
uint16_t size | |
Size of valid data in the record fragment. | |
} | wiced_bt_mesh_core_provisioning_record_t |
Provisioning Record Response PDU parameters format. More... | |
typedef void(* | wiced_bt_mesh_core_provision_gatt_send_cb_t )(uint16_t conn_id, const uint8_t *packet, uint32_t packet_len) |
Definition of the callback function to send provisioning packet. More... | |
typedef void(* | wiced_bt_mesh_core_provision_started_cb_t )(uint32_t conn_id) |
Definition of the callback function on Starts provisioning. More... | |
typedef void(* | wiced_bt_mesh_core_provision_end_cb_t )(uint32_t conn_id, uint16_t addr, uint16_t net_key_idx, uint8_t result, const uint8_t *p_dev_key) |
Definition of the callback function on provisioning end. More... | |
typedef wiced_bool_t(* | wiced_bt_mesh_core_provision_get_oob_cb_t )(uint32_t conn_id, uint8_t type, uint8_t size, uint8_t action) |
Definition of the callback function on get OOB. More... | |
typedef wiced_bool_t(* | wiced_bt_mesh_core_provision_on_capabilities_cb_t )(uint32_t conn_id, const wiced_bt_mesh_core_provision_capabilities_t *capabilities) |
Definition of the callback function on Capabilities. More... | |
typedef wiced_bool_t(* | wiced_bt_mesh_core_provision_get_capabilities_cb_t )(uint32_t conn_id) |
Definition of the callback function on get Capabilities. More... | |
typedef uint16_t(* | wiced_bt_mesh_core_provision_records_get_cb_t )(uint16_t *buffer) |
Definition of the callback function on get provisioning records list. More... | |
typedef uint16_t(* | wiced_bt_mesh_core_provision_record_req_cb_t )(uint16_t record_id, uint8_t *buffer, uint16_t fragment_length, uint16_t fragment_offset, uint16_t *record_size) |
Definition of the callback function on get fragment of the provisioning record. More... | |
typedef const uint8_t *(* | wiced_bt_mesh_core_get_dev_key_callback_t )(uint16_t addr, uint16_t *p_net_key_idx) |
Device Key request callback. More... | |
typedef void(* | wiced_bt_mesh_core_lpn_sleep_callback_t )(uint32_t *p_sleep_time) |
Callback function to receive LPN sleep event. More... | |
typedef struct wiced_bt_mesh_event__t | wiced_bt_mesh_event_t |
Mesh event structure is exchanged between the app and the mesh models library. | |
Functions | |
void | wiced_bt_mesh_core_set_hal_api (wiced_bt_mesh_core_hal_api_t *hal_api) |
Sets hal api. More... | |
wiced_bt_mesh_core_hal_api_t * | wiced_bt_mesh_core_get_hal_api (void) |
Returns hal api. More... | |
wiced_result_t | wiced_bt_mesh_core_init (wiced_bt_mesh_core_init_t *p_init) |
Mesh Core initialization. More... | |
void | wiced_bt_mesh_core_adv_end (uint8_t instance) |
Advertisement stopped notification. More... | |
void | wiced_bt_mesh_core_set_max_num_adv_instances (uint8_t max_num) |
Set max number of advertisement instances. More... | |
wiced_bool_t | wiced_bt_mesh_core_deinit (wiced_bt_core_nvram_access_t nvram_access_callback) |
Mesh Core de-initialization. More... | |
void | wiced_bt_mesh_core_start (void) |
Mesh Core Start. More... | |
void | wiced_bt_mesh_core_set_gatt_mtu (uint16_t gatt_mtu) |
Sets GATT MTU for the provisioning or proxy connection. More... | |
uint16_t | wiced_bt_mesh_core_get_local_addr (void) |
Gets local mesh address set by provisioner. More... | |
wiced_result_t | wiced_bt_mesh_core_send (wiced_bt_mesh_event_t *p_event, const uint8_t *params, uint16_t params_len, wiced_bt_mesh_core_send_complete_callback_t complete_callback) |
Sends the message to the dst address. More... | |
void | wiced_bt_mesh_core_cancel_send (wiced_bt_mesh_event_t *p_event) |
Stop sending retransmissions. More... | |
wiced_result_t | wiced_bt_mesh_core_adv_packet (int8_t rssi, const uint8_t *p_adv_data, const uint8_t *remote_bd_addr) |
Handles received advertising packet. More... | |
void | wiced_bt_mesh_core_proxy_packet (const uint8_t *p_data, uint8_t data_len) |
Handle packet received by proxy via GATT. More... | |
wiced_bool_t | wiced_bt_mesh_core_is_valid_network_id (uint8_t *p_network_id, uint16_t *p_net_key_idx) |
Get Network Key Index. More... | |
void | wiced_bt_mesh_core_connection_status (uint32_t conn_id, wiced_bool_t connected_to_proxy, uint32_t ref_data, uint16_t mtu) |
Handles connection up and down events. More... | |
wiced_bool_t | wiced_bt_mesh_core_check_node_identity (uint16_t addr, const uint8_t *data, uint8_t len, uint16_t *p_net_key_idx) |
Checks if received Service Data for Mesh Proxy Service with Node Identity corresponds to that node address. More... | |
wiced_bool_t | wiced_bt_mesh_core_check_private_node_identity (uint16_t addr, const uint8_t *data, uint8_t len, uint16_t *p_net_key_idx) |
Checks if received Service Data for Mesh Proxy Service with Private Node Identity corresponds to that node address. More... | |
wiced_bool_t | wiced_bt_mesh_core_check_private_network_id (const uint8_t *data, uint8_t len, uint16_t *p_net_key_idx) |
Checks if received Service Data for Mesh Proxy Service with Private Network Identity is valid. More... | |
wiced_bool_t | wiced_bt_mesh_core_proc_rx_cmd (uint16_t opcode, const uint8_t *p_data, uint16_t data_len) |
The RPL updates from the Host. More... | |
wiced_bool_t | wiced_bt_mesh_core_test_mode_signal (uint16_t opcode, const uint8_t *p_data, uint16_t data_len) |
The signals for different test modes. More... | |
void | wiced_bt_mesh_core_calc_uri_hash (const uint8_t *uri, uint8_t len, uint8_t *hash) |
void | wiced_bt_mesh_core_set_node_identity (uint8_t type, uint8_t action) |
Sets node identity state as a result of user interaction. More... | |
wiced_bool_t | wiced_bt_mesh_core_health_set_faults (uint8_t element_idx, uint8_t test_id, uint16_t company_id, uint8_t faults_number, uint8_t *fault_array) |
Indicates the fault happened. More... | |
wiced_bool_t | wiced_bt_mesh_core_provision_server_init (uint8_t *priv_key, wiced_bt_mesh_core_provision_started_cb_t started_cb, wiced_bt_mesh_core_provision_end_cb_t end_cb, wiced_bt_mesh_core_provision_get_capabilities_cb_t get_capabilities_cb, wiced_bt_mesh_core_provision_get_oob_cb_t get_oob_cb, wiced_bt_mesh_core_provision_gatt_send_cb_t gatt_send_cb, wiced_bt_mesh_core_provision_records_get_cb_t get_precords_cb, wiced_bt_mesh_core_provision_record_req_cb_t request_precord_cb) |
Initializes provisioning layer for the node(server side). More... | |
wiced_bool_t | wiced_bt_mesh_core_provision_set_oob (uint8_t *value, uint8_t value_len) |
Sets OOB in response on wiced_bt_mesh_provision_get_oob_cb. More... | |
wiced_bool_t | wiced_bt_mesh_core_provision_set_capabilities (uint32_t conn_id, const wiced_bt_mesh_core_provision_capabilities_t *capabilities) |
Sets Capabilities of the provisioning device. More... | |
void | wiced_bt_mesh_core_provision_gatt_packet (uint8_t is_notification, uint32_t conn_id, const uint8_t *packet, uint8_t packet_len) |
Processes received PB_GATT packets. More... | |
wiced_bool_t | wiced_bt_mesh_core_provision_local (uint16_t addr, uint8_t *dev_key, uint8_t *network_key, uint16_t net_key_idx, uint32_t iv_idx, uint8_t key_refresh, uint8_t iv_update) |
Provision Local Device. More... | |
wiced_bool_t | wiced_bt_mesh_core_set_seq (uint16_t addr, uint32_t seq, wiced_bool_t prev_iv_idx) |
Set Sequence Number (SEQ) own or for RPL(Replay Protection List). More... | |
wiced_bool_t | wiced_bt_mesh_core_del_seq (uint16_t addr) |
Removes node from RPL(Replay Protection List). More... | |
uint16_t | wiced_bt_mesh_get_node_config_size (wiced_bt_mesh_core_config_t *config) |
Calculates size of the memory for configuration. More... | |
void | wiced_bt_mesh_core_stop_advert (void) |
Stops proxy server advertisement and network secure beacon if they are running. More... | |
void | wiced_bt_mesh_core_statistics_get (wiced_bt_mesh_core_statistics_t *p_data) |
Requests collected statistics for network layer. More... | |
void | wiced_bt_mesh_core_transport_statistics_get (wiced_bt_mesh_core_transport_statistics_t *p_data) |
Requests collected statistics for transport layer. More... | |
void | wiced_bt_mesh_core_statistics_reset (void) |
Resets statistics of the network layer. More... | |
void | wiced_bt_mesh_core_transport_statistics_reset (void) |
Resets statistics of the transport layers. More... | |
void | wiced_bt_mesh_core_execute_delayed_nvram_writes (void) |
wiced_bool_t | wiced_bt_mesh_core_get_network_id (uint16_t net_key_idx, uint8_t *network_id) |
Fills buffer net_id with 8 bytes Network ID for net_key_idx. More... | |
uint16_t | wiced_bt_mesh_core_crypt (wiced_bool_t encrypt, const uint8_t *p_in_data, uint16_t in_data_len, uint8_t *p_out_buf, uint16_t out_buf_len) |
Encrypt or decrypts and authenticates data. More... | |
wiced_bool_t | wiced_bt_mesh_set_raw_scan_response_data (uint8_t num_elem, wiced_bt_ble_advert_elem_t *p_data) |
Set scan response raw data. More... | |
void | wiced_bt_mesh_core_set_dev_key_callback (wiced_bt_mesh_core_get_dev_key_callback_t callback) |
Sets Device Key request callback. More... | |
uint16_t | wiced_bt_mesh_core_lpn_get_friend_addr (void) |
Gets friend address of the LPN. More... | |
void | wiced_bt_mesh_core_lpn_set_sleep_callback (wiced_bt_mesh_core_lpn_sleep_callback_t callback) |
Set callback function to receive LPN sleep event. More... | |
uint32_t | wiced_bt_mesh_core_lpn_set_poll_timeout (uint32_t timeout) |
Set a smaller poll timeout. More... | |
void | wiced_bt_mesh_core_lpn_restore_poll_timeout (uint32_t timeout) |
Restore original poll timeout. More... | |
void | wiced_bt_mesh_core_shutdown (void) |
Stops all advertisements and timers. More... | |
wiced_bool_t | wiced_bt_mesh_core_del_last_element (void) |
Deletes last element from NVRAM config. More... | |
wiced_bool_t | wiced_bt_mesh_core_needs_composition_refresh (void) |
Detects if Node Composition Refresh Procedure is needed. More... | |
void | wiced_bt_mesh_core_reset (void) |
Resets node to unprovisioned state without restarting. More... | |
const uint8_t * | wiced_bt_mesh_core_get_app_key (uint16_t appkey_global_idx, wiced_bool_t newKeyAtKeyRefresh) |
Returns pointer to the specific application key. More... | |
void | wiced_bt_mesh_core_set_test_events_report (uint16_t node_addr) |
Set test events report node address. More... | |
void | wiced_bt_mesh_core_set_beacon (uint8_t type, uint8_t onoff) |
Sets beacon state as a result of user interaction. More... | |
void | wiced_bt_mesh_core_set_trace_level (uint32_t fids_mask, uint8_t level) |
Sets trace level for modules of mesh_core_lib. More... | |
wiced_bt_mesh_event_t * | wiced_bt_mesh_create_reply_event (wiced_bt_mesh_event_t *p_event) |
Create message reply mesh event from the received mesh event. More... | |
wiced_bt_mesh_event_t * | wiced_bt_mesh_copy_event (wiced_bt_mesh_event_t *p_event) |
Create the copy of the existing mesh event. More... | |
wiced_bt_mesh_event_t * | wiced_bt_mesh_create_event (uint8_t element_index, uint16_t company_id, uint16_t model_id, uint16_t dst, uint16_t app_key_idx) |
Create mesh event for an unsolicited message. More... | |
void | wiced_bt_mesh_release_event (wiced_bt_mesh_event_t *p_event) |
Release mesh event. More... | |
Variables | |
wiced_bt_mesh_core_config_t | mesh_config |
uint8_t | wiced_bt_mesh_core_net_key_max_num |
uint8_t | wiced_bt_mesh_core_app_key_max_num |
uint8_t | wiced_bt_mesh_core_net_cache_size |
uint8_t | wiced_bt_mesh_core_proxy_out_flt_addr_max_num |
uint16_t | wiced_bt_mesh_core_nvm_idx_node_data |
uint16_t | wiced_bt_mesh_core_nvm_idx_virt_addr |
uint16_t | wiced_bt_mesh_core_nvm_idx_frnd_state |
uint16_t | wiced_bt_mesh_core_nvm_idx_net_key_begin |
uint16_t | wiced_bt_mesh_core_nvm_idx_app_key_begin |
uint16_t | wiced_bt_mesh_core_nvm_idx_health_state |
uint16_t | wiced_bt_mesh_core_nvm_idx_cfg_data |
uint16_t | wiced_bt_mesh_core_nvm_idx_fw_distributor |
uint16_t | wiced_bt_mesh_core_nvm_idx_df_config |
uint8_t | wiced_bt_mesh_core_adv_tx_power |
uint32_t | wiced_bt_mesh_core_write_config_delay |
wiced_bool_t | wiced_bt_core_short_trans_mic |
If the value of that variable is WICED_TRUE then the transport layer always use 32-bit TransMIC. More... | |
wiced_bool_t | wiced_bt_core_iv_update_test_mode |
WICED_TRUE value activates IV Update test mode - only removes the 96-hour limit; all other behavior of the device is unchanged. More... | |
wiced_bool_t | wiced_bt_core_boost_cpu_on_crypt_op |
On WICED_TRUE CPU is boost for cpypto operations Default value is WICED_TRUE. | |
uint16_t | wiced_bt_mesh_core_unprovisioned_beacon_interval |
Advertising interval of the unprovisioned beacon in units 0.5 sec. More... | |
uint16_t | wiced_bt_mesh_core_provisioning_srv_adv_interval |
Advertising interval in MS of the provisioning service in units 0.5 sec. More... | |
uint16_t | wiced_bt_mesh_core_provisioning_url_adv_interval |
Advertising interval in MS of the provisioning URL in units 0.5 sec. More... | |
uint16_t | wiced_bt_mesh_core_delay_relay_min |
Minimum and maximum delay in milliseconds of the message being relayed. More... | |
uint16_t | wiced_bt_mesh_core_delay_relay_max |
uint16_t | wiced_bt_mesh_core_delay_answer_unicast_min |
Minimum and maximum delay in milliseconds of the answer on the message with unicast DST. More... | |
uint16_t | wiced_bt_mesh_core_delay_answer_unicast_max |
uint16_t | wiced_bt_mesh_core_delay_answer_group_min |
Minimum and maximum delay in milliseconds of the answer on the message with group DST. More... | |
uint16_t | wiced_bt_mesh_core_delay_answer_group_max |
uint16_t | wiced_bt_core_lower_transport_ack_timeout_ms |
Lower Transport Layer ACK timeout. More... | |
uint16_t | wiced_bt_mesh_core_proxy_adv_interval |
Proxy service adv interval: * 0.625 ms. More... | |
uint16_t | mesh_core_report_events_node_addr |
Report core events from a node for test purpose. | |
Supported features bitmap | |
The following is the list of optional features that a mesh node can support. | |
#define | WICED_BT_MESH_CORE_FEATURE_BIT_RELAY 0x0001 |
Relay feature support: 0 = False, 1 = True. | |
#define | WICED_BT_MESH_CORE_FEATURE_BIT_FRIEND 0x0002 |
Friend feature support: 0 = False, 1 = True. | |
#define | WICED_BT_MESH_CORE_FEATURE_BIT_LOW_POWER 0x0004 |
Low Power feature support: 0 = False, 1 = True. | |
#define | WICED_BT_MESH_CORE_FEATURE_BIT_GATT_PROXY_SERVER 0x0008 |
GATT Proxy support: 0 = False, 1 = True. | |
#define | WICED_BT_MESH_CORE_FEATURE_BIT_PB_GATT 0x0010 |
PB_GATT support: 0 = False, 1 = True. | |
#define | WICED_BT_MESH_CORE_FEATURE_BIT_NO_ADV_BEARER 0x0020 |
For GATT client mode: advert scanning but no advert sending and receiving: 0 = False, 1 = True. | |
#define | WICED_BT_MESH_CORE_FEATURE_BIT_DISABLE_NET_BEACON 0x0040 |
Makes net beacon disabled by default: 0 = False, 1 = True. | |
OOB bitmap | |
The OOB field is used to help drive the provisioning process by indicating the availability of OOB data, such as a public key of the device. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_OTHER 0x0001 |
Other. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_ELECTRONIC_URI 0x0002 |
Electronic / URI. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_2D_CODE 0x0004 |
2D machine-readable code | |
#define | WICED_BT_MESH_CORE_OOB_BIT_BAR_CODE 0x0008 |
Bar code. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_NFC 0x0010 |
Near Field Communication (NFC) | |
#define | WICED_BT_MESH_CORE_OOB_BIT_NUMBER 0x0020 |
Number. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_STRING 0x0040 |
String. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_CERTIFICATE 0x0080 |
Certificate-based provisioning. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_RECORD 0x0100 |
Provisioning records. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_RFU3 0x0200 |
Reserved for Future Use. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_RFU4 0x0400 |
Reserved for Future Use. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_ON_BOX 0x0800 |
On box. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_INSIDE_BOX 0x1000 |
Inside box. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_ON_PIECE_OF_PAPER 0x2000 |
On piece of paper. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_INSIDE_MANUAL 0x4000 |
Inside manual. | |
#define | WICED_BT_MESH_CORE_OOB_BIT_ON_DEVICE 0x8000 |
On device. | |
Special Commands of the Proxy Filter, Heartbeat and other | |
The following is the list of the special commands of the Proxy Filter, Heartbeat and other that came from Network and Transport layers into wiced_bt_mesh_core_received_msg_handler_t. | |
#define | WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_SET_TYPE 0x00 |
Opcodes of the Proxy Configuration Messages. More... | |
#define | WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_ADD_ADDR 0x01 |
Sent by a Proxy Client to add addresses to the proxy filter list. More... | |
#define | WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_DEL_ADDR 0x02 |
Sent by a Proxy Client to remove addresses from the proxy filter list. More... | |
#define | WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_STATUS 0x03 |
Acknowledgment by a Proxy Server to a Proxy Client to report the status of the proxy filter list. More... | |
#define | WICED_BT_MESH_CORE_CMD_SPECIAL_DIRECTED_PROXY_CAPABILITIES_STATUS 0x04 |
Sent by a Directed Proxy Server to report the status of its capabilities for a subnet. More... | |
#define | WICED_BT_MESH_CORE_CMD_SPECIAL_DIRECTED_PROXY_CONTROL 0x05 |
Sent by a Directed Proxy Client to set connection parameters of the Directed Proxy for a subnet. More... | |
#define | WICED_BT_MESH_CORE_CMD_SPECIAL_HEARTBEAT 0x0a |
Heartbeat message came from Transport layer. More... | |
Test Mode Signals. | |
The following is the list of signals used for certification and compliance testing. | |
#define | WICED_BT_MESH_CORE_TEST_MODE_SIGNAL_IV_UPDATE_BEGIN 0 |
the node shall transition to the IV Update in Progress state, ignoring the 96 hour limit. More... | |
#define | WICED_BT_MESH_CORE_TEST_MODE_SIGNAL_IV_UPDATE_END 1 |
the node shall transition to the Normal state, ignoring the 96 hour limit. More... | |
#define | WICED_BT_MESH_CORE_TEST_MODE_SIGNAL_TEST 2 |
test signal for internal use. More... | |
Provisioning Result codes | |
The following is the list of Provisioning Result codes that a provisioning layer can return in wiced_bt_mesh_provision_end_cb_t(). | |
#define | WICED_BT_MESH_PROVISION_RESULT_SUCCESS 0 |
Provisioning succeeded. | |
#define | WICED_BT_MESH_PROVISION_RESULT_TIMEOUT 1 |
Provisioning failed due to timeout. | |
#define | WICED_BT_MESH_PROVISION_RESULT_FAILED 2 |
Provisioning failed. | |
Output OOB Action field values | |
#define | WICED_BT_MESH_PROVISION_OUT_OOB_ACT_BLINK 0x00 |
Blink. | |
#define | WICED_BT_MESH_PROVISION_OUT_OOB_ACT_BEEP 0x01 |
Beep. | |
#define | WICED_BT_MESH_PROVISION_OUT_OOB_ACT_VIBRATE 0x02 |
Vibrate. | |
#define | WICED_BT_MESH_PROVISION_OUT_OOB_ACT_DISP_NUM 0x03 |
Output Numeric. | |
#define | WICED_BT_MESH_PROVISION_OUT_OOB_ACT_DISP_ALPH 0x04 |
Output Alphanumeric. | |
#define | WICED_BT_MESH_PROVISION_OUT_OOB_ACT_MAX 0x15 |
Max number of supported actions. | |
Input OOB Action field values | |
#define | WICED_BT_MESH_PROVISION_IN_OOB_ACT_PUSH 0x00 |
Push. | |
#define | WICED_BT_MESH_PROVISION_IN_OOB_ACT_TWIST 0x01 |
Twist. | |
#define | WICED_BT_MESH_PROVISION_IN_OOB_ACT_ENTER_NUM 0x02 |
Input Number. | |
#define | WICED_BT_MESH_PROVISION_IN_OOB_ACT_ENTER_STR 0x03 |
Input Alphanumeric. | |
#define | WICED_BT_MESH_PROVISION_IN_OOB_ACT_MAX 0x15 |
Max number of supported actions. | |
OOB callback definitions | |
Defines possible values for OOB callback wiced_bt_mesh_provision_get_oob_cb_t. | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_NONE 0 |
Provisioner: OOB not used. | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_ENTER_PUB_KEY 1 |
Provisioner: Enter public key() | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_ENTER_OUTPUT 2 |
Provisioner: Enter output OOB value(size, action) displayed on provisioning node. | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_ENTER_STATIC 3 |
Provisioner: Enter static OOB value(size) | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_ENTER_INPUT 4 |
Provisioning node: Enter input OOB value(size, action) displayed on provisioner. | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_DISPLAY_INPUT 5 |
Provisioner: Select and display input OOB value(size, action) | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_DISPLAY_OUTPUT 6 |
Provisioning node: Select and display output OOB value(size, action) | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_DISPLAY_STOP 7 |
Provisioner and Provisioning node: Stop displaying OOB value. | |
#define | WICED_BT_MESH_PROVISION_GET_OOB_TYPE_GET_STATIC 8 |
Provisioning node: Requests static OOB value(size) | |
Mesh Core library of the AIROC BTSDK provide a simple method for an application to integrate Bluetooth Mesh functionality.
Mesh Core library of the AIROC BTSDK provides access to the LE Mesh Core.
Typically application will not access LE Mesh Core directly but through the LE Mesh Models library functions.
#define WICED_BT_MESH_CORE_CMD_SPECIAL_DIRECTED_PROXY_CAPABILITIES_STATUS 0x04 |
Sent by a Directed Proxy Server to report the status of its capabilities for a subnet.
#define WICED_BT_MESH_CORE_CMD_SPECIAL_DIRECTED_PROXY_CONTROL 0x05 |
Sent by a Directed Proxy Client to set connection parameters of the Directed Proxy for a subnet.
#define WICED_BT_MESH_CORE_CMD_SPECIAL_HEARTBEAT 0x0a |
Heartbeat message came from Transport layer.
#define WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_ADD_ADDR 0x01 |
Sent by a Proxy Client to add addresses to the proxy filter list.
#define WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_DEL_ADDR 0x02 |
Sent by a Proxy Client to remove addresses from the proxy filter list.
#define WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_SET_TYPE 0x00 |
Opcodes of the Proxy Configuration Messages.
Sent by a Proxy Client to set the proxy filter type.
#define WICED_BT_MESH_CORE_CMD_SPECIAL_PROXY_FLT_STATUS 0x03 |
Acknowledgment by a Proxy Server to a Proxy Client to report the status of the proxy filter list.
#define WICED_BT_MESH_CORE_TEST_MODE_SIGNAL_IV_UPDATE_BEGIN 0 |
the node shall transition to the IV Update in Progress state, ignoring the 96 hour limit.
#define WICED_BT_MESH_CORE_TEST_MODE_SIGNAL_IV_UPDATE_END 1 |
the node shall transition to the Normal state, ignoring the 96 hour limit.
#define WICED_BT_MESH_CORE_TEST_MODE_SIGNAL_TEST 2 |
test signal for internal use.
typedef uint32_t(* wiced_bt_core_nvram_access_t)(wiced_bool_t write, int inx, uint8_t *node_info, uint16_t len, wiced_result_t *p_result) |
Application provided function to read/write information from/to NVRAM.
Application should provide the address of this callback function that the core library can execute to store or retrieve a memory chunk from the NVRAM.
[in] | write | WICED_TRUE - write; WICED_FALSE - read. |
[in] | inx | Index of the memory chunk to read/write |
[in,out] | node_info | Buffer to read/write from/to. |
[in] | len | The size of memory chunk to read/write. Write 0 means delete. |
[in] | p_result | Pointer to variable to receive the result of operation. |
typedef wiced_bool_t(* wiced_bt_mesh_core_adv_send_cb_t)(uint8_t instance, uint8_t transmissions, uint32_t interval, uint8_t type, uint8_t *own_bd_addr, const uint8_t *adv_data, uint8_t adv_data_len, const uint8_t *scan_rsp_data, uint8_t scan_rsp_data_len) |
Definition of the callback function to send advert messages or stop sending it or reset all adverts.
Application implements that function. 0 instance means reset all adverts - then all other params should be ignored. 0 transmissions means stop specific instance then all other params except instance should be ignored.
[in] | instance | Adv instance to send or stop. 0 instance means reset all adverts - then all other params should be ignored. |
[in] | transmissions | Number of transmissions. 0 means stop adv with that instance |
[in] | interval | Adv interval |
[in] | type | Adv type - see wiced_bt_ble_multi_advert_type_e in wiced_bt_ble.h [in] own_bd_addr Own LE address |
[in] | adv_data | Advertisement data to send |
[in] | adv_data_len | Length of the advertisement data to send |
[in] | scan_rsp_data | Scan response data to send |
[in] | scan_rsp_data_len | Length of the scan response data to send |
typedef void(* wiced_bt_mesh_core_attention_cb_t)(uint8_t element, uint8_t time) |
Definition of the callback function to attract human attention by LED blinks or other.
The application shall implement this function to support Health Server Model. The function is executed by the Mesh Core library to attract human attention.
[in] | element | Index of the element. |
[in] | time | 0 - Off; 0x01-0xff - On, remaining time in seconds. |
typedef { ... } wiced_bt_mesh_core_config_t |
To calculate max_lpn_num: #define MSG_OFFSET 20 // offset in friend structure defined internally in mesh core library is 20 bytes #define MSG_QUE_SIZE 33 // Each message in the queue takes 33 bytes #define FRIEND_LPN_STATE 140 // sizeof friend LPN structure defined internally in mesh core library is 140 bytes uint16_t max_lpn_msg_num; // number of messages user application needs in the queue uint64_t app_available_memory; // available user application memory.
max_lpn_num = (app_available_memory - MSG_OFFSET) / (FRIEND_LPN_STATE + max_lpn_msg_num* MSG_QUE_SIZE); For example, if max_lpn_msg_num = 4, and app_available_memory = 6K, then max_lpn_num = (6k - MSG_OFFSET) / (FRIEND_LPN_STATE + max_lpn_msg_num * MSG_QUE_SIZE) = 22 Defines mesh device configuration data
typedef const uint8_t*(* wiced_bt_mesh_core_get_dev_key_callback_t)(uint16_t addr, uint16_t *p_net_key_idx) |
Device Key request callback.
Client application implements that function to handle core requests for device key of the peer device. It is needed if app wants to send/receive configuration messages.
[in] | addr | Address of the node which device key is requested. |
[out] | p_net_key_idx | Network Key Index to use for message encryption. It can be NULL. Returned value 0xffff means use primary net key. |
typedef wiced_bt_mesh_core_received_msg_handler_t(* wiced_bt_mesh_core_get_msg_handler_callback_t)(uint16_t company_id, uint16_t opcode, uint16_t *p_model_id, uint8_t *p_rpl_flag) |
Get message handler callback.
The AIROC Mesh Application library implements that function to find and return the message handler corresponding to the opcode of received message. If opcode does not correspond to any supported model then the function returns NULL. Otherwise it returns the message handler.
The 0xffff value of the comany_id means special case when message came from Network or Transport layer (see Special Commands of the Proxy Filter, Heartbeat and other).
[in] | company_id | Opcode company ID |
[in] | opcode | Opcode |
[out] | p_model_id | Variable for found Model ID for that opcode |
[out] | p_rpl_flag | It can be any of RPL_STATUS_XXX defined in the wiced_bt_mesh_event.h. Model indicates how SEQ shall be saved by the core. |
typedef void(* wiced_bt_mesh_core_hal_aes_encrypt_t)(uint8_t *in_data, uint8_t *out_data, uint8_t *key) |
Calculate AES encryption by using Hardware acceleration.
[in] | in_data | : point to input data buffer |
in|out] | out_data : point to output data buffer | |
[in] | key | : point to key data buffer |
typedef void(* wiced_bt_mesh_core_hal_delete_nvram_t)(uint16_t vs_id, wiced_result_t *p_status) |
deletes data from NVRAM at specified VS id
[in] | vs_id | : Volatile Section Identifier. Application can use the VS ids from WICED_NVRAM_VSID_START to WICED_NVRAM_VSID_END |
[out] | p_status | : Pointer to location where status of the call is returned |
typedef uint32_t(* wiced_bt_mesh_core_hal_get_pseudo_rand_number_t)(void) |
This functin returns a pseudo random number.
typedef void(* wiced_bt_mesh_core_hal_rand_gen_num_array_t)(uint32_t *randNumberArrayPtr, uint32_t length) |
Fills a given array with randomly generated 32-bit integers.
[out] | randNumberArrayPtr | The pointer to an array to be populated with random numbers. |
[in] | length | The length of the array pointed to by randNumberArrayPtr. |
typedef uint32_t(* wiced_bt_mesh_core_hal_rand_gen_num_t)(void) |
Generates and returns a random 32-bit integer.
Internal functions check that the generating hardware is warmed up and ready before returning the random value. If the hardware is too "cold" at the time of use, the function will instead use the BT clock as a "seed" and generate a "soft" random number.
typedef uint16_t(* wiced_bt_mesh_core_hal_read_nvram_t)(uint16_t vs_id, uint16_t data_length, uint8_t *p_data, wiced_result_t *p_status) |
Reads the data from NVRAM.
[in] | vs_id | : Volatile Section Identifier. Application can use the VS ids from WICED_NVRAM_VSID_START to WICED_NVRAM_VSID_END |
[in] | data_length | : Length of the data to be read from NVRAM |
[out] | p_data | : Pointer to the buffer to which data will be copied |
[out] | p_status | : Pointer to location where status of the call is returned |
typedef uint16_t(* wiced_bt_mesh_core_hal_write_nvram_t)(uint16_t vs_id, uint16_t data_length, uint8_t *p_data, wiced_result_t *p_status) |
Writes the data to NVRAM, Application can write up to 255 bytes in one VS id section.
[in] | vs_id | : Volatile Section Identifier. Application can use the VS ids from WICED_NVRAM_VSID_START to WICED_NVRAM_VSID_END |
[in] | data_length | : Length of the data to be written to the NVRAM, |
[in] | p_data | : Pointer to the data to be written to the NVRAM |
[out] | p_status | : Pointer to location where status of the call is returned |
typedef uint8_t(* wiced_bt_mesh_core_health_fault_test_cb_t)(uint8_t element, uint8_t test_id, uint16_t company_id, uint8_t fault_array_size, uint8_t *fault_array) |
Definition of the callback function to send proxy packet.
The application shall implement this function to support Health Server Model. The function is called by the Mesh Core library to get Current Fault.
[in] | element | Index of the element |
[in] | test_id | Identifier of a specific test to be performed |
[in] | company_id | Company ID of the test |
[in] | fault_array_size | Size of the buffer fault_array |
[out] | fault_array | Buffer to receive FaultArray |
typedef void(* wiced_bt_mesh_core_lpn_sleep_callback_t)(uint32_t *p_sleep_time) |
Callback function to receive LPN sleep event.
BLOB transfer server implement this callback to send message before LPN goes to sleep.
[out] | p_sleep_time | Change LPN sleep time if necessary |
typedef void(* wiced_bt_mesh_core_provision_end_cb_t)(uint32_t conn_id, uint16_t addr, uint16_t net_key_idx, uint8_t result, const uint8_t *p_dev_key) |
Definition of the callback function on provisioning end.
Provisioner or/and provisioning application implements that function to be called on successfull or failed end of provisioning.
[in] | conn_id | Connection ID of the provisioning connection |
[in] | addr | Address assigned to the first element of the device |
[in] | net_key_idx | Net Key Index configured to the device |
[in] | result | Provisioning Result code (see Provisioning Result codes) |
[in] | p_dev_key | Pointer to the Device Key generated during provisioning. It is valid only if result is SUCCESS(0). On provisioner side that pointer becomes invalid after return. On provisioning node side it can be use at any time. |
typedef void(* wiced_bt_mesh_core_provision_gatt_send_cb_t)(uint16_t conn_id, const uint8_t *packet, uint32_t packet_len) |
Definition of the callback function to send provisioning packet.
Application implements that function if it want to use GATT notification or even external function (for example Windows provisioner). Called by provisioning layer to send packet to the provisioner or provisioning node.
[in] | conn_id | GATT connection ID |
[in] | packet | Packet to send |
[in] | packet_len | Length of the packet to send |
typedef wiced_bool_t(* wiced_bt_mesh_core_provision_get_capabilities_cb_t)(uint32_t conn_id) |
Definition of the callback function on get Capabilities.
Provisioning application implements that function to be called by provisioning layer to get capabilities of provisioning node from the app. App should call wiced_bt_mesh_core_provision_set_capabilities() to proceed
[in] | conn_id | Connection ID of the provisioning connection |
typedef wiced_bool_t(* wiced_bt_mesh_core_provision_get_oob_cb_t)(uint32_t conn_id, uint8_t type, uint8_t size, uint8_t action) |
Definition of the callback function on get OOB.
Provisioner application implements that function to be called on get OOB if it supposed to enter public key, output OOB, or static OOB or display input OOB. Provisioning application implements that function to be called on get OOB if it supposed to enter input OOB or display output OOB App should call wiced_bt_mesh_provision_set_oob() to proceed. Provisioner layer calls that function to request app to enter requested value and call pb_put_oob with entered value.
[in] | conn_id | Connection ID of the provisioning connection |
[in] | type | OOB type requested (see OOB callback definitions) |
[in] | size | Ignored for PUB_KEY, size for STATIC, INPUT and OUTPUT, ignored for DISPLAY_STOP (see spec for possible values) |
[in] | action | Ignored for PUB_KEY and STATIC, action for INPUT and OUTPUT, ignored for DISPLAY_STOP(see spec for possible values) |
typedef wiced_bool_t(* wiced_bt_mesh_core_provision_on_capabilities_cb_t)(uint32_t conn_id, const wiced_bt_mesh_core_provision_capabilities_t *capabilities) |
Definition of the callback function on Capabilities.
Provisioner application implements that function to be called on receiving the capabilities of provisioning node. App should call wiced_bt_mesh_provision_set_mode() to proceed.
[in] | conn_id | Connection ID of the provisioning connection |
[in] | capabilities | Capabilities received from provisioning node |
typedef uint16_t(* wiced_bt_mesh_core_provision_record_req_cb_t)(uint16_t record_id, uint8_t *buffer, uint16_t fragment_length, uint16_t fragment_offset, uint16_t *record_size) |
Definition of the callback function on get fragment of the provisioning record.
[in] | item_type | - record designated tag |
[out] | buffer | - pointer to the memory buffer to store the record |
[in] | fragment_length | - number of bytes to read |
[in] | fragment_offset | - start offset to read the record |
[out] | record_size | - pointer to the output parameter to store total record size |
typedef uint16_t(* wiced_bt_mesh_core_provision_records_get_cb_t)(uint16_t *buffer) |
Definition of the callback function on get provisioning records list.
[in] | buffer | Pointer to save list of provisioning records IDs |
typedef void(* wiced_bt_mesh_core_provision_started_cb_t)(uint32_t conn_id) |
Definition of the callback function on Starts provisioning.
Provisioner or/and provisioning application implements that function to be called on successful start of provisioning.
[in] | conn_id | Connection ID of the provisioning connection |
typedef { ... } wiced_bt_mesh_core_provisioning_record_request_t |
Provisioning Record Request PDU parameters format.
typedef { ... } wiced_bt_mesh_core_provisioning_record_t |
Provisioning Record Response PDU parameters format.
typedef void(* wiced_bt_mesh_core_proxy_send_cb_t)(uint32_t conn_id, uint32_t ref_data, const uint8_t *packet, uint32_t packet_len) |
Definition of the callback function to send proxy messages.
Application implements that function if it want to use GATT notification, GATT write command or any other type of a proxy connection.
[in] | conn_id | Connection ID |
[in] | ref_data | The reference data that was passed to the core when connection was established |
[in] | packet | Packet to send |
[in] | packet_len | Length of the packet to send |
typedef wiced_bool_t(* wiced_bt_mesh_core_publication_callback_t)(uint8_t elem_idx, uint16_t company_id, uint16_t model_id, uint16_t period) |
Publication request callback.
The AIROC Mesh Application library implements that function to be notified when periodic publication configuration has changed or when a model need to publish its status. If period is set to 0, the publication needs to stop. Period between 1 and 0xFFFE indicates that Periodic Publication for the specified model is being changed. Value 0xFFFF indicates that the value needs to be published now.
[in] | elem_idx | Element index |
[in] | company_id | Company ID |
[in] | model_id | Model ID |
[in] | period | New value of the publication period in 100 ms units or indication that model has to publish status now. |
typedef wiced_bool_t(* wiced_bt_mesh_core_received_msg_handler_t)(wiced_bt_mesh_event_t *p_event, const uint8_t *params, uint16_t params_len) |
Received message callback.
Each model implements that function to handle received messages.
[in] | p_event | Parameters related to received message. It should be released by call to wiced_bt_mesh_release_event() or it can be used to send reply by call to wiced_bt_mesh_core_send() |
[in] | params | Application Parameters - extracted from the Access Payload |
[in] | params_len | Length of the Application Parameters |
typedef void(* wiced_bt_mesh_core_scan_callback_t)(wiced_bool_t start, wiced_bool_t is_scan_type_active) |
Start/Stop scan callback.
Application implements that function if it can provide service to start/stop scan.
[in] | start | Call will set this to WICED_TRUE to start the scan, WICED_FALSE to stop the scan |
[in] | is_scan_type_active | WICED_TRUE - Active Scan; WICED_FALSE - Passive Scan. |
typedef void(* wiced_bt_mesh_core_send_complete_callback_t)(wiced_bt_mesh_event_t *p_event) |
Send message complete callback.
While sending message to the core for transmission over the mesh, the application may provide this function to be notified when the operation has been completed. The Mesh Core library passes the pointer to the same event which was included in the send call. When callback is executed the application should take the ownership of the mesh event and shell release or reuse it.
[in] | p_event | Mesh event passed to wiced_bt_mesh_core_send() |
wiced_bt_mesh_event_t* wiced_bt_mesh_copy_event | ( | wiced_bt_mesh_event_t * | p_event | ) |
Create the copy of the existing mesh event.
This function creates new mesh event with same content as input mesh event.
p_event | mesh event to copy. |
void wiced_bt_mesh_core_adv_end | ( | uint8_t | instance | ) |
Advertisement stopped notification.
Application calls it when requested number of transmissions of the advertisement has been sent and it stopped.
[in] | instance | Instance of the stopped advertisement |
wiced_result_t wiced_bt_mesh_core_adv_packet | ( | int8_t | rssi, |
const uint8_t * | p_adv_data, | ||
const uint8_t * | remote_bd_addr | ||
) |
Handles received advertising packet.
The Mesh Application library calls this function for each received advertisement packet.
[in] | rssi | RSSI of the received packet |
[in] | p_adv_data | Advertisement packet data |
[in] | remote_bd_addr | BD address of the node that advertisement packet data came from |
void wiced_bt_mesh_core_cancel_send | ( | wiced_bt_mesh_event_t * | p_event | ) |
Stop sending retransmissions.
Mesh Core library when sending mesh packets over the advertising channel typically retransmits every packet several times to improve reliability of the delivery. When it is a client request (for example a Get or a Set message), the peer may receive the earlier transmission and reply to it. When a Model library receives the reply, and detects that there is no need to retransmit the packet, it can call the wiced_bt_mesh_core_cancel_send function to cancel the retransmission of the packet.
[in] | p_event | Mesh event used to send message by wiced_bt_mesh_core_send() for which retransitions should be stoped. |
wiced_bool_t wiced_bt_mesh_core_check_node_identity | ( | uint16_t | addr, |
const uint8_t * | data, | ||
uint8_t | len, | ||
uint16_t * | p_net_key_idx | ||
) |
Checks if received Service Data for Mesh Proxy Service with Node Identity corresponds to that node address.
Application should call that function on each received advertizing with proxy service data for Mesh Proxy Service with Node Identity to check if it is came from specific node address. Example: if (NULL != (p_data = wiced_bt_ble_check_advertising_data(received_adv_data, 0x16, &len))) wiced_bt_mesh_core_check_node_identity(address, p_data, len, NULL);
[in] | addr | Node address to check Identity for |
[in] | p_data | Received service data returned by wiced_bt_ble_check_advertising_data() |
[in] | len | Length of the received service data. |
[out] | net_key_idx | Optional (can be NULL) pointer to variable to receive matched global network index - it is valid on success only. |
wiced_bool_t wiced_bt_mesh_core_check_private_network_id | ( | const uint8_t * | data, |
uint8_t | len, | ||
uint16_t * | p_net_key_idx | ||
) |
Checks if received Service Data for Mesh Proxy Service with Private Network Identity is valid.
Application should call that function on each received advertizing with proxy service data for Mesh Proxy Service with Private Network Identity to check if it is for a valid network.
[in] | p_data | :Received service data returned by wiced_bt_ble_check_advertising_data() |
[in] | len | :Length of the received service data. |
[out] | net_key_idx | :Pointer to variable to receive matched global network index - it is valid on success only. |
wiced_bool_t wiced_bt_mesh_core_check_private_node_identity | ( | uint16_t | addr, |
const uint8_t * | data, | ||
uint8_t | len, | ||
uint16_t * | p_net_key_idx | ||
) |
Checks if received Service Data for Mesh Proxy Service with Private Node Identity corresponds to that node address.
Application should call that function on each received advertizing with proxy service data for Mesh Proxy Service with Private Node Identity to check if it is came from specific node address.
[in] | addr | :Node address to check Identity for |
[in] | p_data | :Received service data returned by wiced_bt_ble_check_advertising_data() |
[in] | len | :Length of the received service data. |
[out] | net_key_idx | :Optional (can be NULL) pointer to variable to receive matched global network index - it is valid on success only. |
void wiced_bt_mesh_core_connection_status | ( | uint32_t | conn_id, |
wiced_bool_t | connected_to_proxy, | ||
uint32_t | ref_data, | ||
uint16_t | mtu | ||
) |
Handles connection up and down events.
Application should call that function on each connection up and down state. Only one connection is alowed.
[in] | conn_id | Connection ID if connected. 0 if disconnected |
[in] | connected_to_proxy | If TRUE, core will send all the messages to this connection. Otherwise core will send packet to all bearers. |
[in] | ref_data | Core passes this parameter back to the application when packet needs to be sent out. On disconnection (if conn_id == 0) this parameter contains disconnection reason wiced_bt_gatt_disconn_reason_t |
[in] | mtu | When sending a message, core should fragment the packet to fit into the mtu. |
uint16_t wiced_bt_mesh_core_crypt | ( | wiced_bool_t | encrypt, |
const uint8_t * | p_in_data, | ||
uint16_t | in_data_len, | ||
uint8_t * | p_out_buf, | ||
uint16_t | out_buf_len | ||
) |
Encrypt or decrypts and authenticates data.
[in] | encrypt | TRUE - encrypt, FALSE - decrypt |
[in] | p_in_data | Input data |
[in] | in_data_len | Length of the input data |
[out] | p_out_buf | Buffer for output data. It can be same as p_in_data |
[in] | out_buf_len | Length of the buffer for output data |
wiced_bool_t wiced_bt_mesh_core_deinit | ( | wiced_bt_core_nvram_access_t | nvram_access_callback | ) |
Mesh Core de-initialization.
The wiced_bt_mesh_core_deinit function can be called to reset device to unprovisioned state. The function deletes main nvram item and restarts device.
[in] | nvram_access_callback | Callback function to read/write from/to NVRAM |
wiced_bool_t wiced_bt_mesh_core_del_last_element | ( | void | ) |
Deletes last element from NVRAM config.
Application should call this function in the PTS mode to pass PTS test Node Composition Refresh Procedure MESH/SR/RPR/PDU/BV-04-C
None |
wiced_bool_t wiced_bt_mesh_core_del_seq | ( | uint16_t | addr | ) |
Removes node from RPL(Replay Protection List).
[in] | addr | Unicast device address to remove RPL record. |
const uint8_t* wiced_bt_mesh_core_get_app_key | ( | uint16_t | appkey_global_idx, |
wiced_bool_t | newKeyAtKeyRefresh | ||
) |
Returns pointer to the specific application key.
Application may call this function to get application key by its global index. During Key Refresh procedure there are can be two application keys with same global index: old and new. Second parameter specifies which one to get.
[in] | appkey_global_idx | Global Index og the application get to get. |
[in] | newKeyAtKeyRefresh | WICED_TRUE means the request for the updating value of the application key during Key Refresh procedure. It doesn't exist if Key Refresh procedure isn't in the progress. WICED_FALSE means the request for main application key. |
wiced_bt_mesh_core_hal_api_t* wiced_bt_mesh_core_get_hal_api | ( | void | ) |
Returns hal api.
uint16_t wiced_bt_mesh_core_get_local_addr | ( | void | ) |
Gets local mesh address set by provisioner.
wiced_bool_t wiced_bt_mesh_core_get_network_id | ( | uint16_t | net_key_idx, |
uint8_t * | network_id | ||
) |
Fills buffer net_id with 8 bytes Network ID for net_key_idx.
[in] | net_key_idx | Network Key Index to get Network ID for. |
[out] | network_id | Buffer 8 bytes length for Network ID |
wiced_bool_t wiced_bt_mesh_core_health_set_faults | ( | uint8_t | element_idx, |
uint8_t | test_id, | ||
uint16_t | company_id, | ||
uint8_t | faults_number, | ||
uint8_t * | fault_array | ||
) |
Indicates the fault happened.
Application shall call that function to indicate the fault
[in] | element_idx | Index of the elemnt |
[in] | test_id | Identifier of a specific test to be performed |
[in] | company_id | Company ID of the test |
[in] | faults_number | Number of faults in FaultArray |
[out] | fault_array | FaultArray |
wiced_result_t wiced_bt_mesh_core_init | ( | wiced_bt_mesh_core_init_t * | p_init | ) |
Mesh Core initialization.
The wiced_bt_mesh_core_init function should be called at device startup before calling wiced_bt_mesh_core_register() for each supported model. The function should be called just once with non-NULL p_init and non-NULL p_init->p_config_data at the startup time before calling mesh_app_init. Call this function with NULL p_init or with NULL p_init->p_config_data to reset device into unprovisioned state. In that mode if p_init isn't NULL then following members should contain new values: device_uuid, non_provisioned_bda and provisioned_bda.
[in] | p_init | Initialization parameters |
wiced_bool_t wiced_bt_mesh_core_is_valid_network_id | ( | uint8_t * | p_network_id, |
uint16_t * | p_net_key_idx | ||
) |
Get Network Key Index.
Application can call this function to verify that Network ID is provisioned on the device.
[in] | p_network_id | :Network ID in question |
[out] | p_net_key_idx | :Valid Natwork Key Index |
uint16_t wiced_bt_mesh_core_lpn_get_friend_addr | ( | void | ) |
Gets friend address of the LPN.
None |
void wiced_bt_mesh_core_lpn_restore_poll_timeout | ( | uint32_t | timeout | ) |
Restore original poll timeout.
[in] | timeout | Original poll timeout value (in 100ms). |
uint32_t wiced_bt_mesh_core_lpn_set_poll_timeout | ( | uint32_t | timeout | ) |
Set a smaller poll timeout.
This is called by a task that requires more frequent data exchange (such as DFU).
[in] | timeout | New poll timeout value (in 100ms). |
void wiced_bt_mesh_core_lpn_set_sleep_callback | ( | wiced_bt_mesh_core_lpn_sleep_callback_t | callback | ) |
Set callback function to receive LPN sleep event.
[in] | callback | Callback function. It can be NULL to disable callback. |
wiced_bool_t wiced_bt_mesh_core_needs_composition_refresh | ( | void | ) |
Detects if Node Composition Refresh Procedure is needed.
RPR Model may call this function to decide if Link Open allowed for Node Composition Refresh Procedure.
None |
wiced_bool_t wiced_bt_mesh_core_proc_rx_cmd | ( | uint16_t | opcode, |
const uint8_t * | p_data, | ||
uint16_t | data_len | ||
) |
The RPL updates from the Host.
Application shall call this function to pass RPL updates when RPL persistant storage is on another MCU
[in] | opcode | : opcode (see HCI_CONTROL_MESH_COMMAND_CORE_XXX in hci_control_api.h) |
[in] | p_data | : data |
[in] | data_len | : length of the data |
void wiced_bt_mesh_core_provision_gatt_packet | ( | uint8_t | is_notification, |
uint32_t | conn_id, | ||
const uint8_t * | packet, | ||
uint8_t | packet_len | ||
) |
Processes received PB_GATT packets.
[in] | is_notification | If TRUE processing GATT Notification, otherwise GATT Write Cmd. |
[in] | conn_id | Connection ID. It is needed in case of few simultaneous provisioning via GATT. |
[in] | packet | Packet to process. |
[in] | packet_len | Length of the packet to process |
wiced_bool_t wiced_bt_mesh_core_provision_local | ( | uint16_t | addr, |
uint8_t * | dev_key, | ||
uint8_t * | network_key, | ||
uint16_t | net_key_idx, | ||
uint32_t | iv_idx, | ||
uint8_t | key_refresh, | ||
uint8_t | iv_update | ||
) |
Provision Local Device.
Called by provisioning and provisioner app to initialize the device.
[in] | addr | Address of the first element of the device |
[in] | dev_key | Local Device Key. If we are a provisioner, this key can be used to configure this device. |
[in] | net_key | Network Key |
[in] | net_key_idx | Network Key Index |
[in] | iv_idx | Current IV index |
[in] | key_refresh | Key refresh phase 2 is in progress |
[in] | iv_update | iv_update is in progress |
wiced_bool_t wiced_bt_mesh_core_provision_server_init | ( | uint8_t * | priv_key, |
wiced_bt_mesh_core_provision_started_cb_t | started_cb, | ||
wiced_bt_mesh_core_provision_end_cb_t | end_cb, | ||
wiced_bt_mesh_core_provision_get_capabilities_cb_t | get_capabilities_cb, | ||
wiced_bt_mesh_core_provision_get_oob_cb_t | get_oob_cb, | ||
wiced_bt_mesh_core_provision_gatt_send_cb_t | gatt_send_cb, | ||
wiced_bt_mesh_core_provision_records_get_cb_t | get_precords_cb, | ||
wiced_bt_mesh_core_provision_record_req_cb_t | request_precord_cb | ||
) |
Initializes provisioning layer for the node(server side).
Called by provisioning app to initialize provisioning layer for both PB_ADV and PB_GATT.
[in] | priv_key | Private key(32 bytes) to use for ECDH authentication. It should be same if both client and server are initialized |
[in] | started_cb | Callback function to be called on provisioning start. |
[in] | end_cb | Callback function to be called on provisioning end, or error. |
[in] | get_capabilities_cb | Callback function to be called on Capabilities get |
[in] | get_oob_cb | Callback function to be called on OOB get |
[in] | gatt_send_cb | Callback function to send provisioning packet over GATT |
[in] | get_precords_cb | Callback function to get list of provisioning records |
[in] | request_precord_cb | Callback function to request fragment of the provisioning record |
wiced_bool_t wiced_bt_mesh_core_provision_set_capabilities | ( | uint32_t | conn_id, |
const wiced_bt_mesh_core_provision_capabilities_t * | capabilities | ||
) |
Sets Capabilities of the provisioning device.
Called by provisioning app set capabilities of provisioning node.
[in] | conn_id | Connection ID of the provisioning connection |
[in] | capabilities | Capabilities of the provisioning node |
wiced_bool_t wiced_bt_mesh_core_provision_set_oob | ( | uint8_t * | value, |
uint8_t | value_len | ||
) |
Sets OOB in response on wiced_bt_mesh_provision_get_oob_cb.
Called by provisioner and provisioning application as a responce on wiced_bt_mesh_provision_get_oob_cb.
[in] | value | Requested OOB value |
[in] | value_len | Length of the requested OOB value |
void wiced_bt_mesh_core_proxy_packet | ( | const uint8_t * | p_data, |
uint8_t | data_len | ||
) |
Handle packet received by proxy via GATT.
Application should call that function on each received packet from the GATT data in characteristic of the proxy service.
[in] | p_data | Received packet |
[in] | data_len | Length of the received packet. |
void wiced_bt_mesh_core_reset | ( | void | ) |
Resets node to unprovisioned state without restarting.
It is quick synchronous function. Node is in the unprovisioned state on return from the function.
None |
wiced_result_t wiced_bt_mesh_core_send | ( | wiced_bt_mesh_event_t * | p_event, |
const uint8_t * | params, | ||
uint16_t | params_len, | ||
wiced_bt_mesh_core_send_complete_callback_t | complete_callback | ||
) |
Sends the message to the dst address.
This function encrypts and authenticates the application payload and then passes it to transport layer and then to the network layer for sending out. If the function is used for sending the response to the received message then it should use app_key_idx and SRC of the received message and default TTL. If the function is used for sending unsolicited message and application does not know the destination address, the publication information for the models should be used.
If the complete_callback is set to NULL the Core library will release the mesh event when it is done processing of the event. Otherwise the Core library will call complete_callback at the end of retransmission. At that time the caller takes ownership of the mesh event and shall reuse it or release.
[in] | p_event | All details of the message to be sent |
[in] | params | Parameters of the Access Payload |
[in] | params_len | Length of the Parameters of the Access Payload |
[in] | complete_callback | Callback function to be called at the end of all retransmissions. Can be NULL. |
void wiced_bt_mesh_core_set_beacon | ( | uint8_t | type, |
uint8_t | onoff | ||
) |
Sets beacon state as a result of user interaction.
[in] | type | 0: Beacon, 1: Private Beacon |
[in] | onoff | 0: OFF, 1: ON |
void wiced_bt_mesh_core_set_dev_key_callback | ( | wiced_bt_mesh_core_get_dev_key_callback_t | callback | ) |
Sets Device Key request callback.
Client application implements callback function and sets it to the core for requests for device key of the peer device. It is needed if app wants to send/receive configuration messages.
[in] | callback | Callback function. It can be NULL to disable callback. |
void wiced_bt_mesh_core_set_gatt_mtu | ( | uint16_t | gatt_mtu | ) |
Sets GATT MTU for the provisioning or proxy connection.
Called by the app to set max sending packet length in the core and provisioning layer.
[in] | gatt_mtu | Maximum size of the packet to be used over GATT. 0 means default value (20). |
void wiced_bt_mesh_core_set_hal_api | ( | wiced_bt_mesh_core_hal_api_t * | hal_api | ) |
Sets hal api.
Application has to implement all these functions and call wiced_bt_mesh_core_set_hal_api() at the startup.
[in] | pointer | to hal api |
void wiced_bt_mesh_core_set_max_num_adv_instances | ( | uint8_t | max_num | ) |
Set max number of advertisement instances.
Application calls it before first advertisement start. It can be called after first advertisement start because that number is always >= 1.
[in] | max_num | Mmax number of advertisement instances |
void wiced_bt_mesh_core_set_node_identity | ( | uint8_t | type, |
uint8_t | action | ||
) |
Sets node identity state as a result of user interaction.
[in] | type | 0: network identity, 1: node identity, 2: private network identity, 3: private node identity |
[in] | action | 1: ON, 0: OFF |
wiced_bool_t wiced_bt_mesh_core_set_seq | ( | uint16_t | addr, |
uint32_t | seq, | ||
wiced_bool_t | prev_iv_idx | ||
) |
Set Sequence Number (SEQ) own or for RPL(Replay Protection List).
[in] | addr | Unicast device address. 0 means own address. |
[in] | seq | Sequence Number (SEQ). It should be <= 0x00ffffff (3 bytes length). |
[in] | prev_iv_idx | FALSE - it is SEQ for current IV INDEX. TRUE - for previous. If addr is 0 then it is ignored. |
void wiced_bt_mesh_core_set_test_events_report | ( | uint16_t | node_addr | ) |
Set test events report node address.
node_addr | Address of the node being monitored, set to 0 to disable report |
void wiced_bt_mesh_core_set_trace_level | ( | uint32_t | fids_mask, |
uint8_t | level | ||
) |
Sets trace level for modules of mesh_core_lib.
Application may call this function to set trace level for modules of mesh_core_lib. By default trace level for all modules is 0(no trace). This function can be called few times to set different trace levels for different modules.
[in] | fids_mask | Mask of modules of the mesh_core_lib to set trace level. It can be any combination of bits WICED_BT_MESH_CORE_TRACE_FID_XXX. |
[in] | level | Trace level to set for modules of the mesh_core_lib. It can be any of WICED_BT_MESH_CORE_TRACE_XXX. |
void wiced_bt_mesh_core_shutdown | ( | void | ) |
Stops all advertisements and timers.
None |
void wiced_bt_mesh_core_start | ( | void | ) |
Mesh Core Start.
The wiced_bt_mesh_core_start function should be called at device startup after calling wiced_bt_mesh_core_init(). The function starts beacons and service advertisements. It is usually called by application from mesh_app_init().
void wiced_bt_mesh_core_statistics_get | ( | wiced_bt_mesh_core_statistics_t * | p_data | ) |
Requests collected statistics for network layer.
[out] | p_data | pointer where to copy network layer statistics |
void wiced_bt_mesh_core_statistics_reset | ( | void | ) |
Resets statistics of the network layer.
None |
void wiced_bt_mesh_core_stop_advert | ( | void | ) |
Stops proxy server advertisement and network secure beacon if they are running.
None |
wiced_bool_t wiced_bt_mesh_core_test_mode_signal | ( | uint16_t | opcode, |
const uint8_t * | p_data, | ||
uint16_t | data_len | ||
) |
The signals for different test modes.
Application shall support some test modes (for example IV update) used for certification and compliance testing. The activation of the test mode shall be carried out locally (via a HW or SW interface).
[in] | opcode | opcode (see HCI_CONTROL_MESH_COMMAND_CORE_XXX in hci_control_api.h) |
[in] | p_data | data |
[in] | data_len | length of the data |
void wiced_bt_mesh_core_transport_statistics_get | ( | wiced_bt_mesh_core_transport_statistics_t * | p_data | ) |
Requests collected statistics for transport layer.
[out] | p_data | pointer where to copy transport layer statistics |
void wiced_bt_mesh_core_transport_statistics_reset | ( | void | ) |
Resets statistics of the transport layers.
None |
wiced_bt_mesh_event_t* wiced_bt_mesh_create_event | ( | uint8_t | element_index, |
uint16_t | company_id, | ||
uint16_t | model_id, | ||
uint16_t | dst, | ||
uint16_t | app_key_idx | ||
) |
Create mesh event for an unsolicited message.
In case dst is 0 the function takes all information from the model's publication or fails if publication is not configured for the specified model. In case non-0 dst the function uses specified dst and app_key_idx and fills all other fields with default values. In special case with company_id equals to 0xffff the function creates a message event with default ttl.
element_index | Element index. |
company_id | Company ID. |
model_id | Model ID. |
dst | Destination address. If parameter is 0, the function finds publication and take uses its fields for the mesh event. |
app_key_idx | Application key index used to decrypt when message was received or which should be used to encrypt to send the message. Or it can be net key index - see Bits of the wiced_bt_mesh_event_t::app_key_idx) |
wiced_bt_mesh_event_t* wiced_bt_mesh_create_reply_event | ( | wiced_bt_mesh_event_t * | p_event | ) |
Create message reply mesh event from the received mesh event.
This function doesn't create but just updates received mesh event to be used to send message back to the originator. After application or a models library calls Mesh Models Library or Mesh Core library passing the pointer to the mesh event, it loses the ownership of the event and should not use it again.
p_event | information about the message received. |
uint16_t wiced_bt_mesh_get_node_config_size | ( | wiced_bt_mesh_core_config_t * | config | ) |
Calculates size of the memory for configuration.
[in] | config | Configuration data. |
void wiced_bt_mesh_release_event | ( | wiced_bt_mesh_event_t * | p_event | ) |
Release mesh event.
The application should call this function when it receives the mesh event in the callback and the reply value is set to 0.
p_event | information for the message. |
wiced_bool_t wiced_bt_mesh_set_raw_scan_response_data | ( | uint8_t | num_elem, |
wiced_bt_ble_advert_elem_t * | p_data | ||
) |
Set scan response raw data.
[in] | num_elem | number of scan response data element |
[in] | p_data | scan response raw data |
wiced_bool_t wiced_bt_core_iv_update_test_mode |
WICED_TRUE value activates IV Update test mode - only removes the 96-hour limit; all other behavior of the device is unchanged.
HCI_CONTROL_MESH_COMMAND_CORE_SET_IV_UPDATE_TEST_MODE sets it to TRUE Default value is WICED_FALSE.
uint16_t wiced_bt_core_lower_transport_ack_timeout_ms |
Lower Transport Layer ACK timeout.
Default value is 250 Per spec ACK_TIMEOUT should be >= 150 + 50 * TTL. But we use hardcoded value to get rid of long ACK_TIMOUT for big TTL.
wiced_bool_t wiced_bt_core_short_trans_mic |
If the value of that variable is WICED_TRUE then the transport layer always use 32-bit TransMIC.
Otherwise the transport layer uses 64-bit TransMIC for segmented access messages if it fits into max transport PDU.
uint16_t wiced_bt_mesh_core_delay_answer_group_min |
Minimum and maximum delay in milliseconds of the answer on the message with group DST.
Default values: 20, 500
uint16_t wiced_bt_mesh_core_delay_answer_unicast_min |
Minimum and maximum delay in milliseconds of the answer on the message with unicast DST.
Default values: 20, 50
uint16_t wiced_bt_mesh_core_delay_relay_min |
Minimum and maximum delay in milliseconds of the message being relayed.
Default values: 0, 10
uint16_t wiced_bt_mesh_core_provisioning_srv_adv_interval |
Advertising interval in MS of the provisioning service in units 0.5 sec.
Default value: 800 (0.5 sec)
uint16_t wiced_bt_mesh_core_provisioning_url_adv_interval |
Advertising interval in MS of the provisioning URL in units 0.5 sec.
Default value: 8000 (5 sec)
uint16_t wiced_bt_mesh_core_proxy_adv_interval |
Proxy service adv interval: * 0.625 ms.
Default value is 800 - 500 ms
uint16_t wiced_bt_mesh_core_unprovisioned_beacon_interval |
Advertising interval of the unprovisioned beacon in units 0.5 sec.
Default value: 8000 (5 sec)