Bluetooth Mesh Low Power Node API#

Bluetooth Mesh Low Power Node API.

These commands and events are for low-power operation, available in nodes which have the LPN feature.

Modules#

sl_btmesh_evt_lpn_friendship_established

sl_btmesh_evt_lpn_friendship_failed

sl_btmesh_evt_lpn_friendship_terminated

Enumerations#

enum
sl_btmesh_lpn_queue_length = 0x0
sl_btmesh_lpn_poll_timeout = 0x1
sl_btmesh_lpn_receive_delay = 0x2
sl_btmesh_lpn_request_retries = 0x3
sl_btmesh_lpn_retry_interval = 0x4
sl_btmesh_lpn_clock_accuracy = 0x5
}

Key values to identify LPN configurations.

Functions#

sl_status_t
sl_status_t
sl_btmesh_lpn_establish_friendship(uint16_t netkey_index)
sl_status_t
sl_btmesh_lpn_poll(uint16_t netkey_index)
sl_status_t
sl_btmesh_lpn_terminate_friendship(uint16_t netkey_index)
sl_status_t
sl_btmesh_lpn_config(uint8_t setting_id, uint32_t value)

Enumeration Documentation#

sl_btmesh_lpn_settings_t#

sl_btmesh_lpn_settings_t

Key values to identify LPN configurations.

Enumerator
sl_btmesh_lpn_queue_length

(0x0) Minimum queue length that the friend must support. Choose an appropriate length based on the expected message frequency and LPN sleep period because messages that do not fit into the friend queue are dropped. Note that the given value is rounded up to the nearest power of 2. Range: 2..128

sl_btmesh_lpn_poll_timeout

(0x1) Poll timeout in milliseconds, which is the longest time that LPN sleeps in between querying its friend for queued messages. Long poll timeout allows the LPN to sleep for longer periods, at the expense of increased latency for receiving messages. Note that the given value is rounded up to the nearest 100 ms Range: 1 s to 95 h 59 min 59 s 900 ms

sl_btmesh_lpn_receive_delay

(0x2) 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 LPN to sleep. Range: 10 ms to 255 ms The default receive delay in 10 ms.

sl_btmesh_lpn_request_retries

(0x3) Request retry is the number of retry attempts to repeat e.g., the friend poll message if the friend update was not received by the LPN. Range is from 0 to 10, default is 3

sl_btmesh_lpn_retry_interval

(0x4) Time interval between retry attempts in milliseconds. Range is 0 to 100 ms.

sl_btmesh_lpn_clock_accuracy

(0x5) Clock accuracy in ppm, which will be taken into account when opening and closing the receive window, and determining the poll timeout. Should be used with care, because inaccurate clock can increase the receive window lenght to up to 2,5 times in some cases. Default value is 0.


Definition at line 7574 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

Function Documentation#

sl_btmesh_lpn_init#

sl_status_t sl_btmesh_lpn_init ()

Initialize the Low Power node (LPN) mode. The node needs to be provisioned before calling this command. After the LPN mode is initialized, the node can't operate in the network without a Friend node. To establish a friendship with a nearby Friend node, use the sl_btmesh_lpn_establish_friendship command. Make this call before calling the other commands in this class.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 7706 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lpn_deinit#

sl_status_t sl_btmesh_lpn_deinit ()

Deinitialize the LPN functionality. After calling this command, a possible friendship with a Friend node is terminated and the node can operate in the network independently. After calling this command, do not call any other command in this class before the Low Power mode is sl_btmesh_lpn_init again.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 7720 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lpn_establish_friendship#

sl_status_t sl_btmesh_lpn_establish_friendship (uint16_t netkey_index)
Parameters
[in]netkey_index

Network key index used in friendship request

Establish a friendship. After a friendship has been established, the node can start saving power.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


Definition at line 7736 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lpn_poll#

sl_status_t sl_btmesh_lpn_poll (uint16_t netkey_index)
Parameters
[in]netkey_index

Network key index used in poll

Poll the Friend node for stored messages and security updates. This command may be used if the application is expecting to receive messages at a specific time. However, it is not required for correct operation, because the procedure will be performed autonomously before the poll timeout expires.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 7750 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lpn_terminate_friendship#

sl_status_t sl_btmesh_lpn_terminate_friendship (uint16_t netkey_index)
Parameters
[in]netkey_index

Network key index used in friendship request

Terminate an already established friendship. sl_btmesh_evt_lpn_friendship_terminated event will be emitted when the friendship termination has been completed.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


Definition at line 7766 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lpn_config#

sl_status_t sl_btmesh_lpn_config (uint8_t setting_id, uint32_t value)
Parameters
[in]setting_id

Enum sl_btmesh_lpn_settings_t. Identifies the LPN setting to be updated.

[in]value

New value for the given setting

Configure the parameters for friendship establishment and LPN behavior.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 7779 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

Macro Definition Documentation#

sl_btmesh_cmd_lpn_init_id#

#define sl_btmesh_cmd_lpn_init_id
Value:
0x00230028

Definition at line 7558 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lpn_deinit_id#

#define sl_btmesh_cmd_lpn_deinit_id
Value:
0x01230028

Definition at line 7559 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lpn_establish_friendship_id#

#define sl_btmesh_cmd_lpn_establish_friendship_id
Value:
0x03230028

Definition at line 7560 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lpn_poll_id#

#define sl_btmesh_cmd_lpn_poll_id
Value:
0x04230028

Definition at line 7561 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lpn_terminate_friendship_id#

#define sl_btmesh_cmd_lpn_terminate_friendship_id
Value:
0x05230028

Definition at line 7562 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lpn_config_id#

#define sl_btmesh_cmd_lpn_config_id
Value:
0x06230028

Definition at line 7563 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lpn_init_id#

#define sl_btmesh_rsp_lpn_init_id
Value:
0x00230028

Definition at line 7564 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lpn_deinit_id#

#define sl_btmesh_rsp_lpn_deinit_id
Value:
0x01230028

Definition at line 7565 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lpn_establish_friendship_id#

#define sl_btmesh_rsp_lpn_establish_friendship_id
Value:
0x03230028

Definition at line 7566 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lpn_poll_id#

#define sl_btmesh_rsp_lpn_poll_id
Value:
0x04230028

Definition at line 7567 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lpn_terminate_friendship_id#

#define sl_btmesh_rsp_lpn_terminate_friendship_id
Value:
0x05230028

Definition at line 7568 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lpn_config_id#

#define sl_btmesh_rsp_lpn_config_id
Value:
0x06230028

Definition at line 7569 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h