Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Bluetooth Mesh

Bluetooth Mesh . More...

Topics

 Access layer
 Access layer .
 
 Bluetooth Mesh BLOB Transfer Client model API
 
 
 Bluetooth Mesh BLOB Transfer Server model API
 
 
 Bluetooth Mesh BLOB flash stream
 
 
 Bluetooth Mesh BLOB model API
 
 
 Bluetooth Mesh Device Firmware Update
 
 
 Bluetooth Mesh On-Demand Private GATT Proxy Client
 
 
 Bluetooth Mesh On-Demand Private GATT Proxy Server
 
 
 Bluetooth Mesh Private Beacon Client
 
 
 Bluetooth Mesh Private Beacon Server
 
 
 Bluetooth Mesh SAR Configuration Client Model
 Bluetooth Mesh .
 
 Bluetooth Mesh SAR Configuration Server Model
 Bluetooth Mesh .
 
 Bluetooth Mesh Solicitation PDU RPL Client
 
 
 Bluetooth Mesh Solicitation PDU RPL Server
 
 
 Bridge Configuration Client Model
 API for the Bluetooth Mesh Bridge Configuration Client model
 
 Bridge Configuration Server Model
 API for the Bluetooth Mesh Bridge Configuration Server model
 
 Bridge Configuration common header
 
 
 Configuration Client Model
 Configuration Client Model .
 
 Configuration Server Model
 Configuration Server Model .
 
 Firmware Distribution models
 
 
 Health Client Model
 Health Client Model .
 
 Health Server Model
 Health Server Model .
 
 Health faults
 List of specification defined Health fault values.
 
 Heartbeat
 Heartbeat .
 
 Large Composition Data Client model
 
 
 Large Composition Data Server model
 
 
 Message
 Message .
 
 Opcodes Aggregator Client model
 
 
 Opcodes Aggregator Server model
 
 
 Provisioning
 Provisioning .
 
 Proxy
 Proxy .
 
 Remote Provisioning Client model
 
 
 Remote Provisioning models
 
 
 Remote provisioning server
 
 
 Runtime Configuration
 Runtime Configuration .
 
 SAR Configuration common header
 
 
 Statistic
 Statistic .
 

Data Structures

struct  bt_mesh_lpn_cb
 Low Power Node callback functions. More...
 
struct  bt_mesh_friend_cb
 Friend Node callback functions. More...
 

Macros

#define BT_MESH_NET_PRIMARY   0x000
 Primary Network Key index.
 
#define BT_MESH_FEAT_RELAY   BIT(0)
 Relay feature.
 
#define BT_MESH_FEAT_PROXY   BIT(1)
 GATT Proxy feature.
 
#define BT_MESH_FEAT_FRIEND   BIT(2)
 Friend feature.
 
#define BT_MESH_FEAT_LOW_POWER   BIT(3)
 Low Power Node feature.
 
#define BT_MESH_FEAT_SUPPORTED
 Supported heartbeat publication features.
 
#define BT_MESH_LPN_CB_DEFINE(_name)
 Register a callback structure for Friendship events.
 
#define BT_MESH_FRIEND_CB_DEFINE(_name)
 Register a callback structure for Friendship events.
 

Functions

int bt_mesh_init (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.
 
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.
 
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.
 
const uint8_tbt_mesh_va_uuid_get (uint16_t addr, const uint8_t *uuid, uint16_t *retaddr)
 Iterate stored Label UUIDs.
 

Detailed Description

Bluetooth Mesh .

Macro Definition Documentation

◆ BT_MESH_FEAT_FRIEND

#define BT_MESH_FEAT_FRIEND   BIT(2)

#include <zephyr/bluetooth/mesh/main.h>

Friend feature.

◆ BT_MESH_FEAT_LOW_POWER

#define BT_MESH_FEAT_LOW_POWER   BIT(3)

#include <zephyr/bluetooth/mesh/main.h>

Low Power Node feature.

◆ BT_MESH_FEAT_PROXY

#define BT_MESH_FEAT_PROXY   BIT(1)

#include <zephyr/bluetooth/mesh/main.h>

GATT Proxy feature.

◆ BT_MESH_FEAT_RELAY

#define BT_MESH_FEAT_RELAY   BIT(0)

#include <zephyr/bluetooth/mesh/main.h>

Relay feature.

◆ BT_MESH_FEAT_SUPPORTED

#define BT_MESH_FEAT_SUPPORTED

#include <zephyr/bluetooth/mesh/main.h>

Value:
#define BT_MESH_FEAT_FRIEND
Friend feature.
Definition main.h:567
#define BT_MESH_FEAT_LOW_POWER
Low Power Node feature.
Definition main.h:569
#define BT_MESH_FEAT_RELAY
Relay feature.
Definition main.h:563
#define BT_MESH_FEAT_PROXY
GATT Proxy feature.
Definition main.h:565

Supported heartbeat publication features.

◆ BT_MESH_FRIEND_CB_DEFINE

#define BT_MESH_FRIEND_CB_DEFINE ( _name)

#include <zephyr/bluetooth/mesh/main.h>

Value:
_CONCAT(bt_mesh_friend_cb_, \
_name))
#define STRUCT_SECTION_ITERABLE(struct_type, varname)
Defines a new element for an iterable section.
Definition iterable_sections.h:216
Friend Node callback functions.
Definition main.h:717

Register a callback structure for Friendship events.

Registers a callback structure that will be called whenever Friendship gets established or terminated.

Parameters
_nameName of callback structure.

◆ BT_MESH_LPN_CB_DEFINE

#define BT_MESH_LPN_CB_DEFINE ( _name)

#include <zephyr/bluetooth/mesh/main.h>

Value:
_CONCAT(bt_mesh_lpn_cb_, \
_name))
Low Power Node callback functions.
Definition main.h:666

Register a callback structure for Friendship events.

Parameters
_nameName of callback structure.

◆ BT_MESH_NET_PRIMARY

#define BT_MESH_NET_PRIMARY   0x000

#include <zephyr/bluetooth/mesh/main.h>

Primary Network Key index.

Function Documentation

◆ bt_mesh_friend_terminate()

int bt_mesh_friend_terminate ( uint16_t lpn_addr)

#include <zephyr/bluetooth/mesh/main.h>

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 ( const struct bt_mesh_prov * prov,
const struct bt_mesh_comp * comp )

#include <zephyr/bluetooth/mesh/main.h>

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
provNode provisioning information.
compNode Composition.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_mesh_iv_update()

bool bt_mesh_iv_update ( void )

#include <zephyr/bluetooth/mesh/main.h>

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)

#include <zephyr/bluetooth/mesh/main.h>

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 )

#include <zephyr/bluetooth/mesh/main.h>

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)

#include <zephyr/bluetooth/mesh/main.h>

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

void bt_mesh_reset ( void )

#include <zephyr/bluetooth/mesh/main.h>

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 )

#include <zephyr/bluetooth/mesh/main.h>

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)

#include <zephyr/bluetooth/mesh/main.h>

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 )

#include <zephyr/bluetooth/mesh/main.h>

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.

◆ bt_mesh_va_uuid_get()

const uint8_t * bt_mesh_va_uuid_get ( uint16_t addr,
const uint8_t * uuid,
uint16_t * retaddr )

#include <zephyr/bluetooth/mesh/main.h>

Iterate stored Label UUIDs.

When addr is BT_MESH_ADDR_UNASSIGNED, this function iterates over all available addresses starting with uuid. In this case, use retaddr to get virtual address representation of the returned Label UUID. When addr is a virtual address, this function returns next Label UUID corresponding to the addr. When uuid is NULL, this function returns the first available UUID. If uuid is previously returned uuid, this function returns following uuid.

Parameters
addrVirtual address to search for, or BT_MESH_ADDR_UNASSIGNED.
uuidPointer to the previously returned Label UUID or NULL.
retaddrPointer to a memory where virtual address representation of the returning UUID is to be stored to.
Returns
Pointer to Label UUID, or NULL if no more entries found.