Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS

Provisioning. More...

Data Structures

struct  bt_mesh_dev_capabilities
 
struct  bt_mesh_prov
 

Enumerations

enum  bt_mesh_output_action_t {
  BT_MESH_NO_OUTPUT = 0 , BT_MESH_BLINK = BIT(0) , BT_MESH_BEEP = BIT(1) , BT_MESH_VIBRATE = BIT(2) ,
  BT_MESH_DISPLAY_NUMBER = BIT(3) , BT_MESH_DISPLAY_STRING = BIT(4)
}
 
enum  bt_mesh_input_action_t {
  BT_MESH_NO_INPUT = 0 , BT_MESH_PUSH = BIT(0) , BT_MESH_TWIST = BIT(1) , BT_MESH_ENTER_NUMBER = BIT(2) ,
  BT_MESH_ENTER_STRING = BIT(3)
}
 
enum  bt_mesh_prov_bearer_t { BT_MESH_PROV_ADV = BIT(0) , BT_MESH_PROV_GATT = BIT(1) }
 
enum  bt_mesh_prov_oob_info_t {
  BT_MESH_PROV_OOB_OTHER = BIT(0) , BT_MESH_PROV_OOB_URI = BIT(1) , BT_MESH_PROV_OOB_2D_CODE = BIT(2) , BT_MESH_PROV_OOB_BAR_CODE = BIT(3) ,
  BT_MESH_PROV_OOB_NFC = BIT(4) , BT_MESH_PROV_OOB_NUMBER = BIT(5) , BT_MESH_PROV_OOB_STRING = BIT(6) , BT_MESH_PROV_OOB_ON_BOX = BIT(11) ,
  BT_MESH_PROV_OOB_IN_BOX = BIT(12) , BT_MESH_PROV_OOB_ON_PAPER = BIT(13) , BT_MESH_PROV_OOB_IN_MANUAL = BIT(14) , BT_MESH_PROV_OOB_ON_DEV = BIT(15)
}
 

Functions

int bt_mesh_input_string (const char *str)
 Provide provisioning input OOB string. More...
 
int bt_mesh_input_number (uint32_t num)
 Provide provisioning input OOB number. More...
 
int bt_mesh_prov_remote_pub_key_set (const uint8_t public_key[64])
 Provide Device public key. More...
 
int bt_mesh_auth_method_set_input (bt_mesh_input_action_t action, uint8_t size)
 Use Input OOB authentication. More...
 
int bt_mesh_auth_method_set_output (bt_mesh_output_action_t action, uint8_t size)
 Use Output OOB authentication. More...
 
int bt_mesh_auth_method_set_static (const uint8_t *static_val, uint8_t size)
 Use static OOB authentication. More...
 
int bt_mesh_auth_method_set_none (void)
 Don't use OOB authentication. More...
 
int bt_mesh_prov_enable (bt_mesh_prov_bearer_t bearers)
 Enable specific provisioning bearers. More...
 
int bt_mesh_prov_disable (bt_mesh_prov_bearer_t bearers)
 Disable specific provisioning bearers. More...
 
int bt_mesh_provision (const uint8_t net_key[16], uint16_t net_idx, uint8_t flags, uint32_t iv_index, uint16_t addr, const uint8_t dev_key[16])
 Provision the local Mesh Node. More...
 
int bt_mesh_provision_adv (const uint8_t uuid[16], uint16_t net_idx, uint16_t addr, uint8_t attention_duration)
 Provision a Mesh Node using PB-ADV. More...
 
bool bt_mesh_is_provisioned (void)
 Check if the local node has been provisioned. More...
 

Detailed Description

Provisioning.

Enumeration Type Documentation

◆ bt_mesh_input_action_t

#include <include/bluetooth/mesh/main.h>

Available Provisioning input authentication actions.

Enumerator
BT_MESH_NO_INPUT 
BT_MESH_PUSH 
BT_MESH_TWIST 
BT_MESH_ENTER_NUMBER 
BT_MESH_ENTER_STRING 

◆ bt_mesh_output_action_t

#include <include/bluetooth/mesh/main.h>

Available Provisioning output authentication actions.

Enumerator
BT_MESH_NO_OUTPUT 
BT_MESH_BLINK 
BT_MESH_BEEP 
BT_MESH_VIBRATE 
BT_MESH_DISPLAY_NUMBER 
BT_MESH_DISPLAY_STRING 

◆ bt_mesh_prov_bearer_t

#include <include/bluetooth/mesh/main.h>

Available Provisioning bearers.

Enumerator
BT_MESH_PROV_ADV 
BT_MESH_PROV_GATT 

◆ bt_mesh_prov_oob_info_t

#include <include/bluetooth/mesh/main.h>

Out of Band information location.

Enumerator
BT_MESH_PROV_OOB_OTHER 
BT_MESH_PROV_OOB_URI 
BT_MESH_PROV_OOB_2D_CODE 
BT_MESH_PROV_OOB_BAR_CODE 
BT_MESH_PROV_OOB_NFC 
BT_MESH_PROV_OOB_NUMBER 
BT_MESH_PROV_OOB_STRING 
BT_MESH_PROV_OOB_ON_BOX 
BT_MESH_PROV_OOB_IN_BOX 
BT_MESH_PROV_OOB_ON_PAPER 
BT_MESH_PROV_OOB_IN_MANUAL 
BT_MESH_PROV_OOB_ON_DEV 

Function Documentation

◆ bt_mesh_auth_method_set_input()

int bt_mesh_auth_method_set_input ( bt_mesh_input_action_t  action,
uint8_t  size 
)

#include <include/bluetooth/mesh/main.h>

Use Input OOB authentication.

Provisioner only.

Instruct the unprovisioned device to use the specified Input OOB authentication action. When using BT_MESH_PUSH, BT_MESH_TWIST or BT_MESH_ENTER_NUMBER, the bt_mesh_prov::output_number callback is called with a random number that has to be entered on the unprovisioned device.

When using BT_MESH_ENTER_STRING, the bt_mesh_prov::output_string callback is called with a random string that has to be entered on the unprovisioned device.

Parameters
actionAuthentication action used by the unprovisioned device.
sizeAuthentication size.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_auth_method_set_none()

int bt_mesh_auth_method_set_none ( void  )

#include <include/bluetooth/mesh/main.h>

Don't use OOB authentication.

Provisioner only.

Don't use any authentication when provisioning new devices. This is the default behavior.

Warning
Not using any authentication exposes the mesh network to impersonation attacks, where attackers can pretend to be the unprovisioned device to gain access to the network. Authentication is strongly encouraged.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_auth_method_set_output()

int bt_mesh_auth_method_set_output ( bt_mesh_output_action_t  action,
uint8_t  size 
)

#include <include/bluetooth/mesh/main.h>

Use Output OOB authentication.

Provisioner only.

Instruct the unprovisioned device to use the specified Output OOB authentication action. The bt_mesh_prov::input callback will be called.

When using BT_MESH_BLINK, BT_MESH_BEEP, BT_MESH_VIBRATE or BT_MESH_DISPLAY_NUMBER, and the application has to call bt_mesh_input_number with the random number indicated by the unprovisioned device.

When using BT_MESH_DISPLAY_STRING, the application has to call bt_mesh_input_string with the random string displayed by the unprovisioned device.

Parameters
actionAuthentication action used by the unprovisioned device.
sizeAuthentication size.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_auth_method_set_static()

int bt_mesh_auth_method_set_static ( const uint8_t static_val,
uint8_t  size 
)

#include <include/bluetooth/mesh/main.h>

Use static OOB authentication.

Provisioner only.

Instruct the unprovisioned device to use static OOB authentication, and use the given static authentication value when provisioning.

Parameters
static_valStatic OOB value.
sizeStatic OOB value size.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_input_number()

int bt_mesh_input_number ( uint32_t  num)

#include <include/bluetooth/mesh/main.h>

Provide provisioning input OOB number.

This is intended to be called after the bt_mesh_prov input callback has been called with BT_MESH_ENTER_NUMBER as the action.

Parameters
numNumber.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_input_string()

int bt_mesh_input_string ( const char *  str)

#include <include/bluetooth/mesh/main.h>

Provide provisioning input OOB string.

This is intended to be called after the bt_mesh_prov input callback has been called with BT_MESH_ENTER_STRING as the action.

Parameters
strString.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_is_provisioned()

bool bt_mesh_is_provisioned ( void  )

#include <include/bluetooth/mesh/main.h>

Check if the local node has been provisioned.

This API can be used to check if the local node has been provisioned or not. It can e.g. be helpful to determine if there was a stored network in flash, i.e. if the network was restored after calling settings_load().

Returns
True if the node is provisioned. False otherwise.

◆ bt_mesh_prov_disable()

int bt_mesh_prov_disable ( bt_mesh_prov_bearer_t  bearers)

#include <include/bluetooth/mesh/main.h>

Disable specific provisioning bearers.

Disable one or more provisioning bearers.

Parameters
bearersBit-wise or of provisioning bearers.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_prov_enable()

int bt_mesh_prov_enable ( bt_mesh_prov_bearer_t  bearers)

#include <include/bluetooth/mesh/main.h>

Enable specific provisioning bearers.

Enable one or more provisioning bearers.

Parameters
bearersBit-wise or of provisioning bearers.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_prov_remote_pub_key_set()

int bt_mesh_prov_remote_pub_key_set ( const uint8_t  public_key[64])

#include <include/bluetooth/mesh/main.h>

Provide Device public key.

Parameters
public_keyDevice public key in big-endian.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_provision()

int bt_mesh_provision ( const uint8_t  net_key[16],
uint16_t  net_idx,
uint8_t  flags,
uint32_t  iv_index,
uint16_t  addr,
const uint8_t  dev_key[16] 
)

#include <include/bluetooth/mesh/main.h>

Provision the local Mesh Node.

This API should normally not be used directly by the application. The only exception is for testing purposes where manual provisioning is desired without an actual external provisioner.

Parameters
net_keyNetwork Key
net_idxNetwork Key Index
flagsProvisioning Flags
iv_indexIV Index
addrPrimary element address
dev_keyDevice Key
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_provision_adv()

int bt_mesh_provision_adv ( const uint8_t  uuid[16],
uint16_t  net_idx,
uint16_t  addr,
uint8_t  attention_duration 
)

#include <include/bluetooth/mesh/main.h>

Provision a Mesh Node using PB-ADV.

Parameters
uuidUUID
net_idxNetwork Key Index
addrAddress to assign to remote device. If addr is 0, the lowest available address will be chosen.
attention_durationThe attention duration to be send to remote device
Returns
Zero on success or (negative) error code otherwise.