Low Power Node#
Low Power component enables Bluetooth Mesh Low Power Node (LPN) Feature for the node. LPNs consume less power by remaining in sleep for the majority of their operation cycle, waking up to poll incoming messages from a Friend Node. LPN operation can be achieved only by having an established friendship. Numerous timing and queue parameters can be configured in Simplicity Studio, more details can be found on the configuration panel or in sl_btmesh_lpn_config.h. Several callback functions, which can be implemented in the application, are available for initialization and friendship related events. More details about the functions can be found in sl_btmesh_lpn.h. LPN functionality can be enabled or disabled during runtime via node configuration. This component is prepared for integration into SOC applications. This is a No-Code component.
Modules#
sl_btmesh_lpn_high_throughput_timer_s
Enumerations#
Operational modes for the high throughput timer.
Typedefs#
Handler structure for the high throughput timer.
Functions#
Enumeration Documentation#
sl_btmesh_lpn_high_throughput_operation_mode_t#
sl_btmesh_lpn_high_throughput_operation_mode_t
Operational modes for the high throughput timer.
Enumerator | |
---|---|
SL_BTMESH_LPN_HIGH_THROUGHPUT_NORMAL | Normal, periodic operation with the provided value. |
SL_BTMESH_LPN_HIGH_THROUGHPUT_SLOWING | Slows down over time, doubling its timeout after every expiration. |
Typedef Documentation#
sl_btmesh_lpn_high_throughput_timer_t#
typedef struct sl_btmesh_lpn_high_throughput_timer_s sl_btmesh_lpn_high_throughput_timer_t
Handler structure for the high throughput timer.
Function Documentation#
sl_btmesh_lpn_feature_init#
void sl_btmesh_lpn_feature_init (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Initialize LPN functionality. This function is called automatically by the LPN component.
sl_btmesh_lpn_feature_deinit#
void sl_btmesh_lpn_feature_deinit (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Deinitialize LPN functionality. This function is called automatically by the LPN component.
sl_btmesh_lpn_is_friendship_active#
bool sl_btmesh_lpn_is_friendship_active (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Return if the friendship is active between LPN and friend node
Returns
Friendship active state
Return values
true: If friendship is active with a friend node
false: If friendship is not established with any friend node
sl_btmesh_lpn_poll_request#
sl_status_t sl_btmesh_lpn_poll_request (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
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.
sl_btmesh_lpn_on_event#
void sl_btmesh_lpn_on_event (sl_btmesh_msg_t * pEvt)
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_btmesh_msg_t * | [in] | pEvt | Pointer to incoming lpn event. |
Handling of mesh lpn events.
sl_btmesh_lpn_high_throughput_register#
sl_status_t sl_btmesh_lpn_high_throughput_register (sl_btmesh_lpn_high_throughput_timer_t * handle, uint32_t timeout, sl_btmesh_lpn_high_throughput_operation_mode_t mode)
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_btmesh_lpn_high_throughput_timer_t * | [in] | handle | Pointer to the handler of the high throughput timer structure, provided by the user |
uint32_t | [in] | timeout | The timeout of this timer, in milliseconds |
sl_btmesh_lpn_high_throughput_operation_mode_t | [in] | mode | The mode of operation |
Registers high throughput request
Returns
Status code
Return values
SL_STATUS_OK: Timer successfully registered
SL_STATUS_ALREADY_EXISTS: Timer is already present, list unchanged
sl_btmesh_lpn_high_throughput_unregister#
sl_status_t sl_btmesh_lpn_high_throughput_unregister (sl_btmesh_lpn_high_throughput_timer_t * handle)
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_btmesh_lpn_high_throughput_timer_t * | [in] | handle | Pointer to the handler to be unregistered |
Unregisters high throughput request
Note
Will not stop the already running timer if it belongs to the handler passed.
Returns
Status code
Return values
SL_STATUS_OK: Timer successfully unregistered
SL_STATUS_ALREADY_EXISTS: Timer was not present in the list
sl_btmesh_lpn_on_init#
void sl_btmesh_lpn_on_init (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Called when the Low Power Node is initialized.
This is a callback which can be implemented in the application. Note
Do not call blocking api from here as during this call the btmesh resource guard is being used and it can lead to undefined behaviour. If no implementation is provided in the application, then the default weak implementation will be an empty function.
sl_btmesh_lpn_on_deinit#
void sl_btmesh_lpn_on_deinit (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Called when the Low Power Node is deinitialized.
This is a callback which can be implemented in the application. Note
Do not call blocking api from here as during this call the btmesh resource guard is being used and it can lead to undefined behaviour. If no implementation is provided in the application, then the default weak implementation will be an empty function.
sl_btmesh_lpn_on_friendship_established#
void sl_btmesh_lpn_on_friendship_established (uint16_t friend_address)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | friend_address | Node address of the new friend |
Called when the Low Power Node establishes friendship with another node
This is a callback which can be implemented in the application. Note
If no implementation is provided in the application, then the default weak implementation will be an empty function.
sl_btmesh_lpn_on_friendship_failed#
void sl_btmesh_lpn_on_friendship_failed (uint16_t reason)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | reason | Reason for friendship establishment failure |
Called when the friendship establishment attempt of Low Power Node fails
This is a callback which can be implemented in the application. Note
If no implementation is provided in the application, then the default weak implementation will be an empty function.
sl_btmesh_lpn_on_friendship_terminated#
void sl_btmesh_lpn_on_friendship_terminated (uint16_t reason)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | reason | Reason for friendship termination |
Called when friendship that was successfully established has been terminated
This is a callback which can be implemented in the application. Note
If no implementation is provided in the application, then the default weak implementation will be an empty function.