Skip to content

Commit

Permalink
Add check prov mgr is stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
Diam2023 committed Nov 13, 2023
1 parent c824346 commit 65bc566
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/wifi_provisioning/include/wifi_provisioning/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,17 @@ void wifi_prov_mgr_deinit(void);
*/
esp_err_t wifi_prov_mgr_is_provisioned(bool *provisioned);

/**
* @brief Checks if prov mgr is stopped
*
* This checks if prov_ctx->prov_state == WIFI_PROV_STATE_IDLE
*
* @return
* - ture : prov mgr state is idle
* - false : prov mgr is not idle
*/
bool wifi_prov_mgr_is_stopped();

/**
* @brief Start provisioning service
*
Expand Down
5 changes: 5 additions & 0 deletions components/wifi_provisioning/src/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,11 @@ esp_err_t wifi_prov_mgr_is_provisioned(bool *provisioned)
return ESP_OK;
}

bool wifi_prov_mgr_is_stopped()
{
return (prov_ctx->prov_state == WIFI_PROV_STATE_IDLE);
}

static void wifi_connect_timer_cb(void *arg)
{
if (esp_wifi_connect() != ESP_OK) {
Expand Down

0 comments on commit 65bc566

Please sign in to comment.