nRF5 SDK for Mesh v5.0.0
Data Structures | Typedefs | Enumerations | Functions
Mesh events

Runtime events in the core mesh. More...

Data Structures

struct  nrf_mesh_evt_message_t
 Message received event structure. More...
 
struct  nrf_mesh_evt_iv_update_notification_t
 IV update event structure. More...
 
struct  nrf_mesh_evt_key_refresh_notification_t
 Key refresh notification structure. More...
 
struct  nrf_mesh_evt_net_beacon_received_t
 Network beacon received structure. More...
 
struct  nrf_mesh_evt_hb_message_t
 Heartbeat received event structure. More...
 
struct  nrf_mesh_evt_hb_subscription_change_t
 Parameters for changes to the heartbeat subscription state. More...
 
struct  nrf_mesh_evt_tx_complete_t
 Transmission complete event structure. More...
 
union  nrf_mesh_evt_dfu_t
 DFU event parameters. More...
 
struct  nrf_mesh_evt_rx_failed_t
 RX failed event structure. More...
 
struct  nrf_mesh_evt_sar_failed_t
 SAR failed event structure. More...
 
struct  nrf_mesh_evt_flash_failed_t
 
struct  nrf_mesh_evt_config_storage_failure_t
 
struct  nrf_mesh_evt_config_load_failure_t
 
struct  nrf_mesh_evt_lpn_friend_offer_t
 
struct  nrf_mesh_evt_lpn_friend_update_t
 
struct  nrf_mesh_evt_friendship_established_t
 
struct  nrf_mesh_evt_friendship_terminated_t
 
struct  nrf_mesh_evt_friend_request_t
 
struct  nrf_mesh_evt_t
 Mesh event structure. More...
 
struct  nrf_mesh_evt_handler_t
 Mesh event handler context structure. More...
 

Typedefs

typedef void(* nrf_mesh_evt_handler_cb_t) (const nrf_mesh_evt_t *p_evt)
 Mesh event handler callback type. More...
 

Enumerations

enum  nrf_mesh_evt_type_t {
  NRF_MESH_EVT_MESSAGE_RECEIVED, NRF_MESH_EVT_TX_COMPLETE, NRF_MESH_EVT_IV_UPDATE_NOTIFICATION, NRF_MESH_EVT_KEY_REFRESH_NOTIFICATION,
  NRF_MESH_EVT_NET_BEACON_RECEIVED, NRF_MESH_EVT_HB_MESSAGE_RECEIVED, NRF_MESH_EVT_HB_SUBSCRIPTION_CHANGE, NRF_MESH_EVT_DFU_REQ_RELAY,
  NRF_MESH_EVT_DFU_REQ_SOURCE, NRF_MESH_EVT_DFU_START, NRF_MESH_EVT_DFU_END, NRF_MESH_EVT_DFU_BANK_AVAILABLE,
  NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED, NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH, NRF_MESH_EVT_FLASH_STABLE, NRF_MESH_EVT_RX_FAILED,
  NRF_MESH_EVT_SAR_FAILED, NRF_MESH_EVT_FLASH_FAILED, NRF_MESH_EVT_CONFIG_STABLE, NRF_MESH_EVT_CONFIG_STORAGE_FAILURE,
  NRF_MESH_EVT_CONFIG_LOAD_FAILURE, NRF_MESH_EVT_LPN_FRIEND_OFFER, NRF_MESH_EVT_LPN_FRIEND_UPDATE, NRF_MESH_EVT_LPN_FRIEND_REQUEST_TIMEOUT,
  NRF_MESH_EVT_LPN_FRIEND_POLL_COMPLETE, NRF_MESH_EVT_FRIENDSHIP_ESTABLISHED, NRF_MESH_EVT_FRIENDSHIP_TERMINATED, NRF_MESH_EVT_PROXY_STOPPED,
  NRF_MESH_EVT_DISABLED, NRF_MESH_EVT_ENABLED, NRF_MESH_EVT_FRIEND_REQUEST, NRF_MESH_EVT_READY_TO_POWER_OFF
}
 Mesh event types. More...
 
enum  nrf_mesh_rx_failed_reason_t { NRF_MESH_RX_FAILED_REASON_REPLAY_CACHE_FULL }
 RX failure reason codes. More...
 
enum  nrf_mesh_sar_session_cancel_reason_t {
  NRF_MESH_SAR_CANCEL_REASON_TIMEOUT, NRF_MESH_SAR_CANCEL_REASON_RETRY_OVER, NRF_MESH_SAR_CANCEL_REASON_NO_MEM, NRF_MESH_SAR_CANCEL_BY_PEER,
  NRF_MESH_SAR_CANCEL_REASON_INVALID_FORMAT, NRF_MESH_SAR_CANCEL_PEER_STARTED_ANOTHER_SESSION, NRF_MESH_SAR_CANCEL_REASON_FRIENDSHIP_TERMINATED, NRF_MESH_SAR_CANCEL_REASON_FRIENDSHIP_ESTABLISHED,
  NRF_MESH_SAR_CANCEL_REASON_LPN_RX_NOT_COMPLETE
}
 SAR session cancelled reason codes. More...
 
enum  nrf_mesh_flash_user_module_t { NRF_MESH_FLASH_USER_CORE, NRF_MESH_FLASH_USER_DEVICE_STATE_MANAGER, NRF_MESH_FLASH_USER_ACCESS }
 User tokens for the flash manager. More...
 
enum  nrf_mesh_friendship_role_t { NRF_MESH_FRIENDSHIP_ROLE_FRIEND, NRF_MESH_FRIENDSHIP_ROLE_LPN }
 Device role in the friendship. More...
 
enum  nrf_mesh_evt_friendship_terminated_reason_t {
  NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_LPN, NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_TIMEOUT, NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_NO_REPLY, NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_INTERNAL_TX_FAILED,
  NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_NEW_FRIEND_REQUEST, NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_USER, NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_NEW_FRIEND
}
 

Functions

void nrf_mesh_evt_handler_add (nrf_mesh_evt_handler_t *p_handler_params)
 Register an event handler to get events from the core stack. More...
 
void nrf_mesh_evt_handler_remove (nrf_mesh_evt_handler_t *p_handler_params)
 Remove an event handler. More...
 

Detailed Description

Runtime events in the core mesh.

Typedef Documentation

◆ nrf_mesh_evt_handler_cb_t

typedef void(* nrf_mesh_evt_handler_cb_t) (const nrf_mesh_evt_t *p_evt)

Mesh event handler callback type.

To forward mesh events to the application, register a callback of this type using the function nrf_mesh_evt_handler_add().

Parameters
[in]p_evtMesh event pointer.
See also
nrf_mesh_evt_handler_add()

Definition at line 529 of file nrf_mesh_events.h.

Enumeration Type Documentation

◆ nrf_mesh_evt_type_t

Mesh event types.

Enumerator
NRF_MESH_EVT_MESSAGE_RECEIVED 

A message is received.

NRF_MESH_EVT_TX_COMPLETE 

Transmission completed.

NRF_MESH_EVT_IV_UPDATE_NOTIFICATION 

An IV update event occurred.

NRF_MESH_EVT_KEY_REFRESH_NOTIFICATION 

A key refresh event occurred.

NRF_MESH_EVT_NET_BEACON_RECEIVED 

An authenticated network beacon is received.

NRF_MESH_EVT_HB_MESSAGE_RECEIVED 

A heartbeat message is received.

NRF_MESH_EVT_HB_SUBSCRIPTION_CHANGE 

The heartbeat subscription parameters changed.

NRF_MESH_EVT_DFU_REQ_RELAY 

DFU request for this node to be the relay of a transfer.

NRF_MESH_EVT_DFU_REQ_SOURCE 

DFU request for this node to be the source of a transfer.

NRF_MESH_EVT_DFU_START 

DFU transfer starts.

NRF_MESH_EVT_DFU_END 

DFU transfer ended.

NRF_MESH_EVT_DFU_BANK_AVAILABLE 

DFU bank available.

NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED 

The device firmware is outdated, according to a trusted source.

NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH 

The device firmware is outdated, according to an un-authenticated source.

NRF_MESH_EVT_FLASH_STABLE 

Flash operations queue is empty, and flash is stable.

There are no event parameters for this message.

NRF_MESH_EVT_RX_FAILED 

RX failed.

NRF_MESH_EVT_SAR_FAILED 

SAR session failed.

NRF_MESH_EVT_FLASH_FAILED 

Flash malfunctioned.

NRF_MESH_EVT_CONFIG_STABLE 

Mesh configuration persistent storage is stable.

NRF_MESH_EVT_CONFIG_STORAGE_FAILURE 

Mesh configuration persistent storage failed while storing.

NRF_MESH_EVT_CONFIG_LOAD_FAILURE 

Mesh configuration persistent storage failed while loading an entry.

NRF_MESH_EVT_LPN_FRIEND_OFFER 

The node received a Friend Offer.

NRF_MESH_EVT_LPN_FRIEND_UPDATE 

The node received a Friend Update.

NRF_MESH_EVT_LPN_FRIEND_REQUEST_TIMEOUT 

The Friend Request timed out.

NRF_MESH_EVT_LPN_FRIEND_POLL_COMPLETE 

The LPN successfully polled all data from the Friend node.

NRF_MESH_EVT_FRIENDSHIP_ESTABLISHED 

The friendship is successfully established.

NRF_MESH_EVT_FRIENDSHIP_TERMINATED 

The friendship is successfully terminated.

NRF_MESH_EVT_PROXY_STOPPED 

The mesh proxy server is stopped.

NRF_MESH_EVT_DISABLED 

The mesh has been disabled.

NRF_MESH_EVT_ENABLED 

The mesh has been enabled.

This event provides a suitable context and a starting point to begin calling the Mesh stack APIs after the stack is fully initialized.

NRF_MESH_EVT_FRIEND_REQUEST 

The node has received a Friend Request from an LPN.

Unless the friendship is actively terminated, the request is accepted automatically.

NRF_MESH_EVT_READY_TO_POWER_OFF 

The mesh stack completed and stopped all activities and ready to power off.

Definition at line 59 of file nrf_mesh_events.h.

◆ nrf_mesh_rx_failed_reason_t

RX failure reason codes.

Enumerator
NRF_MESH_RX_FAILED_REASON_REPLAY_CACHE_FULL 

The replay protection cache is full.

Definition at line 275 of file nrf_mesh_events.h.

◆ nrf_mesh_sar_session_cancel_reason_t

SAR session cancelled reason codes.

Enumerator
NRF_MESH_SAR_CANCEL_REASON_TIMEOUT 

The transport SAR session timed out.

NRF_MESH_SAR_CANCEL_REASON_RETRY_OVER 

The transport SAR session TX retry limit is exceeded.

NRF_MESH_SAR_CANCEL_REASON_NO_MEM 

There were not enough resources to process the transport SAR session.

NRF_MESH_SAR_CANCEL_BY_PEER 

The peer cancelled the SAR session.

NRF_MESH_SAR_CANCEL_REASON_INVALID_FORMAT 

The packet is malformed.

NRF_MESH_SAR_CANCEL_PEER_STARTED_ANOTHER_SESSION 

The peer started another SAR session.

NRF_MESH_SAR_CANCEL_REASON_FRIENDSHIP_TERMINATED 

The friendship was terminated and the ongoing RX could not continue.

NRF_MESH_SAR_CANCEL_REASON_FRIENDSHIP_ESTABLISHED 

The friendship was established and the ongoing RX could not continue.

NRF_MESH_SAR_CANCEL_REASON_LPN_RX_NOT_COMPLETE 

The LPN did not receive all segments before NRF_MESH_EVT_LPN_FRIEND_POLL_COMPLETE.

Definition at line 297 of file nrf_mesh_events.h.

◆ nrf_mesh_flash_user_module_t

User tokens for the flash manager.

Enumerator
NRF_MESH_FLASH_USER_CORE 

Mesh core flash user.

NRF_MESH_FLASH_USER_DEVICE_STATE_MANAGER 

Device state manager flash user.

NRF_MESH_FLASH_USER_ACCESS 

Access layer flash user.

Definition at line 333 of file nrf_mesh_events.h.

◆ nrf_mesh_friendship_role_t

Device role in the friendship.

Enumerator
NRF_MESH_FRIENDSHIP_ROLE_FRIEND 

Friend role.

NRF_MESH_FRIENDSHIP_ROLE_LPN 

Low Power node role.

Definition at line 411 of file nrf_mesh_events.h.

◆ nrf_mesh_evt_friendship_terminated_reason_t

Enumerator
NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_LPN 

The Low Power node actively terminated the friendship.

NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_TIMEOUT 

There was no response from the LPN within the Poll Timeout.

NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_NO_REPLY 

The Friend node did not reply to the (repeated) Friend Poll.

NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_INTERNAL_TX_FAILED 

The Low Power node was not able to send transport command due to internal fault.

NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_NEW_FRIEND_REQUEST 

A new Friend Request was received from an LPN.

NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_USER 

The friendship was terminated through the API.

NRF_MESH_EVT_FRIENDSHIP_TERMINATED_REASON_NEW_FRIEND 

The LPN established a friendship with a different Friend.

Definition at line 429 of file nrf_mesh_events.h.

Function Documentation

◆ nrf_mesh_evt_handler_add()

void nrf_mesh_evt_handler_add ( nrf_mesh_evt_handler_t p_handler_params)

Register an event handler to get events from the core stack.

Parameters
[in,out]p_handler_paramsEvent handler parameters.

◆ nrf_mesh_evt_handler_remove()

void nrf_mesh_evt_handler_remove ( nrf_mesh_evt_handler_t p_handler_params)

Remove an event handler.

Parameters
[in,out]p_handler_paramsEvent handler parameters.

Documentation feedback | Developer Zone | Subscribe | Updated