This guide describes the migration process from nRF5 SDK for Mesh version 1.0.1 to version 2.0.0.
In v1.0.1, the nrf_mesh_sdk
and nrf_mesh_node_config
modules could both be used for initializing a mesh device, and they had partly overlapping functionality. They have now been replaced by a single set of non overlapping modules:
mesh_stack
: Functions for initializing and starting all mesh stack modules, including the foundation models.mesh_softdevice_init
: Function for initializing the SoftDevice.mesh_provisionee
: Simple provisionee support module containing the provisioning related parts of the old nrf_mesh_node_config
, using PB-ADV and static OOB authentication. It is mainly intended to be used by the nRF5 SDK for Mesh examples, but it can also be used as a starting point for provisioning in a user application.The initialization code of the examples has now been restructured into an initialization phase and a start phase, following the same pattern as the nRF5 SDK examples. We strongly advise user applications to do the same. We have also added an execution_start()
function to avoid the risk of race conditions during the start phase.
Following the same pattern as the nRF5 SDK, weak implementations of app_error_fault_handler
(in examples/common/src/app_error_weak.c
) and mesh_assertion_handler
(in examples/common/src/assertion_handler_weak.c
) have been provided. Instead of installing error handlers as callbacks, these functions are now used directly by the nRF5 SDK for Mesh error handling. They can be overloaded by the user application if needed.
Files from the nRF5 SDK are no longer included as part of the nRF5 SDK for Mesh release. Instead, the user is supposed to download the nRF5 SDK separately and provide a link to the nRF5 SDK folder when building the mesh code. See Retrieve nRF SDK for more details.
These are API changes that will break an existing application if ignored.
access_message_tx_t
has two new fields: force_segmented
and transmic_size
.access_message_rx_t
now reports richer low-level metadata for incoming packets, replacing meta_data.timestamp
and meta_data.rssi
with a pointer to a nrf_mesh_rx_metadata_t
structure.access_reliable_status_t
: New enum value ACCESS_RELIABLE_TRANSFER_CANCELLED
.dsm_beacon_secmat_get()
renamed to dsm_beacon_info_get()
, and type of last parameter has changed from nrf_mesh_beacon_secmat_t
to nrf_mesh_beacon_info_t
.nrf_mesh_init_params_t
(now included in mesh_stack_init_params_t
): assertion_handler
field removed, p_uuid
field added.nrf_mesh_sar_session_cancel_reason_t
(included in nrf_mesh_evt_t
): New enum value NRF_MESH_SAR_CANCEL_PEER_STARTED_ANOTHER_SESSION
.nrf_mesh_prov_listen()
: bearer_type
parameter changed to bearer_types
, which is a bitfield for the supported bearers. That means that if multiple bearers are supported, you can listen for incoming provisioning requests on all of them at the same time.nrf_mesh_prov_evt_complete_t
: Contains a pointer to a nrf_mesh_prov_provisioning_data_t
structure now instead of a copy of the provisioning data.config_client_event_type_t
: New enum value CONFIG_CLIENT_EVENT_TYPE_CANCELLED
.config_client_composition_data_get()
: Parameter page_number
added.health_client_evt_type_t
: New enum value HEALTH_CLIENT_EVT_TYPE_CANCELLED
.simple_on_off_status_t
: New enum value SIMPLE_ON_OFF_STATUS_CANCELLED
.mesh/app
folder to the examples/templates
folder.These changes are API additions that will not break an existing application if ignored.
dsm_appkey_handle_to_subnet_handle()
function added.nrf_mesh_subnet_added()
function added.nrf_mesh_evt_t
/ nrf_mesh_evt_type_t
: New event types NRF_MESH_EVT_NET_BEACON_RECEIVED
and NRF_MESH_EVT_FLASH_STABLE
.nrf_mesh_evt_iv_update_notification_t
: p_network_id
field added.nrf_mesh_evt_key_refresh_notification_t
: p_network_id
field added.config_client_pending_msg_cancel()
function added.health_client_pending_msg_cancel()
function added.simple_on_off_client_t
: New field timeout_cb
added.simple_on_off_client_pending_msg_cancel()
function added.simple_on_off_server_status_publish()
function added.access_model_publication_stop()
function added.access_model_publication_by_appkey_stop()
function added.