mirror of
https://github.com/0015/ThatProject.git
synced 2026-01-12 09:17:42 +03:00
Send an SMS from ESP32 (ft. Twilio)
This commit is contained in:
37
MESSAGE/Twilio/0_ESP32TTGO_FIRESTORE_SMS/Network.h
Normal file
37
MESSAGE/Twilio/0_ESP32TTGO_FIRESTORE_SMS/Network.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef Network_H_
|
||||
#define Network_H_
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <Firebase_ESP_Client.h>
|
||||
|
||||
typedef enum {
|
||||
NETWORK_CONNECTED,
|
||||
NETWORK_DISCONNECTED,
|
||||
FIREBASE_CONNECTED,
|
||||
FIREBASE_DISCONNECTED
|
||||
} Network_State_t;
|
||||
|
||||
class Network{
|
||||
private:
|
||||
FirebaseData fbdo;
|
||||
FirebaseAuth auth;
|
||||
FirebaseConfig config;
|
||||
|
||||
typedef void (*FuncPtrInt)(Network_State_t);
|
||||
|
||||
void firebaseInit();
|
||||
friend void WiFiEventConnected(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
friend void WiFiEventGotIP(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
friend void WiFiEventDisconnected(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
friend void FirestoreTokenStatusCallback(TokenInfo info);
|
||||
|
||||
public:
|
||||
FuncPtrInt callBackEvent;
|
||||
Network();
|
||||
Network(FuncPtrInt f);
|
||||
void initWiFi();
|
||||
void firestoreDataUpdate(double temp, double humi);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user