forked from espressif/esp-idf
fix(esp_wifi): Roaming app, sync api naming
This commit is contained in:
@ -26,7 +26,7 @@ static esp_netif_t *s_wifi_netifs[MAX_WIFI_IFS] = { NULL };
|
|||||||
static bool wifi_default_handlers_set = false;
|
static bool wifi_default_handlers_set = false;
|
||||||
|
|
||||||
static esp_err_t disconnect_and_destroy(esp_netif_t* esp_netif);
|
static esp_err_t disconnect_and_destroy(esp_netif_t* esp_netif);
|
||||||
#ifdef ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
|
#ifdef CONFIG_ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
|
||||||
static bool roaming_ongoing = false;
|
static bool roaming_ongoing = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ static void wifi_default_action_sta_stop(void *arg, esp_event_base_t base, int32
|
|||||||
|
|
||||||
static void wifi_default_action_sta_connected(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
static void wifi_default_action_sta_connected(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||||
{
|
{
|
||||||
#ifdef ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
|
#ifdef CONFIG_ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
|
||||||
if (roaming_ongoing) {
|
if (roaming_ongoing) {
|
||||||
/* IP stack is already in ready state */
|
/* IP stack is already in ready state */
|
||||||
roaming_ongoing = false;
|
roaming_ongoing = false;
|
||||||
@ -113,7 +113,7 @@ static void wifi_default_action_sta_connected(void *arg, esp_event_base_t base,
|
|||||||
|
|
||||||
static void wifi_default_action_sta_disconnected(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
static void wifi_default_action_sta_disconnected(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||||
{
|
{
|
||||||
#ifdef ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
|
#ifdef CONFIG_ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
|
||||||
wifi_event_sta_disconnected_t *disconn = data;
|
wifi_event_sta_disconnected_t *disconn = data;
|
||||||
if (disconn->reason == WIFI_REASON_ROAMING) {
|
if (disconn->reason == WIFI_REASON_ROAMING) {
|
||||||
roaming_ongoing = true;
|
roaming_ongoing = true;
|
||||||
|
@ -182,7 +182,7 @@ static esp_err_t wifi_deinit_internal(void)
|
|||||||
esp_supplicant_deinit();
|
esp_supplicant_deinit();
|
||||||
|
|
||||||
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
||||||
deinit_roaming_app();
|
roam_deinit_app();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
err = esp_wifi_deinit_internal();
|
err = esp_wifi_deinit_internal();
|
||||||
@ -447,7 +447,7 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
||||||
init_roaming_app();
|
roam_init_app();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -485,7 +485,7 @@ esp_err_t esp_wifi_connect(void)
|
|||||||
ret = esp_wifi_connect_internal();
|
ret = esp_wifi_connect_internal();
|
||||||
|
|
||||||
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
||||||
roaming_app_enable_reconnect();
|
roam_enable_reconnect();
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -493,11 +493,11 @@ esp_err_t esp_wifi_connect(void)
|
|||||||
esp_err_t esp_wifi_disconnect(void)
|
esp_err_t esp_wifi_disconnect(void)
|
||||||
{
|
{
|
||||||
esp_err_t ret = ESP_OK;
|
esp_err_t ret = ESP_OK;
|
||||||
|
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
||||||
|
roam_disable_reconnect();
|
||||||
|
#endif
|
||||||
ret = esp_wifi_disconnect_internal();
|
ret = esp_wifi_disconnect_internal();
|
||||||
|
|
||||||
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
|
||||||
roaming_app_disable_reconnect();
|
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@ struct roam_config {
|
|||||||
wifi_scan_config_t scan_config;
|
wifi_scan_config_t scan_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
void init_roaming_app(void);
|
void roam_init_app(void);
|
||||||
void deinit_roaming_app(void);
|
void roam_deinit_app(void);
|
||||||
void roaming_app_disable_reconnect(void);
|
void roam_disable_reconnect(void);
|
||||||
void roaming_app_enable_reconnect(void);
|
void roam_enable_reconnect(void);
|
||||||
esp_err_t roam_get_config_params(struct roam_config *config);
|
esp_err_t roam_get_config_params(struct roam_config *config);
|
||||||
esp_err_t roam_set_config_params(struct roam_config *config);
|
esp_err_t roam_set_config_params(struct roam_config *config);
|
||||||
|
|
||||||
|
@ -54,13 +54,13 @@ static inline long time_diff_sec(struct timeval *a, struct timeval *b)
|
|||||||
return (a->tv_sec - b->tv_sec);
|
return (a->tv_sec - b->tv_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void roaming_app_disable_reconnect(void)
|
void roam_disable_reconnect(void)
|
||||||
{
|
{
|
||||||
ESP_LOGD(ROAMING_TAG, "Switching off reconnect due to application trigerred disconnect");
|
ESP_LOGD(ROAMING_TAG, "Switching off reconnect due to application trigerred disconnect");
|
||||||
g_roaming_app.allow_reconnect = false;
|
g_roaming_app.allow_reconnect = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void roaming_app_enable_reconnect(void)
|
void roam_enable_reconnect(void)
|
||||||
{
|
{
|
||||||
ESP_LOGD(ROAMING_TAG, "Switching on reconnect due to application trigerred reconnect");
|
ESP_LOGD(ROAMING_TAG, "Switching on reconnect due to application trigerred reconnect");
|
||||||
g_roaming_app.allow_reconnect = true;
|
g_roaming_app.allow_reconnect = true;
|
||||||
@ -853,7 +853,7 @@ static esp_err_t init_scan_config(void)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_roaming_app(void)
|
void roam_init_app(void)
|
||||||
{
|
{
|
||||||
#if !LOW_RSSI_ROAMING_ENABLED && !PERIODIC_SCAN_MONITORING
|
#if !LOW_RSSI_ROAMING_ENABLED && !PERIODIC_SCAN_MONITORING
|
||||||
ESP_LOGE(ROAMING_TAG, "No roaming trigger enabled. Roaming app cannot be initialized");
|
ESP_LOGE(ROAMING_TAG, "No roaming trigger enabled. Roaming app cannot be initialized");
|
||||||
@ -880,7 +880,7 @@ void init_roaming_app(void)
|
|||||||
ESP_LOGI(ROAMING_TAG, "Roaming app initialization done");
|
ESP_LOGI(ROAMING_TAG, "Roaming app initialization done");
|
||||||
}
|
}
|
||||||
|
|
||||||
void deinit_roaming_app(void)
|
void roam_deinit_app(void)
|
||||||
{
|
{
|
||||||
#if !LOW_RSSI_ROAMING_ENABLED && !PERIODIC_SCAN_MONITORING
|
#if !LOW_RSSI_ROAMING_ENABLED && !PERIODIC_SCAN_MONITORING
|
||||||
ESP_LOGE(ROAMING_TAG, "No roaming trigger enabled. Roaming app cannot be de-initialized");
|
ESP_LOGE(ROAMING_TAG, "No roaming trigger enabled. Roaming app cannot be de-initialized");
|
||||||
|
Reference in New Issue
Block a user