identifier "wifi_event_ap_staconnected_t" is undefined
Posted: Mon Jul 19, 2021 1:29 pm
Hello.
I am trying to use the following event handler:
I have included:
Why is wifi_event_ap_staconnected_t still undefined ?
I am trying to use the following event handler:
Code: Select all
static void wifi_event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data)
{
wifi_event_ap_staconnected_t *event;
wifi_event_ap_stadisconnected_t* evente;
switch (event_id) {
case SYSTEM_EVENT_AP_START:
ESP_LOGV(TAG, "Wifi AP started!");
xEventGroupSetBits(wifi_event_group, BIT2);
break;
case SYSTEM_EVENT_AP_STOP:
ESP_LOGV(TAG, "Wifi AP stopped!");
break;
case SYSTEM_EVENT_AP_STACONNECTED:
event = (wifi_event_ap_staconnected_t *) event_data;
ESP_LOGV(TAG, "Client connected - station:"MACSTR", AID=%d", MAC2STR(event->mac), event->aid);
break;
case SYSTEM_EVENT_AP_STADISCONNECTED:
evente = (wifi_event_ap_stadisconnected_t*) event_data;
ESP_LOGV(TAG, "Client disconnected - station:"MACSTR", AID=%d",
MAC2STR(evente->mac), evente->aid);
break;
default:
break;
}
}
Code: Select all
#include "esp_wifi.h"
#include <esp_wifi_types.h>
#include "esp_event.h"