#include <inttypes.h>
#include <sys/atomic.h>
Go to the source code of this file.
◆ APP_KEY_COUNT
◆ NODE_COUNT
◆ SUBNET_COUNT
◆ bt_mesh_cdb_node_func_t
Node iterator callback.
- Parameters
-
node | Node found. |
user_data | Data given. |
- Returns
- BT_MESH_CDB_ITER_CONTINUE to continue to iterate through the nodes or BT_MESH_CDB_ITER_STOP to stop.
◆ anonymous enum
Enumerator |
---|
BT_MESH_CDB_NODE_CONFIGURED | |
BT_MESH_CDB_NODE_FLAG_COUNT | |
◆ anonymous enum
Enumerator |
---|
BT_MESH_CDB_VALID | |
BT_MESH_CDB_SUBNET_PENDING | |
BT_MESH_CDB_KEYS_PENDING | |
BT_MESH_CDB_NODES_PENDING | |
BT_MESH_CDB_IVU_IN_PROGRESS | |
BT_MESH_CDB_FLAG_COUNT | |
◆ anonymous enum
Enumerator |
---|
BT_MESH_CDB_ITER_STOP | |
BT_MESH_CDB_ITER_CONTINUE | |
◆ bt_mesh_cdb_app_key_alloc()
Allocate an application key.
Allocate a new application key in the CDB.
- Parameters
-
net_idx | NetIdx of NetKey that the application key is bound to. |
app_idx | AppIdx of the application key. |
- Returns
- The new application key or NULL if it cannot be allocated.
◆ bt_mesh_cdb_app_key_del()
Delete an application key.
Delete an application key from the CDB.
- Parameters
-
key | The application key to be deleted. |
store | If true, the key will be cleared from persistent storage. |
◆ bt_mesh_cdb_app_key_get()
Get an application key by AppIdx.
Try to find the application key with the specified AppIdx.
- Parameters
-
app_idx | AppIdx of the application key to look for. |
- Returns
- The application key with the specified AppIdx or NULL if no such key exists.
◆ bt_mesh_cdb_app_key_store()
Store application key to persistent storage.
- Parameters
-
key | Application key to be stored. |
◆ bt_mesh_cdb_clear()
Clear the Mesh Configuration Database.
Remove all nodes, subnets and app-keys stored in the database and mark the database as invalid. The data will be cleared from persistent storage if CONFIG_BT_SETTINGS is enabled.
◆ bt_mesh_cdb_create()
int bt_mesh_cdb_create |
( |
const uint8_t |
key[16] | ) |
|
Create the Mesh Configuration Database.
Create and initialize the Mesh Configuration Database. A primary subnet, ie one with NetIdx 0, will be added and the provided key will be used as NetKey for that subnet.
- Parameters
-
key | The NetKey to be used for the primary subnet. |
- Returns
- 0 on success or negative error code on failure.
◆ bt_mesh_cdb_iv_update()
Set and store the IV Index and IV Update flag.
The IV Index stored in the CDB will be the one used during provisioning of new nodes. This function is generally only used from inside the stack.
This function will store the data to persistent storage if CONFIG_BT_SETTINGS is enabled.
- Parameters
-
iv_index | The new IV Index to use. |
iv_update | True if there is an ongoing IV Update procedure. |
◆ bt_mesh_cdb_node_alloc()
Allocate a node.
Allocate a new node in the CDB.
- Parameters
-
uuid | UUID of the node. |
addr | Address of the node's primary element. If 0, the lowest possible address available will be assigned to the node. |
num_elem | Number of elements that the node has. |
net_idx | NetIdx that the node was provisioned to. |
- Returns
- The new node or NULL if it cannot be allocated.
◆ bt_mesh_cdb_node_del()
Delete a node.
Delete a node from the CDB.
- Parameters
-
node | The node to be deleted. |
store | If true, the node will be cleared from persistent storage. |
◆ bt_mesh_cdb_node_foreach()
Node iterator.
Iterate nodes in the Mesh Configuration Database. The callback function will only be called for valid, ie allocated, nodes.
- Parameters
-
func | Callback function. |
user_data | Data to pass to the callback. |
◆ bt_mesh_cdb_node_get()
Get a node by address.
Try to find the node that has the provided address assigned to one of its elements.
- Parameters
-
addr | Address of the element to look for. |
- Returns
- The node that has an element with address addr or NULL if no such node exists.
◆ bt_mesh_cdb_node_store()
Store node to persistent storage.
- Parameters
-
◆ bt_mesh_cdb_subnet_alloc()
Allocate a subnet.
Allocate a new subnet in the CDB.
- Parameters
-
net_idx | NetIdx of the subnet. |
- Returns
- The new subnet or NULL if it cannot be allocated.
◆ bt_mesh_cdb_subnet_del()
Delete a subnet.
Delete a subnet from the CDB.
- Parameters
-
sub | The subnet to be deleted. |
store | If true, the subnet will be cleared from persistent storage. |
◆ bt_mesh_cdb_subnet_flags()
Get the flags for a subnet.
- Parameters
-
sub | The subnet to get flags for. |
- Returns
- The flags for the subnet.
◆ bt_mesh_cdb_subnet_get()
Get a subnet by NetIdx.
Try to find the subnet with the specified NetIdx.
- Parameters
-
net_idx | NetIdx of the subnet to look for. |
- Returns
- The subnet with the specified NetIdx or NULL if no such subnet exists.
◆ bt_mesh_cdb_subnet_store()
Store subnet to persistent storage.
- Parameters
-
◆ bt_mesh_cdb