Bluetooth Mesh Application Configuration.
More...
|
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.
|
|
Bluetooth Mesh Application Configuration.
◆ bt_mesh_app_key_add()
uint8_t bt_mesh_app_key_add |
( |
uint16_t |
app_idx, |
|
|
uint16_t |
net_idx, |
|
|
const uint8_t |
key[16] |
|
) |
| |
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.
- Parameters
-
app_idx | Application index. |
net_idx | Network index the Application is bound to. |
key | Application key value. |
- Return values
-
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. |
◆ bt_mesh_app_key_del()
uint8_t bt_mesh_app_key_del |
( |
uint16_t |
app_idx, |
|
|
uint16_t |
net_idx |
|
) |
| |
Delete an Application key.
All models bound to this application will remove this binding. All models publishing with this application will stop publishing.
- Parameters
-
app_idx | Application index. |
net_idx | Network index. |
- Return values
-
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. |
◆ bt_mesh_app_key_exists()
bool bt_mesh_app_key_exists |
( |
uint16_t |
app_idx | ) |
|
Check if an Application key is known.
- Parameters
-
app_idx | Application index. |
- Returns
- true if the Application is known, false otherwise.
◆ bt_mesh_app_key_update()
uint8_t bt_mesh_app_key_update |
( |
uint16_t |
app_idx, |
|
|
uint16_t |
net_idx, |
|
|
const uint8_t |
key[16] |
|
) |
| |
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.
- Note
- The Application key can only be updated if the bound Subnet is in Key Refresh phase 1.
- Parameters
-
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. |
- Return values
-
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. |
◆ bt_mesh_app_keys_get()
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.
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
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.
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.
- Parameters
-
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. |
- Returns
- The number of indexes added to the
app_idxs
array, or -ENOMEM
if the number of known Applications exceeds the max
parameter.