diff --git a/libraries/WiFi/src/WiFiGeneric.h b/libraries/WiFi/src/WiFiGeneric.h index ed216229ed4..bff10e2eac8 100644 --- a/libraries/WiFi/src/WiFiGeneric.h +++ b/libraries/WiFi/src/WiFiGeneric.h @@ -42,7 +42,38 @@ #include "lwip/ip_addr.h" #include "Network.h" +// ------------------------------------------------------------------ +// COMPATIBILITY SHIM for ESP32‑C6 / Arduino‑Core v3.x +// If the NetworkEvent typedefs are not visible at this point, +// provide minimal stand‑ins so the compilation succeeds. +// ------------------------------------------------------------------ +#ifndef NETWORK_EVENT_COMPAT_SHIM +#define NETWORK_EVENT_COMPAT_SHIM +#include +#include "esp_event.h" + +#ifndef __NETWORK_EVENTS_H__ + // We didn’t get the real definitions. Provide light stubs. + typedef enum { + ARDUINO_EVENT_NONE = 0, + ARDUINO_EVENT_MAX = 999 // sentinel – real enum lives in NetworkEvents.h + } arduino_event_id_t; + + typedef struct { + arduino_event_id_t event_id; + void *event_data; + } arduino_event_t; +#endif // __NETWORK_EVENTS_H__ + +// Fallback callback / handle typedefs +typedef int32_t network_event_handle_t; +typedef void (*NetworkEventCb) (arduino_event_id_t, arduino_event_t *, void *); +typedef std::function + NetworkEventFuncCb; +typedef void (*NetworkEventSysCb) (arduino_event_id_t, void *); + +#endif // NETWORK_EVENT_COMPAT_SHIM #define WiFiEventCb NetworkEventCb #define WiFiEventFuncCb NetworkEventFuncCb #define WiFiEventSysCb NetworkEventSysCb