Bluetooth Mesh Features#

Optional networking or energy features may also be implemented in a Bluetooth Mesh application. The Bluetooth Mesh profile specification refers to those simply as features. There are four Bluetooth Mesh features: Proxy, Relay, Friends, and Low Power nodes. This section describes all four.

Note: These features are specific to nodes, that is, devices in a Bluetooth Mesh network. The provisioner of a network is not subject to features support.

Proxy#

The Proxy feature allows a node to receive and transmit Bluetooth Mesh messages between GATT and advertising bearers. The proxy feature is used to forward Network packets received by a node between GATT bearer and advertising bearers. This feature is optional and can be enabled/disabled at runtime. When this feature is enabled, the corresponding GATT Proxy service must be exposed.

The proxy feature defines two roles, the proxy client and the server. The proxy server is a node that supports both the GATT bearer and the advertising bearer. In practice, the proxy client is a node that supports only the GATT bearer.

For a proxy feature to run, the corresponding proxy routine class must be part of the stack initialization table. The following code snippet gives a proxy server example.

static const struct sli_bgapi_class * const btmesh_class_table[] =
{
  SL_BTMESH_BGAPI_CLASS(health_server),
  SL_BTMESH_BGAPI_CLASS(proxy),
  SL_BTMESH_BGAPI_CLASS(proxy_server),
  SL_BTMESH_BGAPI_CLASS(node),
  NULL
};

Relay#

The Relay feature allows a node to receive and retransmit Bluetooth Mesh messages over the advertising bearer to enable larger networks.

The provisioner can enable the relay feature on a particular node (if supported) via the following routine:

sl_status_t sl_btmesh_config_client_set_relay(uint16_t enc_netkey_index,
                                              uint16_t node_address,
                                              uint8_t  value,
                                              uint8_t  retransmit_count,
                                              uint16_t retransmit_interval_ms,
                                              uint32_t * handle)

A getter function is also available. For more details, refer to the Bluetooth Mesh Configuration Client section of the API html documentation.

Note: In large networks, it is in general a good practice to limit the number of nodes supporting the relay feature. Otherwise, the data traffic can increase very rapidly to undesired levels.

Friend#

The Friend feature allows a node to help a node supporting the Low Power feature to operate by storing messages destined for that node. Friendship is used by Low Power Nodes to limit the amount of time that they need to listen.

The application code for nodes supporting that feature need to enable it using:

  • sl_status_t sl_btmesh_friend_init(void) for enabling the feature.

  • sl_status_t sl_btmesh_friend_deinit(void) for disabling the feature.

For more information, refer to the HTML API Reference delivered with the SDK.

Low Power Node#

The Low Power Node (LPN) feature allows a node to operate within a Bluetooth Mesh network at significantly reduced receiver duty cycles, only in conjunction with a node supporting the Friend feature.

Similarly to the Friend feature, the application code for nodes supporting the Low Power Node feature needs to enable it:

  • sl_status_t sl_btmesh_lpn_init(void)

  • sl_status_t sl_btmesh_lpn_deinit(void)

When the feature has been enabled on a node, and if a node offering friendship is within radio range, the friendship can be established and terminated using the following routines with the associated network key index:

  • sl_status_t sl_btmesh_lpn_establish_friendship(uint16_t netkey_index)

  • sl_status_t sl_btmesh_lpn_terminate_friendship(uint16_t netkey_index)

The Silicon Labs Bluetooth Mesh API allows the user to configure the time interval at which the LPN will poll the friend as well as other time variables:

  • sl_status_t sl_status_t sl_btmesh_lpn_config(uint8_t setting_id, uint32_t value)

The following arrays describes the setting id enum used by the stack to aggregates the LPN configuration values (enum sl_btmesh_lpn_settings_t):

id enum

Value

Description

sl_btmesh_lpn_queue_length

(0x00)

Minimum queue length the friend must support in bytes. The value is rounded up to the nearest power of 2. Default is 2. Range is 2..128.

sl_btmesh_lpn_poll_timeout

(0x01)

Poll timeout in milliseconds, which is the longest time that LPN sleeps in between querying its friend for queued messages. Default is 50 ms. The value is rounded to the nearest multiple of 100 ms. The range is 1 s to 95 h 59 min 59 s 900 ms.

sl_btmesh_lpn_receive_delay

(0x02)

Receive delay in milliseconds. Receive delay is the time between the LPN sending a request and listening for a response. Receive delay allows the friend node time to prepare the message and the LPN to sleep. Range: 10 ms to 255 ms. The default receive delay is 10 ms. The default value is 10.

sl_btmesh_lpn_request_retries

(0x03)

Request retry is the number of retry attempts to repeat, for example, how many times to repeat the friend poll message if the friend update was not received by the LPN. Range is from 0 to 10. The default value is 6 (initial attempt plus 5 retries).

sl_btmesh_lpn_retry_interval

(0x04)

Time interval between retry attempts in milliseconds. Range is 0 to 100 ms. The default value is 100 ms.

Additionally, a friend poll request can be sent from the LPN at any time using the flowing routine with the appropriate network key index:

sl_status_t sl_btmesh_lpn_poll(uint16_t netkey_index)

However, it is not required for correct operation, because the procedure will be performed automatically before the poll timeout expires.

For more information on the friend and LPN API, refer to the HTML API documentation.

sl_btmesh_dcd.c

From a practical standpoint, the device composition data of each node contains a 2-byte field indicating the supported features. The following array illustrates the features field:

Bit

Feature

Notes

0

Relay

Relay feature supported if set to 1. 0 otherwise.

1

Proxy

Proxy feature supported if set to 1. 0 otherwise.

2

Friend

Friend feature supported if set to 1. 0 otherwise.

3

Low Power Node (LPN)

LPN feature supported if set to 1. 0 otherwise.

4 - 15

Reserved for future use.

Reserved for future use.

As mentioned in section Bluetooth Mesh Device Composition Data, each node, after provisioning, sends its composition data page 0 to the provisioner. In the code example presented in that section, the macro SL_BTMESH_FEATURE_BITMASK is used with the default value of 3:

#define SL_BTMESH_FEATURE_BITMASK 3

In this example, that macro enables the relay and proxy features (3) in the Bluetooth Mesh stack. This is the default setting.