From 1f7ef0a64836f7cbe7483433651a78c4f37b376c Mon Sep 17 00:00:00 2001 From: Zhang Jun Hao Date: Wed, 27 Jun 2018 10:55:24 +0800 Subject: [PATCH] feat(wifi): Add set/get wifi autoconnect APIs --- components/esp8266/include/esp_wifi.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/components/esp8266/include/esp_wifi.h b/components/esp8266/include/esp_wifi.h index e6ea635c..37eaba26 100644 --- a/components/esp8266/include/esp_wifi.h +++ b/components/esp8266/include/esp_wifi.h @@ -699,6 +699,32 @@ esp_err_t esp_wifi_ap_get_sta_list(wifi_sta_list_t *sta); */ esp_err_t esp_wifi_set_storage(wifi_storage_t storage); +/** + * @brief Set auto connect + * The default value is true + * + * @param en : true - enable auto connect / false - disable auto connect + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_MODE: WiFi internal error, the station/soft-AP control block is invalid + * - others: refer to error code in esp_err.h + */ +esp_err_t esp_wifi_set_auto_connect(bool en) __attribute__ ((deprecated)); + +/** + * @brief Get the auto connect flag + * + * @param[out] en store current auto connect configuration + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_auto_connect(bool *en) __attribute__ ((deprecated)); + /** * @brief Set 802.11 Vendor-Specific Information Element *