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:
@ -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_ */
|
||||
|
Reference in New Issue
Block a user