Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Runtime Configuration

Runtime Configuration . More...

Topics

 Application Configuration
 Application Configuration .
 
 Subnet Configuration
 Subnet Configuration .
 

Macros

#define BT_MESH_KR_NORMAL   0x00
 
#define BT_MESH_KR_PHASE_1   0x01
 
#define BT_MESH_KR_PHASE_2   0x02
 
#define BT_MESH_KR_PHASE_3   0x03
 
#define BT_MESH_RELAY_DISABLED   BT_MESH_FEATURE_DISABLED
 
#define BT_MESH_RELAY_ENABLED   BT_MESH_FEATURE_ENABLED
 
#define BT_MESH_RELAY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED
 
#define BT_MESH_BEACON_DISABLED   BT_MESH_FEATURE_DISABLED
 
#define BT_MESH_BEACON_ENABLED   BT_MESH_FEATURE_ENABLED
 
#define BT_MESH_PRIV_BEACON_DISABLED   BT_MESH_FEATURE_DISABLED
 
#define BT_MESH_PRIV_BEACON_ENABLED   BT_MESH_FEATURE_ENABLED
 
#define BT_MESH_GATT_PROXY_DISABLED   BT_MESH_FEATURE_DISABLED
 
#define BT_MESH_GATT_PROXY_ENABLED   BT_MESH_FEATURE_ENABLED
 
#define BT_MESH_GATT_PROXY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED
 
#define BT_MESH_PRIV_GATT_PROXY_DISABLED   BT_MESH_FEATURE_DISABLED
 
#define BT_MESH_PRIV_GATT_PROXY_ENABLED   BT_MESH_FEATURE_ENABLED
 
#define BT_MESH_PRIV_GATT_PROXY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED
 
#define BT_MESH_FRIEND_DISABLED   BT_MESH_FEATURE_DISABLED
 
#define BT_MESH_FRIEND_ENABLED   BT_MESH_FEATURE_ENABLED
 
#define BT_MESH_FRIEND_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED
 
#define BT_MESH_NODE_IDENTITY_STOPPED   BT_MESH_FEATURE_DISABLED
 
#define BT_MESH_NODE_IDENTITY_RUNNING   BT_MESH_FEATURE_ENABLED
 
#define BT_MESH_NODE_IDENTITY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED
 

Enumerations

enum  bt_mesh_feat_state { BT_MESH_FEATURE_DISABLED , BT_MESH_FEATURE_ENABLED , BT_MESH_FEATURE_NOT_SUPPORTED }
 Bluetooth Mesh feature states. More...
 

Functions

void bt_mesh_beacon_set (bool beacon)
 Enable or disable sending of the Secure Network Beacon.
 
bool bt_mesh_beacon_enabled (void)
 Get the current Secure Network Beacon state.
 
int bt_mesh_priv_beacon_set (enum bt_mesh_feat_state priv_beacon)
 Enable or disable sending of the Mesh Private beacon.
 
enum bt_mesh_feat_state bt_mesh_priv_beacon_get (void)
 Get the current Mesh Private beacon state.
 
void bt_mesh_priv_beacon_update_interval_set (uint8_t interval)
 Set the current Mesh Private beacon update interval.
 
uint8_t bt_mesh_priv_beacon_update_interval_get (void)
 Get the current Mesh Private beacon update interval.
 
int bt_mesh_default_ttl_set (uint8_t default_ttl)
 Set the default TTL value.
 
uint8_t bt_mesh_default_ttl_get (void)
 Get the current default TTL value.
 
int bt_mesh_od_priv_proxy_get (void)
 Get the current Mesh On-Demand Private Proxy state.
 
int bt_mesh_od_priv_proxy_set (uint8_t on_demand_proxy)
 Set state of Mesh On-Demand Private Proxy.
 
void bt_mesh_net_transmit_set (uint8_t xmit)
 Set the Network Transmit parameters.
 
uint8_t bt_mesh_net_transmit_get (void)
 Get the current Network Transmit parameters.
 
int bt_mesh_relay_set (enum bt_mesh_feat_state relay, uint8_t xmit)
 Configure the Relay feature.
 
enum bt_mesh_feat_state bt_mesh_relay_get (void)
 Get the current Relay feature state.
 
uint8_t bt_mesh_relay_retransmit_get (void)
 Get the current Relay Retransmit parameters.
 
int bt_mesh_gatt_proxy_set (enum bt_mesh_feat_state gatt_proxy)
 Enable or disable the GATT Proxy feature.
 
enum bt_mesh_feat_state bt_mesh_gatt_proxy_get (void)
 Get the current GATT Proxy state.
 
int bt_mesh_priv_gatt_proxy_set (enum bt_mesh_feat_state priv_gatt_proxy)
 Enable or disable the Private GATT Proxy feature.
 
enum bt_mesh_feat_state bt_mesh_priv_gatt_proxy_get (void)
 Get the current Private GATT Proxy state.
 
int bt_mesh_friend_set (enum bt_mesh_feat_state friendship)
 Enable or disable the Friend feature.
 
enum bt_mesh_feat_state bt_mesh_friend_get (void)
 Get the current Friend state.
 

Detailed Description

Runtime Configuration .

Macro Definition Documentation

◆ BT_MESH_BEACON_DISABLED

#define BT_MESH_BEACON_DISABLED   BT_MESH_FEATURE_DISABLED

◆ BT_MESH_BEACON_ENABLED

#define BT_MESH_BEACON_ENABLED   BT_MESH_FEATURE_ENABLED

◆ BT_MESH_FRIEND_DISABLED

#define BT_MESH_FRIEND_DISABLED   BT_MESH_FEATURE_DISABLED

◆ BT_MESH_FRIEND_ENABLED

#define BT_MESH_FRIEND_ENABLED   BT_MESH_FEATURE_ENABLED

◆ BT_MESH_FRIEND_NOT_SUPPORTED

#define BT_MESH_FRIEND_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED

◆ BT_MESH_GATT_PROXY_DISABLED

#define BT_MESH_GATT_PROXY_DISABLED   BT_MESH_FEATURE_DISABLED

◆ BT_MESH_GATT_PROXY_ENABLED

#define BT_MESH_GATT_PROXY_ENABLED   BT_MESH_FEATURE_ENABLED

◆ BT_MESH_GATT_PROXY_NOT_SUPPORTED

#define BT_MESH_GATT_PROXY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED

◆ BT_MESH_KR_NORMAL

#define BT_MESH_KR_NORMAL   0x00

◆ BT_MESH_KR_PHASE_1

#define BT_MESH_KR_PHASE_1   0x01

◆ BT_MESH_KR_PHASE_2

#define BT_MESH_KR_PHASE_2   0x02

◆ BT_MESH_KR_PHASE_3

#define BT_MESH_KR_PHASE_3   0x03

◆ BT_MESH_NODE_IDENTITY_NOT_SUPPORTED

#define BT_MESH_NODE_IDENTITY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED

◆ BT_MESH_NODE_IDENTITY_RUNNING

#define BT_MESH_NODE_IDENTITY_RUNNING   BT_MESH_FEATURE_ENABLED

◆ BT_MESH_NODE_IDENTITY_STOPPED

#define BT_MESH_NODE_IDENTITY_STOPPED   BT_MESH_FEATURE_DISABLED

◆ BT_MESH_PRIV_BEACON_DISABLED

#define BT_MESH_PRIV_BEACON_DISABLED   BT_MESH_FEATURE_DISABLED

◆ BT_MESH_PRIV_BEACON_ENABLED

#define BT_MESH_PRIV_BEACON_ENABLED   BT_MESH_FEATURE_ENABLED

◆ BT_MESH_PRIV_GATT_PROXY_DISABLED

#define BT_MESH_PRIV_GATT_PROXY_DISABLED   BT_MESH_FEATURE_DISABLED

◆ BT_MESH_PRIV_GATT_PROXY_ENABLED

#define BT_MESH_PRIV_GATT_PROXY_ENABLED   BT_MESH_FEATURE_ENABLED

◆ BT_MESH_PRIV_GATT_PROXY_NOT_SUPPORTED

#define BT_MESH_PRIV_GATT_PROXY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED

◆ BT_MESH_RELAY_DISABLED

#define BT_MESH_RELAY_DISABLED   BT_MESH_FEATURE_DISABLED

◆ BT_MESH_RELAY_ENABLED

#define BT_MESH_RELAY_ENABLED   BT_MESH_FEATURE_ENABLED

◆ BT_MESH_RELAY_NOT_SUPPORTED

#define BT_MESH_RELAY_NOT_SUPPORTED   BT_MESH_FEATURE_NOT_SUPPORTED

Enumeration Type Documentation

◆ bt_mesh_feat_state

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

Bluetooth Mesh feature states.

Enumerator
BT_MESH_FEATURE_DISABLED 

Feature is supported, but disabled.

BT_MESH_FEATURE_ENABLED 

Feature is supported and enabled.

BT_MESH_FEATURE_NOT_SUPPORTED 

Feature is not supported, and cannot be enabled.

Function Documentation

◆ bt_mesh_beacon_enabled()

bool bt_mesh_beacon_enabled ( void )

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

Get the current Secure Network Beacon state.

Returns
Whether the Secure Network Beacon feature is enabled.

◆ bt_mesh_beacon_set()

void bt_mesh_beacon_set ( bool beacon)

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

Enable or disable sending of the Secure Network Beacon.

Parameters
beaconNew Secure Network Beacon state.

◆ bt_mesh_default_ttl_get()

uint8_t bt_mesh_default_ttl_get ( void )

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

Get the current default TTL value.

Returns
The current default TTL value.

◆ bt_mesh_default_ttl_set()

int bt_mesh_default_ttl_set ( uint8_t default_ttl)

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

Set the default TTL value.

The default TTL value is used when no explicit TTL value is set. Models will use the default TTL value when bt_mesh_msg_ctx::send_ttl is BT_MESH_TTL_DEFAULT.

Parameters
default_ttlThe new default TTL value. Valid values are 0x00 and 0x02 to BT_MESH_TTL_MAX.
Return values
0Successfully set the default TTL value.
-EINVALInvalid TTL value.

◆ bt_mesh_friend_get()

enum bt_mesh_feat_state bt_mesh_friend_get ( void )

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

Get the current Friend state.

Returns
The Friend feature state.

◆ bt_mesh_friend_set()

int bt_mesh_friend_set ( enum bt_mesh_feat_state friendship)

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

Enable or disable the Friend feature.

Any active friendships will be terminated immediately if the Friend feature is disabled.

Support for the Friend feature must be enabled through the CONFIG_BT_MESH_FRIEND configuration option.

Parameters
friendshipNew Friend feature state. Must be one of BT_MESH_FEATURE_ENABLED and BT_MESH_FEATURE_DISABLED.
Return values
0Successfully changed the Friend feature state.
-ENOTSUPThe Friend feature is not supported.
-EINVALInvalid parameter.
-EALREADYAlready in the given state.

◆ bt_mesh_gatt_proxy_get()

enum bt_mesh_feat_state bt_mesh_gatt_proxy_get ( void )

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

Get the current GATT Proxy state.

Returns
The GATT Proxy feature state.

◆ bt_mesh_gatt_proxy_set()

int bt_mesh_gatt_proxy_set ( enum bt_mesh_feat_state gatt_proxy)

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

Enable or disable the GATT Proxy feature.

Support for the GATT Proxy feature must be enabled through the CONFIG_BT_MESH_GATT_PROXY configuration option.

Note
The GATT Proxy feature only controls a Proxy node's ability to relay messages to the mesh network. A node that supports GATT Proxy will still advertise Connectable Proxy beacons, even if the feature is disabled. The Proxy feature can only be fully disabled through compile time configuration.
Parameters
gatt_proxyNew GATT Proxy state. Must be one of BT_MESH_FEATURE_ENABLED and BT_MESH_FEATURE_DISABLED.
Return values
0Successfully changed the GATT Proxy feature state.
-ENOTSUPThe GATT Proxy feature is not supported.
-EINVALInvalid parameter.
-EALREADYAlready in the given state.

◆ bt_mesh_net_transmit_get()

uint8_t bt_mesh_net_transmit_get ( void )

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

Get the current Network Transmit parameters.

The BT_MESH_TRANSMIT_COUNT and BT_MESH_TRANSMIT_INT macros can be used to decode the Network Transmit parameters.

Returns
The current Network Transmit parameters.

◆ bt_mesh_net_transmit_set()

void bt_mesh_net_transmit_set ( uint8_t xmit)

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

Set the Network Transmit parameters.

The Network Transmit parameters determine the parameters local messages are transmitted with.

See also
BT_MESH_TRANSMIT
Parameters
xmitNew Network Transmit parameters. Use BT_MESH_TRANSMIT for encoding.

◆ bt_mesh_od_priv_proxy_get()

int bt_mesh_od_priv_proxy_get ( void )

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

Get the current Mesh On-Demand Private Proxy state.

Return values
0or positive value represents On-Demand Private Proxy feature state
-ENOTSUPThe On-Demand Private Proxy feature is not supported.

◆ bt_mesh_od_priv_proxy_set()

int bt_mesh_od_priv_proxy_set ( uint8_t on_demand_proxy)

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

Set state of Mesh On-Demand Private Proxy.

Support for the On-Demand Private Proxy state must be enabled with BT_MESH_OD_PRIV_PROXY_SRV.

Parameters
on_demand_proxyNew Mesh On-Demand Private Proxy state. Value of 0x00 means that advertising with Private Network Identity cannot be enabled on demand. Values in range 0x01 - 0xFF set interval of this advertising after valid Solicitation PDU is received or client disconnects.
Return values
0Successfully changed the Mesh On-Demand Private Proxy feature state.
-ENOTSUPThe On-Demand Private Proxy feature is not supported.
-EINVALInvalid parameter.
-EALREADYAlready in the given state.

◆ bt_mesh_priv_beacon_get()

enum bt_mesh_feat_state bt_mesh_priv_beacon_get ( void )

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

Get the current Mesh Private beacon state.

Returns
The Mesh Private beacon feature state.

◆ bt_mesh_priv_beacon_set()

int bt_mesh_priv_beacon_set ( enum bt_mesh_feat_state priv_beacon)

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

Enable or disable sending of the Mesh Private beacon.

Support for the Private beacon state must be enabled with CONFIG_BT_MESH_PRIV_BEACONS.

Parameters
priv_beaconNew Mesh Private beacon state. Must be one of BT_MESH_FEATURE_ENABLED and BT_MESH_FEATURE_DISABLED.
Return values
0Successfully changed the Mesh Private beacon feature state.
-ENOTSUPThe Mesh Private beacon feature is not supported.
-EINVALInvalid parameter.
-EALREADYAlready in the given state.

◆ bt_mesh_priv_beacon_update_interval_get()

uint8_t bt_mesh_priv_beacon_update_interval_get ( void )

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

Get the current Mesh Private beacon update interval.

The Mesh Private beacon's randomization value is updated regularly to maintain the node's privacy. The update interval controls how often the beacon is updated, in 10 second increments.

Returns
The Private beacon update interval in 10 second steps, or 0 if the beacon is updated every time it's transmitted.

◆ bt_mesh_priv_beacon_update_interval_set()

void bt_mesh_priv_beacon_update_interval_set ( uint8_t interval)

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

Set the current Mesh Private beacon update interval.

The Mesh Private beacon's randomization value is updated regularly to maintain the node's privacy. The update interval controls how often the beacon is updated, in 10 second increments.

Parameters
intervalPrivate beacon update interval in 10 second steps, or 0 to update on every beacon transmission.

◆ bt_mesh_priv_gatt_proxy_get()

enum bt_mesh_feat_state bt_mesh_priv_gatt_proxy_get ( void )

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

Get the current Private GATT Proxy state.

Returns
The Private GATT Proxy feature state.

◆ bt_mesh_priv_gatt_proxy_set()

int bt_mesh_priv_gatt_proxy_set ( enum bt_mesh_feat_state priv_gatt_proxy)

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

Enable or disable the Private GATT Proxy feature.

Support for the Private GATT Proxy feature must be enabled through the CONFIG_BT_MESH_PRIV_BEACONS and CONFIG_BT_MESH_GATT_PROXY configuration options.

Parameters
priv_gatt_proxyNew Private GATT Proxy state. Must be one of BT_MESH_FEATURE_ENABLED and BT_MESH_FEATURE_DISABLED.
Return values
0Successfully changed the Private GATT Proxy feature state.
-ENOTSUPThe Private GATT Proxy feature is not supported.
-EINVALInvalid parameter.
-EALREADYAlready in the given state.

◆ bt_mesh_relay_get()

enum bt_mesh_feat_state bt_mesh_relay_get ( void )

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

Get the current Relay feature state.

Returns
The Relay feature state.

◆ bt_mesh_relay_retransmit_get()

uint8_t bt_mesh_relay_retransmit_get ( void )

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

Get the current Relay Retransmit parameters.

The BT_MESH_TRANSMIT_COUNT and BT_MESH_TRANSMIT_INT macros can be used to decode the Relay Retransmit parameters.

Returns
The current Relay Retransmit parameters, or 0 if relay is not supported.

◆ bt_mesh_relay_set()

int bt_mesh_relay_set ( enum bt_mesh_feat_state relay,
uint8_t xmit )

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

Configure the Relay feature.

Enable or disable the Relay feature, and configure the parameters to transmit relayed messages with.

Support for the Relay feature must be enabled through the CONFIG_BT_MESH_RELAY configuration option.

See also
BT_MESH_TRANSMIT
Parameters
relayNew Relay feature state. Must be one of BT_MESH_FEATURE_ENABLED and BT_MESH_FEATURE_DISABLED.
xmitNew Relay retransmit parameters. Use BT_MESH_TRANSMIT for encoding.
Return values
0Successfully changed the Relay configuration.
-ENOTSUPThe Relay feature is not supported.
-EINVALInvalid parameter.
-EALREADYAlready using the given parameters.