feat(wifi_prov): Add API for checking whether the provisioning state machine is idle

This commit is contained in:
monoliths 2023-11-13 12:10:51 +08:00 committed by Laukik Hase
parent 3cd7fb6321
commit 55acf50c48
No known key found for this signature in database
GPG Key ID: D6F3208C06086AC8
2 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -282,6 +282,13 @@ void wifi_prov_mgr_deinit(void);
*/
esp_err_t wifi_prov_mgr_is_provisioned(bool *provisioned);
/**
* @brief Checks whether the provisioning state machine is idle
*
* @return True if state machine is idle, else false
*/
bool wifi_prov_mgr_is_sm_idle(void);
/**
* @brief Start provisioning service
*

View File

@ -1214,6 +1214,11 @@ esp_err_t wifi_prov_mgr_is_provisioned(bool *provisioned)
return ESP_OK;
}
bool wifi_prov_mgr_is_sm_idle(void)
{
return (prov_ctx->prov_state == WIFI_PROV_STATE_IDLE);
}
static void wifi_connect_timer_cb(void *arg)
{
if (esp_wifi_connect() != ESP_OK) {