nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ nrf_provisioning_init()

int nrf_provisioning_init ( nrf_provisioning_event_cb_t callback_handler)

#include <include/net/nrf_provisioning.h>

Initialize the provisioning library and registers a callback handler.

This function must be called before any other provisioning API functions. It sets up the necessary resources and registers the callback for receiving provisioning events. The initialization process includes:

  • Setting up work queues for asynchronous operations
  • Initializing transport layer (HTTP or CoAP based on configuration)
  • Registering Zephyr NET MGMT handlers
  • Starting provisioning if CONFIG_NRF_PROVISIONING_AUTO_START_ON_INIT is enabled
Note
Initialization work is performed asynchronously. The function returns immediately after basic setup, while settings initialization continue in the background. Monitor callback events for initialization progress.
Parameters
callback_handlerPointer to a callback function to receive provisioning notifications. The callback will be called from a work queue context. Must not be NULL.
Return values
0on success.
-EINVALif callback_handler is NULL.
-EALREADYif the library is already initialized.