Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Application Configuration. More...
Functions | |
uint8_t | bt_mesh_app_key_add (uint16_t app_idx, uint16_t net_idx, const uint8_t key[16]) |
Add an Application key. | |
uint8_t | bt_mesh_app_key_update (uint16_t app_idx, uint16_t net_idx, const uint8_t key[16]) |
Update an Application key. | |
uint8_t | bt_mesh_app_key_del (uint16_t app_idx, uint16_t net_idx) |
Delete an Application key. | |
bool | bt_mesh_app_key_exists (uint16_t app_idx) |
Check if an Application key is known. | |
ssize_t | bt_mesh_app_keys_get (uint16_t net_idx, uint16_t app_idxs[], size_t max, off_t skip) |
Get a list of all known Application key indexes. | |
Application Configuration.
#include <zephyr/bluetooth/mesh/cfg.h>
Add an Application key.
Adds the Application with the given index to the list of known applications. Allows the node to send and receive model messages encrypted with this Application key.
Every Application is bound to a specific Subnet. The node must know the Subnet the Application is bound to before it can add the Application.
app_idx | Application index. |
net_idx | Network index the Application is bound to. |
key | Application key value. |
STATUS_SUCCESS | The Application was successfully added. |
STATUS_INVALID_NETKEY | The NetIdx is unknown. |
STATUS_INSUFF_RESOURCES | There's no room for storing this Application. |
STATUS_INVALID_BINDING | This AppIdx is already bound to another Subnet. |
STATUS_IDX_ALREADY_STORED | This AppIdx is already stored with a different key value. |
STATUS_CANNOT_SET | Cannot set the Application key for some reason. |
#include <zephyr/bluetooth/mesh/cfg.h>
Delete an Application key.
All models bound to this application will remove this binding. All models publishing with this application will stop publishing.
app_idx | Application index. |
net_idx | Network index. |
STATUS_SUCCESS | The Application key was successfully deleted. |
STATUS_INVALID_NETKEY | The NetIdx is unknown. |
STATUS_INVALID_BINDING | This AppIdx is not bound to the given NetIdx. |
#include <zephyr/bluetooth/mesh/cfg.h>
Check if an Application key is known.
app_idx | Application index. |
#include <zephyr/bluetooth/mesh/cfg.h>
Update an Application key.
Update an Application with a second Application key, as part of the Key Refresh procedure of the bound Subnet. The node will continue transmitting with the old application key (but receiving on both) until the Subnet enters Key Refresh phase 2. Once the Subnet enters Key Refresh phase 3, the old application key will be deleted.
app_idx | Application index. |
net_idx | Network index the Application is bound to, or BT_MESH_KEY_ANY to skip the binding check. |
key | New key value. |
STATUS_SUCCESS | The Application key was successfully updated. |
STATUS_INVALID_NETKEY | The NetIdx is unknown. |
STATUS_INVALID_BINDING | This AppIdx is not bound to the given NetIdx. |
STATUS_CANNOT_UPDATE | The Application key cannot be updated for some reason. |
STATUS_IDX_ALREADY_STORED | This AppIdx is already updated with a different key value. |
#include <zephyr/bluetooth/mesh/cfg.h>
Get a list of all known Application key indexes.
Builds a list of all Application indexes for the given network index in the app_idxs
array. If the app_idxs
array cannot fit all bound Applications, this function fills all available entries and returns -ENOMEM
. In this case, the next max
entries of the list can be read out by calling
Note that any changes to the Application key list between calls to this function could change the order and number of entries in the list.
net_idx | Network Index to get the Applications of, or BT_MESH_KEY_ANY to get all Applications. |
app_idxs | Array to fill. |
max | Max number of indexes to return. |
skip | Number of indexes to skip. Enables batched processing of the list. |
app_idxs
array, or -ENOMEM
if the number of known Applications exceeds the max
parameter.