![]() |
nRF Connect SDK API 3.3.99
|
#include <include/net/nrf_provisioning.h>
nrf_provisioning callback events
These events are passed to the registered callback function to inform the application about the current state of the provisioning process. Events are generated asynchronously as the provisioning state machine progresses through different phases.
| Enumerator | |
|---|---|
| NRF_PROVISIONING_EVENT_START | Provisioning process started. Client will connect to the provisioning service. |
| NRF_PROVISIONING_EVENT_STOP | Provisioning process stopped. All provisioning commands (if any) executed successfully. |
| NRF_PROVISIONING_EVENT_DONE | Provisioning complete. "Finished" command received from the provisioning service. Device is now fully provisioned. |
| NRF_PROVISIONING_EVENT_FAILED | Provisioning process failed, retry recommended. If CONFIG_NRF_PROVISIONING_SCHEDULED is enabled, the provisioning will be automatically rescheduled with exponential backoff up to a maximum interval. |
| NRF_PROVISIONING_EVENT_NO_COMMANDS | Provisioning process completed, but no commands were received from the server. This may indicate the device is already fully provisioned. |
| NRF_PROVISIONING_EVENT_FAILED_TOO_MANY_COMMANDS | Provisioning process failed due to too many commands for the device to handle. Increase CONFIG_NRF_PROVISIONING_CBOR_RECORDS to allow more commands. It also might be needed to increase heap size to allocate the larger number of commands. |
| NRF_PROVISIONING_EVENT_FAILED_DEVICE_NOT_CLAIMED | Provisioning process failed because the device is not claimed on the provisioning service. The device must be claimed using the attestation token before provisioning can succeed. The event carries a pointer to the modem's attestation token in the 'token' field and is only provided if CONFIG_NRF_PROVISIONING_PROVIDE_ATTESTATION_TOKEN is enabled. The token pointer is valid only during the callback execution and should not be stored. |
| NRF_PROVISIONING_EVENT_FAILED_WRONG_ROOT_CA | Provisioning process failed due to incorrect CA certificate configuration. Verify the root CA certificate matches the provisioning service. |
| NRF_PROVISIONING_EVENT_FAILED_NO_VALID_DATETIME | Provisioning process failed because no valid modem/network time is available. Ensure the modem has acquired network time. |
| NRF_PROVISIONING_EVENT_NEED_LTE_DEACTIVATED | Credential handling requires LTE to be deactivated. Application should call lte_lc_offline(), conn_mgr_all_if_disconnect(), or similar to deactivate LTE connectivity. This event is generated when the library needs to write certificates or credentials to the modem, which requires the LTE connection to be offline. Note that conn_mgr_all_if_disconnect() disconnects only LTE connectivity, meaning that if enabled, GNSS remains active. If the modem's functional mode is LTE_LC_FUNC_MODE_ACTIVATE_GNSS, GNSS must also be deactivated by setting the functional mode to LTE_LC_FUNC_MODE_DEACTIVATE_GNSS. The application should check the current functional mode and ensure both LTE and GNSS are disabled for successful credential operations. |
| NRF_PROVISIONING_EVENT_NEED_LTE_ACTIVATED | Credential handling complete, LTE can be reactivated. Application should call lte_lc_connect() or similar to restore LTE connectivity. This event is generated after certificate/credential operations are completed. |
| NRF_PROVISIONING_EVENT_SCHEDULED_PROVISIONING | Next provisioning attempt has been scheduled. The event carries the time until the next provisioning attempt in seconds in the 'next_attempt_time_seconds' field. This event is only provided if CONFIG_NRF_PROVISIONING_SCHEDULED is enabled. |
| NRF_PROVISIONING_EVENT_FATAL_ERROR | A fatal unrecoverable error occurred during provisioning. Manual intervention or device reset may be required. |