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

allow hook WiFi events from sketch

This commit is contained in:
Markus Sattler
2015-12-29 14:33:10 +01:00
parent fd443d4e17
commit 373da3df6b
4 changed files with 37 additions and 12 deletions

View File

@ -25,14 +25,19 @@
#include "ESP8266WiFiType.h"
typedef void (*WiFiEventCb)(WiFiEvent_t event);
class ESP8266WiFiGenericClass {
// ----------------------------------------------------------------------------------------------
// -------------------------------------- Generic WiFi function ---------------------------------
// ----------------------------------------------------------------------------------------------
public:
ESP8266WiFiGenericClass();
void onEvent(WiFiEventCb cbEvent);
int32_t channel(void);
bool setSleepMode(WiFiSleepType_t type);
@ -50,9 +55,10 @@ class ESP8266WiFiGenericClass {
bool enableAP(bool enable);
protected:
static bool _persistent;
static bool _persistent;
static WiFiEventCb _cbEvent;
static void _eventCallback(void *event);
static void _eventCallback(void *event);
// ----------------------------------------------------------------------------------------------
// ------------------------------------ Generic Network function --------------------------------
@ -69,5 +75,4 @@ class ESP8266WiFiGenericClass {
friend class ESP8266WiFiAPClass;
};
#endif /* ESP8266WIFIGENERIC_H_ */