xtensa/esp32: Add Wi-Fi softap event

This commit is contained in:
chenwen@espressif.com 2023-01-06 19:09:15 +08:00 committed by Alan Carvalho de Assis
parent ec28082e5d
commit 933d1a0a80
2 changed files with 40 additions and 0 deletions

View File

@ -2144,6 +2144,24 @@ static int esp_event_id_map(int event_id)
id = WIFI_ADPT_EVT_STA_STOP;
break;
#endif
#ifdef ESP32_WLAN_HAS_SOFTAP
case WIFI_EVENT_AP_START:
id = WIFI_ADPT_EVT_AP_START;
break;
case WIFI_EVENT_AP_STOP:
id = WIFI_ADPT_EVT_AP_STOP;
break;
case WIFI_EVENT_AP_STACONNECTED:
id = WIFI_ADPT_EVT_AP_STACONNECTED;
break;
case WIFI_EVENT_AP_STADISCONNECTED:
id = WIFI_ADPT_EVT_AP_STADISCONNECTED;
break;
#endif
default:
return -1;
}
@ -2224,6 +2242,24 @@ static void esp_evt_work_cb(void *arg)
g_sta_connected = false;
break;
#endif
#ifdef ESP32_WLAN_HAS_SOFTAP
case WIFI_ADPT_EVT_AP_START:
wlinfo("INFO: Wi-Fi softap start\n");
break;
case WIFI_ADPT_EVT_AP_STOP:
wlinfo("INFO: Wi-Fi softap stop\n");
break;
case WIFI_ADPT_EVT_AP_STACONNECTED:
wlinfo("INFO: Wi-Fi station join\n");
break;
case WIFI_ADPT_EVT_AP_STADISCONNECTED:
wlinfo("INFO: Wi-Fi station leave\n");
break;
#endif
default:
break;
}

View File

@ -79,6 +79,10 @@ enum wifi_adpt_evt_e
WIFI_ADPT_EVT_STA_DISCONNECT,
WIFI_ADPT_EVT_STA_AUTHMODE_CHANGE,
WIFI_ADPT_EVT_STA_STOP,
WIFI_ADPT_EVT_AP_START,
WIFI_ADPT_EVT_AP_STOP,
WIFI_ADPT_EVT_AP_STACONNECTED,
WIFI_ADPT_EVT_AP_STADISCONNECTED,
WIFI_ADPT_EVT_MAX,
};