BT Mesh Provisioner Component#

BT Mesh Provisioner component provides functionality for provisioning devices into a Bluetooth Mesh network.

Functions#

void
btmesh_prov_on_event(sl_btmesh_msg_t *evt)
sl_status_t
sl_status_t
btmesh_prov_setup_provisioning(uint16_t netkey_index, uuid_128 uuid, uint8_t bearer_type, uint8_t attention_timer_sec)
sl_status_t
btmesh_prov_provision_adv_device(uint16_t netkey_index, uuid_128 uuid, bd_addr mac_address, uint8_t bearer_type, uint8_t attention_timer_sec)
sl_status_t
btmesh_prov_get_unprov_uuid_by_id(uint16_t id, uuid_128 *uuid)
sl_status_t
btmesh_prov_get_prov_uuid_by_id(uint16_t id, uuid_128 *uuid)
sl_status_t
btmesh_prov_get_prov_uuid_by_address(uint16_t primary_address, uuid_128 *uuid)
sl_status_t
btmesh_prov_remove_node_by_uuid(uuid_128 uuid, btmesh_conf_on_job_notification_t on_job_notification)
sl_status_t
sl_status_t
sl_status_t
btmesh_prov_create_appkey(uint16_t netkey_index, uint16_t appkey_index, size_t key_len, const uint8_t *key, size_t max_application_key_size, size_t *application_key_len, uint8_t *application_key)
sl_status_t
btmesh_prov_create_network(uint16_t netkey_index, size_t key_len, const uint8_t *key)
void
btmesh_prov_on_device_provisioned_evt(uint16_t address, uuid_128 uuid)
void
btmesh_prov_on_provision_failed_evt(uint8_t reason, uuid_128 uuid)
void
btmesh_prov_on_unprovisioned_node_list_evt(uint16_t id, uuid_128 uuid, uint16_t oob_capabilities)
void
btmesh_prov_on_provisioned_node_list_evt(uint16_t id, uuid_128 uuid, uint16_t primary_address)
void
sl_status_t
btmesh_prov_setup_cbp(uuid_128 uuid)
void
btmesh_cbp_on_event(sl_btmesh_msg_t *evt)

Macros#

#define
BTMESH_OOB_FLAG_CBP_CAPABLE 0x180

Function Documentation#

btmesh_prov_on_event#

void btmesh_prov_on_event (sl_btmesh_msg_t * evt)
Parameters
TypeDirectionArgument NameDescription
sl_btmesh_msg_t *[in]evt

Received BT Mesh event

Provisioner Process Action.


btmesh_prov_start_scanning#

sl_status_t btmesh_prov_start_scanning (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Start scanning for unprovisioned beaconing nodes

Returns

  • Status of the scan.

Return values

  • SL_STATUS_OK: if scan started successfully. Error value otherwise.


btmesh_prov_stop_scanning#

sl_status_t btmesh_prov_stop_scanning (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Stop scanning of unprovisioned beaconing nodes

Returns

  • Status of the scan.

Return values

  • SL_STATUS_OK: if scan stopped successfully. Error value otherwise.


btmesh_prov_setup_provisioning#

sl_status_t btmesh_prov_setup_provisioning (uint16_t netkey_index, uuid_128 uuid, uint8_t bearer_type, uint8_t attention_timer_sec)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]netkey_index

Netkey index of the network

uuid_128[in]uuid

UUID of the node

uint8_t[in]bearer_type

Provisioning bearer type. Either PB-ADV or PB-GATT

uint8_t[in]attention_timer_sec

Attention timer value in seconds

Setup provisioning

Returns

  • Status of the provisioning.

Return values

  • SL_STATUS_OK: If provisioning is set up successfully. Error code otherwise.


btmesh_prov_provision_adv_device#

sl_status_t btmesh_prov_provision_adv_device (uint16_t netkey_index, uuid_128 uuid, bd_addr mac_address, uint8_t bearer_type, uint8_t attention_timer_sec)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]netkey_index

Netkey index of the network

uuid_128[in]uuid

UUID of the node

bd_addr[in]mac_address

Bluetooth address of the node

uint8_t[in]bearer_type

Provisioning bearer type. Either PB-ADV or PB-GATT

uint8_t[in]attention_timer_sec

Attention timer value in seconds

Provision device into network

Returns

  • Status of the provisioning.

Return values

  • SL_STATUS_OK: If provisioning is


btmesh_prov_get_unprov_uuid_by_id#

sl_status_t btmesh_prov_get_unprov_uuid_by_id (uint16_t id, uuid_128 * uuid)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]id

ID for which the UUID was requested

uuid_128 *[out]uuid

UUID of the node

Get UUID based on the ID of an unprovisioned node

Returns

  • Status of the provisioning.

Return values

  • SL_STATUS_OK: If the ID is valid and the related UUID was copied to the output parameter Error code otherwise.


btmesh_prov_get_prov_uuid_by_id#

sl_status_t btmesh_prov_get_prov_uuid_by_id (uint16_t id, uuid_128 * uuid)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]id

ID for which the UUID was requested

uuid_128 *[out]uuid

UUID of the node

Get UUID based on the ID of a provisioned node

Returns

  • Status of the provisioning.

Return values

  • SL_STATUS_OK: If the ID is valid and the related UUID was copied to the output parameter Error code otherwise.


btmesh_prov_get_prov_uuid_by_address#

sl_status_t btmesh_prov_get_prov_uuid_by_address (uint16_t primary_address, uuid_128 * uuid)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]primary_address

primary address for which UUID was requested

uuid_128 *[out]uuid

UUID of the node

Get UUID based on the primary address of a node

Returns

  • Status of the provisioning.

Return values

  • SL_STATUS_OK: If the address is valid and the related UUID was copied to the output parameter Error code otherwise.


btmesh_prov_remove_node_by_uuid#

sl_status_t btmesh_prov_remove_node_by_uuid (uuid_128 uuid, btmesh_conf_on_job_notification_t on_job_notification)
Parameters
TypeDirectionArgument NameDescription
uuid_128[in]uuid

UUID of the node

btmesh_conf_on_job_notification_t[in]on_job_notification

Job status notification callback

Remove a node from a network by UUID

Returns

  • Status of the node removal.

Return values

  • SL_STATUS_OK: if node removal

Node removal success or failure is reported in on_job_notification callback.


btmesh_prov_list_unprovisioned_nodes#

sl_status_t btmesh_prov_list_unprovisioned_nodes (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

List all unprovisioned nodes found in a previous scan

Returns

  • Status of the command.

Return values

  • SL_STATUS_OK: If all known nodes are listed.

  • SL_STATUS_EMPTY: If no unprovisioned nodes are known.


btmesh_prov_list_provisioned_nodes#

sl_status_t btmesh_prov_list_provisioned_nodes (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

List all provisioned nodes present

Returns

  • Status of the command.

Return values

  • SL_STATUS_OK: If all known nodes are listed.

  • SL_STATUS_EMPTY: If no provisioned nodes are known.


btmesh_prov_list_ddb_entries#

sl_status_t btmesh_prov_list_ddb_entries (uint16_t * count)
Parameters
TypeDirectionArgument NameDescription
uint16_t *[out]count

Number of nodes in the DDB

List all entries in the device database of the provisioner node

Returns

  • Status of the list command.

Return values

  • SL_STATUS_OK: If the listing started successfully. Error code otherwise.

The provisioner will trigger count sl_btmesh_evt_prov_ddb_list events.


btmesh_prov_delete_ddb_entry#

sl_status_t btmesh_prov_delete_ddb_entry (uuid_128 uuid)
Parameters
TypeDirectionArgument NameDescription
uuid_128[in]uuid

UUID of the node to be deleted

Delete a node from the device database of the provisioner node

Returns

  • Status of the command.

Return values

  • SL_STATUS_OK: If deletion started successfully. Error code otherwise.

The provisioner will trigger an sl_btmesh_evt_prov_delete_ddb_entry_complete event when the deletion is finished.


btmesh_prov_create_appkey#

sl_status_t btmesh_prov_create_appkey (uint16_t netkey_index, uint16_t appkey_index, size_t key_len, const uint8_t * key, size_t max_application_key_size, size_t * application_key_len, uint8_t * application_key)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]netkey_index

Netkey index of the network.

uint16_t[in]appkey_index

Appkey index to use.

size_t[in]key_len

Length of the appkey data.

const uint8_t *[in]key

Key value to use. Set to zero-length to generate random key.

size_t[in]max_application_key_size

Size of output buffer passed in application_key.

size_t *[out]application_key_len

The length of output data written to application_key.

uint8_t *[out]application_key

New application key. Ignore it if the result was non-zero.

Create a new application key on the provisioner node

Returns

  • Status of the key creation procedure.

Return values

  • SL_STATUS_OK: If successful. Error code otherwise.


btmesh_prov_create_network#

sl_status_t btmesh_prov_create_network (uint16_t netkey_index, size_t key_len, const uint8_t * key)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]netkey_index

Netkey index to use.

size_t[in]key_len

Length of the netkey data.

const uint8_t *[in]key

Key value to use. Set to zero-length array to generate a random key.

Create a new network on the provisioner node

Returns

  • Status of the network creation.

Return values

  • SL_STATUS_OK: If successful. Error code otherwise.


btmesh_prov_on_device_provisioned_evt#

void btmesh_prov_on_device_provisioned_evt (uint16_t address, uuid_128 uuid)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]address

Primary element address of the node

uuid_128[in]uuid

UUID of the node

Callback to inform the application that a new node was provisioned


btmesh_prov_on_provision_failed_evt#

void btmesh_prov_on_provision_failed_evt (uint8_t reason, uuid_128 uuid)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]reason

Reason of the failure

uuid_128[in]uuid

UUID of the node

Callback to inform the application that a provisioning session failed


btmesh_prov_on_unprovisioned_node_list_evt#

void btmesh_prov_on_unprovisioned_node_list_evt (uint16_t id, uuid_128 uuid, uint16_t oob_capabilities)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]id

List ID of the node

uuid_128[in]uuid

UUID of the node

uint16_t[in]oob_capabilities

OOB capability bitmask

Callback to inform the application of an unprovisioned node


btmesh_prov_on_provisioned_node_list_evt#

void btmesh_prov_on_provisioned_node_list_evt (uint16_t id, uuid_128 uuid, uint16_t primary_address)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]id

List ID of the node

uuid_128[in]uuid

UUID of the node

uint16_t[in]primary_address

Primary element address of the node

Callback to inform the application of a provisioned node


btmesh_prov_on_ddb_list_ready#

void btmesh_prov_on_ddb_list_ready (uint16_t count)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]count

Number of nodes in the DDB

Callback to inform the application that the DDB list is ready


btmesh_prov_free_remote_serverlist#

void btmesh_prov_free_remote_serverlist (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Free remote provisioner internal server lists


btmesh_prov_setup_cbp#

sl_status_t btmesh_prov_setup_cbp (uuid_128 uuid)
Parameters
TypeDirectionArgument NameDescription
uuid_128[in]uuid

UUID of the device to be provisioned

Setup certificate-based provisioning

Returns

  • Status of the setup sequence

Return values

  • SL_STATUS_OK: If successful Error code otherwise


btmesh_prov_init_provisioning_records#

sl_status_t btmesh_prov_init_provisioning_records (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Wrapper for provisioning records initialization

Returns

  • Status of the initialization sequence


btmesh_cbp_on_event#

void btmesh_cbp_on_event (sl_btmesh_msg_t * evt)
Parameters
TypeDirectionArgument NameDescription
sl_btmesh_msg_t *[in]evt

The received event

BT Mesh event handler for CBP