wifi_prov_mgr_start_provisioning() function
Start provisioning service This starts the provisioning service according to the scheme configured at the time of initialization. For scheme : - wifi_prov_scheme_ble : This starts protocomm_ble, which internally initializes BLE transport and starts GATT server for handling provisioning requests - wifi_prov_scheme_softap : This activates SoftAP mode of Wi-Fi and starts protocomm_httpd, which internally starts an HTTP server for handling provisioning requests (If mDNS is active it also starts advertising service with type _esp_wifi_prov._tcp) Event WIFI_PROV_START is emitted right after provisioning starts without failure
Arguments
security
Specify which protocomm security scheme to use : - WIFI_PROV_SECURITY_0 : For no security - WIFI_PROV_SECURITY_1 : x25519 secure handshake for session establishment followed by AES-CTR encryption of provisioning messages - WIFI_PROV_SECURITY_2: SRP6a based authentication and key exchange followed by AES-GCM encryption/decryption of provisioning messages
wifi_prov_sec_params
Pointer to security params (NULL if not needed). This is not needed for protocomm security 0 This pointer should hold the struct of type wifi_prov_security1_params_t for protocomm security 1 and wifi_prov_security2_params_t for protocomm security 2 respectively. This pointer and its contents should be valid till the provisioning service is running and has not been stopped or de-inited.
service_name
Unique name of the service. This translates to: - Wi-Fi SSID when provisioning mode is softAP - Device name when provisioning mode is BLE
service_key
Key required by client to access the service (NULL if not needed). This translates to: - Wi-Fi password when provisioning mode is softAP - ignored when provisioning mode is BLE
Return value
- ESP_OK : Provisioning started successfully - ESP_FAIL : Failed to start provisioning service - ESP_ERR_INVALID_STATE : Provisioning manager not initialized or already started
Notes
This API will start provisioning service even if device is found to be already provisioned, i.e. wifi_prov_mgr_is_provisioned() yields true
wifi_prov_mgr_start_provisioning() calls 15 functions:
![]()
wifi_prov_mgr_start_provisioning()
wifi_prov_mgr_start_provisioning() reads 30 variables and writes 7 variables:
![]()
wifi_prov_mgr_start_provisioning()