Chapter 2. API Reference
• ESP_OK : Success
• ESP_FAIL : Failure
Parameters
• [in] ep_name: unique name of the endpoint
esp_err_t wifi_prov_mgr_endpoint_register(const char *ep_name, proto-
comm_req_handler_t handler, void *user_ctx)
Register a handler for the previously created endpoint.
This API can be called by the application to register a protocomm handler to any endpoint that was created
using wifi_prov_mgr_endpoint_create().
Note This API can only be called AFTER provisioning has 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
• ESP_OK : Success
• ESP_FAIL : Failure
Parameters
• [in] ep_name: Name of the endpoint
• [in] handler: Endpoint handler function
• [in] user_ctx: User data
void wifi_prov_mgr_endpoint_unregister(const char *ep_name)
Unregister the handler for an endpoint.
This API can be called if the application wants to selectively unregister the handler of an endpoint while the
provisioning is still in progress.
All the endpoint handlers are unregistered automatically when the provisioning stops.
Parameters
• [in] ep_name: Name of the endpoint
esp_err_t wifi_prov_mgr_event_handler(void *ctx, system_event_t *event)
Event handler for provisioning manager.
This is called from the main event handler and controls the provisioning manager’s internal state machine
depending on incoming Wi-Fi events
Note : This function is DEPRECATED, because events are now handled internally using the event loop library,
esp_event. Calling this will do nothing and simply return ESP_OK.
Return
• ESP_OK : Event handled successfully
Parameters
• [in] ctx: Event context data
• [in] event: Event info
esp_err_t wifi_prov_mgr_get_wifi_state(wifi_prov_sta_state_t *state)
Get state of Wi-Fi Station during provisioning.
Return
• ESP_OK : Successfully retrieved Wi-Fi state
• ESP_FAIL : Provisioning app not running
Parameters
• [out] state: Pointer to wifi_prov_sta_state_t variable to be filled
esp_err_t wifi_prov_mgr_get_wifi_disconnect_reason(wifi_prov_sta_fail_reason_t
*reason)
Get reason code in case of Wi-Fi station disconnection during provisioning.
Return
Espressif Systems 688
Submit Document Feedback
Release v4.4