feat(provisioning): Addded api to set Authmode in provisioning

Added api to set threshold authmode for provisioning demo
This commit is contained in:
hrushikesh.bhosale
2024-10-01 19:31:53 +08:00
committed by Hrushikesh Bhosale
parent ffdf59a898
commit 95f5b29ffc
4 changed files with 52 additions and 4 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -36,6 +36,13 @@ typedef enum {
*/
WIFI_PROV_START,
/**
* Emitted before accepting the wifi credentials to
* set the wifi configurations according to requirement.
* NOTE - In this case event_data shall be populated with a pointer to `wifi_config_t`.
*/
WIFI_PROV_SET_STA_CONFIG,
/**
* Emitted when Wi-Fi AP credentials are received via `protocomm`
* endpoint `wifi_config`. The event data in this case is a pointer
+4 -1
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -1240,6 +1240,9 @@ esp_err_t wifi_prov_mgr_configure_sta(wifi_config_t *wifi_cfg)
RELEASE_LOCK(prov_ctx_lock);
return ESP_FAIL;
}
execute_event_cb(WIFI_PROV_SET_STA_CONFIG, (void *)wifi_cfg, sizeof(wifi_config_t));
if (prov_ctx->prov_state >= WIFI_PROV_STATE_CRED_RECV) {
ESP_LOGE(TAG, "Wi-Fi credentials already received by provisioning app");
RELEASE_LOCK(prov_ctx_lock);