Chapter 2. API Reference
Calling this API will block until provisioning service is stopped i.e. till event WIFI_PROV_END is emitted.
This will not block if provisioning is not started or not initialized.
esp_err_t wifi_prov_mgr_disable_auto_stop(uint32_t cleanup_delay)
Disable auto stopping of provisioning service upon completion.
By default, once provisioning is complete, the provisioning service is automatically stopped, and all endpoints
(along with those registered by main application) are deactivated.
This API is useful in the case when main application wishes to close provisioning service only after it receives
some protocomm command from the client side app. For example, after connecting to Wi-Fi, the device may
want to connect to the cloud, and only once that is successfully, the device is said to be fully configured. But,
then it is upto the main application to explicitly call wifi_prov_mgr_stop_provisioning() later when the device
is fully configured and the provisioning service is no longer required.
Note This must be called before executing wifi_prov_mgr_start_provisioning()
Return
• ESP_OK : Success
• ESP_ERR_INVALID_STATE : Manager not initialized or provisioning service already started
Parameters
• [in] cleanup_delay: Sets the delay after which the actual cleanup of transport related re-
sources is done after a call to wifi_prov_mgr_stop_provisioning() returns. Minimum allowed value
is 100ms. If not specified, this will default to 1000ms.
esp_err_t wifi_prov_mgr_set_app_info(const char *label, const char *version, const char
**capabilities, size_t total_capabilities)
Set application version and capabilities in the JSON data returned by proto-ver endpoint.
This function can be called multiple times, to specify information about the various application specific services
running on the device, identified by unique labels.
The provisioning service itself registers an entry in the JSON data, by the label “prov”, containing only
provisioning service version and capabilities. Application services should use a label other than “prov”so as
not to overwrite this.
Note This must be called before executing wifi_prov_mgr_start_provisioning()
Return
• ESP_OK : Success
• ESP_ERR_INVALID_STATE : Manager not initialized or provisioning service already started
• ESP_ERR_NO_MEM : Failed to allocate memory for version string
• ESP_ERR_INVALID_ARG : Null argument
Parameters
• [in] label: String indicating the application name.
• [in] version: String indicating the application version. There is no constraint on format.
• [in] capabilities: Array of strings with capabilities. These could be used by the client side
app to know the application registered endpoint capabilities
• [in] total_capabilities: Size of capabilities array
esp_err_t wifi_prov_mgr_endpoint_create(const char *ep_name)
Create an additional endpoint and allocate internal resources for it.
This API is to be called by the application if it wants to create an additional endpoint. All additional endpoints
will be assigned UUIDs starting from 0xFF54 and so on in the order of execution.
protocomm handler for the created endpoint is to be registered later using wifi_prov_mgr_endpoint_register()
after provisioning has started.
Note This API can only be called BEFORE provisioning is started
Note Additional endpoints can be used for configuring client provided parameters other than Wi-Fi credentials,
that are necessary for the main application and hence must be set prior to starting the application
Note After session establishment, the additional endpoints must be targeted first by the client side application
before sending Wi-Fi configuration, because once Wi-Fi configuration finishes the provisioning service
is stopped and hence all endpoints are unregistered
Return
Espressif Systems 687
Submit Document Feedback
Release v4.4