NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
Bluetooth Mesh

Bluetooth Mesh. More...

Modules

 Bluetooth Mesh Access Layer
 Bluetooth Mesh Access Layer.
 
 Bluetooth Mesh Runtime Configuration
 Bluetooth Mesh Runtime Configuration API.
 
 Bluetooth Mesh Configuration Client Model
 Bluetooth Mesh.
 
 Bluetooth Mesh Configuration Server Model
 Bluetooth Mesh.
 
 Bluetooth Mesh Health Client Model
 Bluetooth Mesh.
 
 Bt_mesh_health_srv
 Mesh Bluetooth Mesh Health Server Model.
 
 Bluetooth Mesh Heartbeat
 Bluetooth Mesh.
 
 Bluetooth Mesh Provisioning
 Bluetooth Mesh Provisioning.
 
 Bluetooth Mesh Message API
 Bluetooth Mesh Message API.
 
 Bluetooth Mesh Proxy
 Bluetooth Mesh Proxy.
 

Functions

int bt_mesh_init (uint8_t own_addr_type, const struct bt_mesh_prov *prov, const struct bt_mesh_comp *comp)
 Initialize Mesh support.
 
void bt_mesh_reset (void)
 Reset the state of the local Mesh node.
 
int bt_mesh_suspend (void)
 Suspend the Mesh network temporarily.
 
int bt_mesh_resume (void)
 Resume a suspended Mesh network.
 
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.
 
bool bt_mesh_is_provisioned (void)
 Check if the local node has been provisioned.
 
void bt_mesh_iv_update_test (bool enable)
 Toggle the IV Update test mode.
 
bool bt_mesh_iv_update (void)
 Toggle the IV Update state.
 
int bt_mesh_lpn_set (bool enable)
 Toggle the Low Power feature of the local device.
 
int bt_mesh_lpn_poll (void)
 Send out a Friend Poll message.
 
void bt_mesh_lpn_set_cb (void(*cb)(uint16_t friend_addr, bool established))
 Register a callback for Friendship changes.
 
int bt_mesh_friend_terminate (uint16_t lpn_addr)
 Terminate Friendship.
 
void bt_mesh_rpl_pending_store (uint16_t addr)
 Store pending RPL entry(ies) in the persistent storage.
 

Detailed Description

Bluetooth Mesh.

Function Documentation

◆ bt_mesh_friend_terminate()

int bt_mesh_friend_terminate ( uint16_t  lpn_addr)

Terminate Friendship.

Terminated Friendship for given LPN.

Parameters
lpn_addrLow Power Node address.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_init()

int bt_mesh_init ( uint8_t  own_addr_type,
const struct bt_mesh_prov prov,
const struct bt_mesh_comp comp 
)

Initialize Mesh support.

After calling this API, the node will not automatically advertise as unprovisioned, rather the bt_mesh_prov_enable() API needs to be called to enable unprovisioned advertising on one or more provisioning bearers.

Parameters
own_addr_typeNode address type
provNode provisioning information.
compNode Composition.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_is_provisioned()

bool bt_mesh_is_provisioned ( void  )

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_iv_update()

bool bt_mesh_iv_update ( void  )

Toggle the IV Update state.

This API is only available if the IV Update test mode has been enabled in Kconfig. It is needed for passing most of the IV Update qualification test cases.

Returns
true if IV Update In Progress state was entered, false otherwise.

◆ bt_mesh_iv_update_test()

void bt_mesh_iv_update_test ( bool  enable)

Toggle the IV Update test mode.

This API is only available if the IV Update test mode has been enabled in Kconfig. It is needed for passing most of the IV Update qualification test cases.

Parameters
enabletrue to enable IV Update test mode, false to disable it.

◆ bt_mesh_lpn_poll()

int bt_mesh_lpn_poll ( void  )

Send out a Friend Poll message.

Send a Friend Poll message to the Friend of this node. If there is no established Friendship the function will return an error.

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

◆ bt_mesh_lpn_set()

int bt_mesh_lpn_set ( bool  enable)

Toggle the Low Power feature of the local device.

Enables or disables the Low Power feature of the local device. This is exposed as a run-time feature, since the device might want to change this e.g. based on being plugged into a stable power source or running from a battery power source.

Parameters
enabletrue to enable LPN functionality, false to disable it.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_lpn_set_cb()

void bt_mesh_lpn_set_cb ( void(*)(uint16_t friend_addr, bool established)  cb)

Register a callback for Friendship changes.

Registers a callback that will be called whenever Friendship gets established or is lost.

Parameters
cbFunction to call when the Friendship status changes.

◆ 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] 
)

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 
)

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.

◆ bt_mesh_reset()

void bt_mesh_reset ( void  )

Reset the state of the local Mesh node.

Resets the state of the node, which means that it needs to be reprovisioned to become an active node in a Mesh network again.

After calling this API, the node will not automatically advertise as unprovisioned, rather the bt_mesh_prov_enable() API needs to be called to enable unprovisioned advertising on one or more provisioning bearers.

◆ bt_mesh_resume()

int bt_mesh_resume ( void  )

Resume a suspended Mesh network.

This API resumes the local node, after it has been suspended using the bt_mesh_suspend() API.

Returns
0 on success, or (negative) error code on failure.

◆ bt_mesh_rpl_pending_store()

void bt_mesh_rpl_pending_store ( uint16_t  addr)

Store pending RPL entry(ies) in the persistent storage.

This API allows the user to store pending RPL entry(ies) in the persistent storage without waiting for the timeout.

Note
When flash is used as the persistent storage, calling this API too frequently may wear it out.
Parameters
addrAddress of the node which RPL entry needs to be stored or BT_MESH_ADDR_ALL_NODES to store all pending RPL entries.

◆ bt_mesh_suspend()

int bt_mesh_suspend ( void  )

Suspend the Mesh network temporarily.

This API can be used for power saving purposes, but the user should be aware that leaving the local node suspended for a long period of time may cause it to become permanently disconnected from the Mesh network. If at all possible, the Friendship feature should be used instead, to make the node into a Low Power Node.

Returns
0 on success, or (negative) error code on failure.