Function esp_idf_svc::sys::wifi_prov_mgr_start_provisioning

source ยท
pub unsafe extern "C" fn wifi_prov_mgr_start_provisioning(
    security: u32,
    wifi_prov_sec_params: *const c_void,
    service_name: *const i8,
    service_key: *const i8,
) -> i32
Expand description

@brief 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

@note This API will start provisioning service even if device is found to be already provisioned, i.e. wifi_prov_mgr_is_provisioned() yields true

@param[in] 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 @param[in] 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. @param[in] 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 @param[in] 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

  • ESP_OK : Provisioning started successfully
  • ESP_FAIL : Failed to start provisioning service
  • ESP_ERR_INVALID_STATE : Provisioning manager not initialized or already started