1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

allow multiple event callbacks and add filter option

This commit is contained in:
Markus Sattler
2015-12-29 17:31:57 +01:00
parent 61440d9e2b
commit 85905c12f2
3 changed files with 52 additions and 7 deletions

View File

@ -27,6 +27,11 @@
typedef void (*WiFiEventCb)(WiFiEvent_t event);
typedef struct {
WiFiEventCb cb;
WiFiEvent_t event;
} WiFiEventCbList_t;
class ESP8266WiFiGenericClass {
// ----------------------------------------------------------------------------------------------
// -------------------------------------- Generic WiFi function ---------------------------------
@ -36,7 +41,8 @@ class ESP8266WiFiGenericClass {
ESP8266WiFiGenericClass();
void onEvent(WiFiEventCb cbEvent);
void onEvent(WiFiEventCb cbEvent, WiFiEvent_t event = WIFI_EVENT_MAX);
void removeEvent(WiFiEventCb cbEvent, WiFiEvent_t event = WIFI_EVENT_MAX);
int32_t channel(void);
@ -61,7 +67,6 @@ class ESP8266WiFiGenericClass {
protected:
static bool _persistent;
static WiFiEventCb _cbEvent;
static WiFiMode_t _forceSleepLastMode;
static void _eventCallback(void *event);