Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
Provisioning . More...
Data Structures | |
struct | bt_mesh_dev_capabilities |
Device Capabilities. More... | |
struct | bt_mesh_prov |
Provisioning properties & capabilities. More... | |
Functions | |
int | bt_mesh_input_string (const char *str) |
Provide provisioning input OOB string. | |
int | bt_mesh_input_number (uint32_t num) |
Provide provisioning input OOB number. | |
int | bt_mesh_prov_remote_pub_key_set (const uint8_t public_key[64]) |
Provide Device public key. | |
int | bt_mesh_auth_method_set_input (bt_mesh_input_action_t action, uint8_t size) |
Use Input OOB authentication. | |
int | bt_mesh_auth_method_set_output (bt_mesh_output_action_t action, uint8_t size) |
Use Output OOB authentication. | |
int | bt_mesh_auth_method_set_static (const uint8_t *static_val, uint8_t size) |
Use static OOB authentication. | |
int | bt_mesh_auth_method_set_none (void) |
Don't use OOB authentication. | |
int | bt_mesh_prov_enable (bt_mesh_prov_bearer_t bearers) |
Enable specific provisioning bearers. | |
int | bt_mesh_prov_disable (bt_mesh_prov_bearer_t bearers) |
Disable specific provisioning bearers. | |
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. | |
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. | |
int | bt_mesh_provision_gatt (const uint8_t uuid[16], uint16_t net_idx, uint16_t addr, uint8_t attention_duration) |
Provision a Mesh Node using PB-GATT. | |
int | bt_mesh_provision_remote (struct bt_mesh_rpr_cli *cli, const struct bt_mesh_rpr_node *srv, const uint8_t uuid[16], uint16_t net_idx, uint16_t addr) |
Provision a Mesh Node using PB-Remote. | |
int | bt_mesh_reprovision_remote (struct bt_mesh_rpr_cli *cli, struct bt_mesh_rpr_node *srv, uint16_t addr, bool comp_change) |
Reprovision a Mesh Node using PB-Remote. | |
bool | bt_mesh_is_provisioned (void) |
Check if the local node has been provisioned. | |
Provisioning .
anonymous enum |
#include <zephyr/bluetooth/mesh/main.h>
Available authentication algorithms.
Enumerator | |
---|---|
BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM | |
BT_MESH_PROV_AUTH_HMAC_SHA256_AES_CCM |
anonymous enum |
#include <zephyr/bluetooth/mesh/main.h>
OOB Type field values.
Enumerator | |
---|---|
BT_MESH_STATIC_OOB_AVAILABLE | Static OOB information available. |
BT_MESH_OOB_AUTH_REQUIRED | OOB authentication required. |
#include <zephyr/bluetooth/mesh/main.h>
Available Provisioning input authentication actions.
Enumerator | |
---|---|
BT_MESH_NO_INPUT | |
BT_MESH_PUSH | Push. |
BT_MESH_TWIST | Twist. |
BT_MESH_ENTER_NUMBER | Input number. |
BT_MESH_ENTER_STRING | Input alphanumeric. |
#include <zephyr/bluetooth/mesh/main.h>
Available Provisioning output authentication actions.
Enumerator | |
---|---|
BT_MESH_NO_OUTPUT | |
BT_MESH_BLINK | Blink. |
BT_MESH_BEEP | Beep. |
BT_MESH_VIBRATE | Vibrate. |
BT_MESH_DISPLAY_NUMBER | Output numeric. |
BT_MESH_DISPLAY_STRING | Output alphanumeric. |
#include <zephyr/bluetooth/mesh/main.h>
Available Provisioning bearers.
Enumerator | |
---|---|
BT_MESH_PROV_ADV | PB-ADV bearer. |
BT_MESH_PROV_GATT | PB-GATT bearer. |
BT_MESH_PROV_REMOTE | PB-Remote bearer. |
#include <zephyr/bluetooth/mesh/main.h>
Out of Band information location.
int bt_mesh_auth_method_set_input | ( | bt_mesh_input_action_t | action, |
uint8_t | size ) |
#include <zephyr/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.
action | Authentication action used by the unprovisioned device. |
size | Authentication size. |
int bt_mesh_auth_method_set_none | ( | void | ) |
#include <zephyr/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.
int bt_mesh_auth_method_set_output | ( | bt_mesh_output_action_t | action, |
uint8_t | size ) |
#include <zephyr/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.
action | Authentication action used by the unprovisioned device. |
size | Authentication size. |
#include <zephyr/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.
static_val | Static OOB value. |
size | Static OOB value size. |
int bt_mesh_input_number | ( | uint32_t | num | ) |
#include <zephyr/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.
num | Number. |
int bt_mesh_input_string | ( | const char * | str | ) |
#include <zephyr/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.
str | String. |
bool bt_mesh_is_provisioned | ( | void | ) |
#include <zephyr/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().
int bt_mesh_prov_disable | ( | bt_mesh_prov_bearer_t | bearers | ) |
#include <zephyr/bluetooth/mesh/main.h>
Disable specific provisioning bearers.
Disable one or more provisioning bearers.
bearers | Bit-wise or of provisioning bearers. |
int bt_mesh_prov_enable | ( | bt_mesh_prov_bearer_t | bearers | ) |
#include <zephyr/bluetooth/mesh/main.h>
Enable specific provisioning bearers.
Enable one or more provisioning bearers.
bearers | Bit-wise or of provisioning bearers. |
int bt_mesh_prov_remote_pub_key_set | ( | const uint8_t | public_key[64] | ) |
#include <zephyr/bluetooth/mesh/main.h>
Provide Device public key.
public_key | Device public key in big-endian. |
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 <zephyr/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.
net_key | Network Key |
net_idx | Network Key Index |
flags | Provisioning Flags |
iv_index | IV Index |
addr | Primary element address |
dev_key | Device Key |
int bt_mesh_provision_adv | ( | const uint8_t | uuid[16], |
uint16_t | net_idx, | ||
uint16_t | addr, | ||
uint8_t | attention_duration ) |
#include <zephyr/bluetooth/mesh/main.h>
Provision a Mesh Node using PB-ADV.
uuid | UUID |
net_idx | Network Key Index |
addr | Address to assign to remote device. If addr is 0, the lowest available address will be chosen. |
attention_duration | The attention duration to be send to remote device |
int bt_mesh_provision_gatt | ( | const uint8_t | uuid[16], |
uint16_t | net_idx, | ||
uint16_t | addr, | ||
uint8_t | attention_duration ) |
#include <zephyr/bluetooth/mesh/main.h>
Provision a Mesh Node using PB-GATT.
uuid | UUID |
net_idx | Network Key Index |
addr | Address to assign to remote device. If addr is 0, the lowest available address will be chosen. |
attention_duration | The attention duration to be send to remote device |
int bt_mesh_provision_remote | ( | struct bt_mesh_rpr_cli * | cli, |
const struct bt_mesh_rpr_node * | srv, | ||
const uint8_t | uuid[16], | ||
uint16_t | net_idx, | ||
uint16_t | addr ) |
#include <zephyr/bluetooth/mesh/main.h>
Provision a Mesh Node using PB-Remote.
cli | Remote Provisioning Client Model to provision with. |
srv | Remote Provisioning Server that should be used to tunnel the provisioning. |
uuid | UUID of the unprovisioned node |
net_idx | Network Key Index to give to the unprovisioned node. |
addr | Address to assign to remote device. If addr is 0, the lowest available address will be chosen. |
int bt_mesh_reprovision_remote | ( | struct bt_mesh_rpr_cli * | cli, |
struct bt_mesh_rpr_node * | srv, | ||
uint16_t | addr, | ||
bool | comp_change ) |
#include <zephyr/bluetooth/mesh/main.h>
Reprovision a Mesh Node using PB-Remote.
Reprovisioning can be used to change the device key, unicast address and composition data of another device. The reprovisioning procedure uses the same protocol as normal provisioning, with the same level of security.
There are three tiers of reprovisioning:
The target node indicates that its composition data changed by instantiating its composition data page 128. If the number of elements have changed, it may be necessary to move the unicast address of the target node as well, to avoid overlapping addresses.
cli | Remote Provisioning Client Model to provision on |
srv | Remote Provisioning Server to reprovision |
addr | Address to assign to remote device. If addr is 0, the lowest available address will be chosen. |
comp_change | The target node has indicated that its composition data has changed. Note that the target node will reject the update if this isn't true. |