BT Mesh Provisioner Application Component#

BT Mesh Provisioner Application component provides application-level functionality for provisioning devices into a Bluetooth Mesh network.

Enumerations#

enum
PROV_CMD_LINE_MODE
PROV_UI_MODE
}

Current provisioner mode, either single run command line mode or ui, menu mode.

Functions#

sl_status_t
btmesh_app_prov_init(int opt, char *optarg)
void
btmesh_app_prov_on_event(sl_btmesh_msg_t *evt)
void
btmesh_app_prov_get_command(command_t *prov_command, command_state_t *prov_command_state)
void
btmesh_app_prov_set_command(command_t prov_command)
void
btmesh_app_prov_set_command_state(command_state_t prov_command_state)
void
btmesh_app_prov_get_cmd_options(struct option **prov_options)
void
btmesh_cbp_prov_get_cmd_options(struct option **prov_options)
bool
bool
void
btmesh_app_prov_set_mode(prov_mode_t prov_mode)
void
void
btmesh_app_prov_handle_cbp(uint16_t netkey_index, uuid_128 uuid, bd_addr mac_address, uint8_t bearer_type)

Macros#

#define
PROV_OPTLENGTH 8

Optstring argument for getopt.

#define
BTMESH_APP_PROV_NCP_ADDRESS 0x2001

NCP node address.

#define
LAST_OPTION_ELEMENT 1

Array terminate element length.

#define
PROV_OPTSTRING "ei:lp:k:x:r:s"

Optstring argument for getopt.

#define
PROV_USAGE undefined

Usage info.

#define
PROV_OPTIONS undefined

Enumeration Documentation#

prov_mode_t#

prov_mode_t

Current provisioner mode, either single run command line mode or ui, menu mode.

Enumerator
PROV_CMD_LINE_MODE
PROV_UI_MODE

Function Documentation#

btmesh_app_prov_init#

sl_status_t btmesh_app_prov_init (int opt, char * optarg)
Parameters
TypeDirectionArgument NameDescription
int[in]opt

Command option

char *[in]optarg

Command argument

Provisioner Command Line Application Init


btmesh_app_prov_process_action#

void btmesh_app_prov_process_action (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Provisioner Application Process Action


btmesh_app_prov_on_event#

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

Event coming from the Bluetooth Mesh stack

Bluetooth Mesh stack event handler


btmesh_app_prov_get_command#

void btmesh_app_prov_get_command (command_t * prov_command, command_state_t * prov_command_state)
Parameters
TypeDirectionArgument NameDescription
command_t *[out]prov_command

Current command

command_state_t *[out]prov_command_state

Current command status

Get the provisioner command and command status


btmesh_app_prov_set_command#

void btmesh_app_prov_set_command (command_t prov_command)
Parameters
TypeDirectionArgument NameDescription
command_t[in]prov_command

New command

Set the provisioner command


btmesh_app_prov_set_command_state#

void btmesh_app_prov_set_command_state (command_state_t prov_command_state)
Parameters
TypeDirectionArgument NameDescription
command_state_t[out]prov_command_state

New command status

Set the provisioner command status


btmesh_app_prov_get_cmd_options#

void btmesh_app_prov_get_cmd_options (struct option ** prov_options)
Parameters
TypeDirectionArgument NameDescription
struct option **[out]prov_options

Options struct array address

Get the command options struct array address


btmesh_cbp_prov_get_cmd_options#

void btmesh_cbp_prov_get_cmd_options (struct option ** prov_options)
Parameters
TypeDirectionArgument NameDescription
struct option **[out]prov_options

Options struct array address

Get the command options struct array address for CBP


btmesh_app_prov_handle_ui#

void btmesh_app_prov_handle_ui (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Handle the main menu in UI mode


btmesh_app_prov_get_uuid_from_unprov_list#

bool btmesh_app_prov_get_uuid_from_unprov_list (uuid_128 * command_uuid)
Parameters
TypeDirectionArgument NameDescription
uuid_128 *[out]command_uuid

The variable to fill with the parsed data

Get UUID from UI for provisioning


btmesh_app_prov_get_uuid_from_prov_list#

bool btmesh_app_prov_get_uuid_from_prov_list (uuid_128 * command_uuid)
Parameters
TypeDirectionArgument NameDescription
uuid_128 *[out]command_uuid

The variable to fill with UUID

Get UUID from UI from rovisioned node list


btmesh_app_prov_get_ddb_status#

bool btmesh_app_prov_get_ddb_status (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Get ddb status after startup


btmesh_app_prov_set_mode#

void btmesh_app_prov_set_mode (prov_mode_t prov_mode)
Parameters
TypeDirectionArgument NameDescription
prov_mode_t[in]prov_mode

New provisioner mode

Set provisioner mode, command line or ui mode


btmesh_app_prov_get_mode#

prov_mode_t btmesh_app_prov_get_mode (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Get provisioner mode command line or menu UI mode


btmesh_app_prov_on_nodeinfo_end#

void btmesh_app_prov_on_nodeinfo_end (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Callback to inform when the nodeinfo query ends


btmesh_app_prov_end_of_cmd#

void btmesh_app_prov_end_of_cmd (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Callback to inform when the command ends


btmesh_app_prov_append_uuid#

void btmesh_app_prov_append_uuid (uuid_128 * uuid)
Parameters
TypeDirectionArgument NameDescription
uuid_128 *[in]uuid

Pointer to the UUID

Helper script to print a given UUID


btmesh_app_prov_get_networks_number#

uint16_t btmesh_app_prov_get_networks_number (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Get ddb status after startup


btmesh_app_prov_handle_cbp#

void btmesh_app_prov_handle_cbp (uint16_t netkey_index, uuid_128 uuid, bd_addr mac_address, uint8_t bearer_type)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]netkey_index

Netkey index of the network

uuid_128[in]uuid

UUID of the device to be provisioned

bd_addr[in]mac_address

MAC address of the device to be provisioned

uint8_t[in]bearer_type

Type of the provisioning bearer layer. Can be PB-ADV (0) or PB-GATT (1).

Handle certificate-based provisioning


btmesh_app_prov_set_cbp_capability#

void btmesh_app_prov_set_cbp_capability (bool capability)
Parameters
TypeDirectionArgument NameDescription
bool[in]capability

true if the node is CBP-capable, false otherwise

Inform the CBP handler if the provisioned node is capable of CBP or not


btmesh_app_prov_get_cbp_status#

bool btmesh_app_prov_get_cbp_status (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Get current CBP status from the CBP handler