identifier "wifi_event_ap_staconnected_t" is undefined

GeorgeFlorian1
Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

identifier "wifi_event_ap_staconnected_t" is undefined

Postby GeorgeFlorian1 » Mon Jul 19, 2021 1:29 pm

Hello.
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;
    }
}
I have included:

Code: Select all

#include "esp_wifi.h"
#include <esp_wifi_types.h>
#include "esp_event.h"
Why is wifi_event_ap_staconnected_t still undefined ?

Who is online

Users browsing this forum: No registered users and 55 guests