ESP32 | Cloud Firestore Project, Network Class Updated

This commit is contained in:
Eric
2024-05-06 22:12:28 -07:00
parent 4fff68497a
commit 12206bbeb7
6 changed files with 25 additions and 13 deletions

View File

@@ -6,6 +6,10 @@
*/
/////////////////////////////////////////////////////////////////
// 05-06-2024
// Code Updated - Network Class
// Tested ESP32 Version - 2.0.16
#include "DHTesp.h" // Click here to get the library: http://librarymanager/All#DHTesp
#include <Ticker.h>
#include "Display.h"

View File

@@ -31,14 +31,14 @@ void WiFiEventDisconnected(WiFiEvent_t event, WiFiEventInfo_t info){
}
void FirestoreTokenStatusCallback(TokenInfo info){
Serial.printf("Token Info: type = %s, status = %s\n", getTokenType(info).c_str(), getTokenStatus(info).c_str());
Serial.printf("Token Info: type = %s, status = %s\n", getTokenType(info), getTokenStatus(info));
}
void Network::initWiFi(){
WiFi.disconnect();
WiFi.onEvent(WiFiEventConnected, SYSTEM_EVENT_STA_CONNECTED);
WiFi.onEvent(WiFiEventGotIP, SYSTEM_EVENT_STA_GOT_IP);
WiFi.onEvent(WiFiEventDisconnected, SYSTEM_EVENT_STA_DISCONNECTED);
WiFi.onEvent(WiFiEventConnected, ARDUINO_EVENT_WIFI_STA_CONNECTED);
WiFi.onEvent(WiFiEventGotIP, ARDUINO_EVENT_WIFI_STA_GOT_IP);
WiFi.onEvent(WiFiEventDisconnected, ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
}