Skip to content

Commit

Permalink
Fix reference time setting issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Sep 11, 2023
1 parent fe8cbfd commit 2506af0
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 24 deletions.
10 changes: 3 additions & 7 deletions examples/ExternalClient/RTDB/Generic/Basic/Basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@
// Provide the RTDB payload printing info and other helper functions.
#include <addons/RTDBHelper.h>

/* 1. Define the WiFi credentials */
#define WIFI_SSID "WIFI_AP"
#define WIFI_PASSWORD "WIFI_PASSWORD"

// For the following credentials, see examples/Authentications/SignInAsUser/EmailPassword/EmailPassword.ino

/* 2. Define the API Key */
/* 1. Define the API Key */
#define API_KEY "API_KEY"

/* 3. Define the RTDB URL */
/* 2. Define the RTDB URL */
#define DATABASE_URL "URL" //<databaseName>.firebaseio.com or <databaseName>.<region>.firebasedatabase.app

/* 4. Define the user Email and password that alreadey registerd or added in your project */
/* 3. Define the user Email and password that alreadey registerd or added in your project */
#define USER_EMAIL "USER_EMAIL"
#define USER_PASSWORD "USER_PASSWORD"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,15 @@
// Provide the RTDB payload printing info and other helper functions.
#include <addons/RTDBHelper.h>

/* 1. Define the WiFi credentials */
#define WIFI_SSID "WIFI_AP"
#define WIFI_PASSWORD "WIFI_PASSWORD"

// For the following credentials, see examples/Authentications/SignInAsUser/EmailPassword/EmailPassword.ino

/* 2. Define the API Key */
/* 1. Define the API Key */
#define API_KEY "API_KEY"

/* 3. Define the RTDB URL */
/* 2. Define the RTDB URL */
#define DATABASE_URL "URL" //<databaseName>.firebaseio.com or <databaseName>.<region>.firebasedatabase.app

/* 4. Define the user Email and password that alreadey registerd or added in your project */
/* 3. Define the user Email and password that alreadey registerd or added in your project */
#define USER_EMAIL "USER_EMAIL"
#define USER_PASSWORD "USER_PASSWORD"

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Firebase Arduino Client Library for ESP8266 and ESP32",
"version": "4.4.1",
"version": "4.4.2",
"keywords": "communication, REST, esp32, esp8266, arduino",
"description": "The library supports Firebase products e.g. Realtime database, Cloud Firestore database, Firebase Storage and Google Cloud Storage, Cloud Functions for Firebase and Cloud Messaging. The library also supported other Arduino devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=Firebase Arduino Client Library for ESP8266 and ESP32

version=4.4.1
version=4.4.2

author=Mobizt

Expand Down
4 changes: 4 additions & 0 deletions src/FB_Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include <esp_idf_version.h>
#endif

#if __has_include(<IPAddress.h>)
#include <IPAddress.h>
#endif

#if defined(ESP8266) || defined(MB_ARDUINO_PICO)

#include <string>
Expand Down
8 changes: 0 additions & 8 deletions src/client/FB_TCP_Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -1087,14 +1087,6 @@ class Firebase_TCP_Client : public Client
return _network_status;
}

bool wifiConnected()
{
#if defined(FIREBASE_WIFI_MODULE_IS_AVAILABLE)
_network_status = Ethernet.linkStatus() == LinkON;
#endif
return _network_status;
}

int setOption(int option, int *value)
{
#if defined(ESP32) && defined(FIREBASE_WIFI_IS_AVAILABLE)
Expand Down
16 changes: 16 additions & 0 deletions src/client/SSLClient/client/stm32_time_fix.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

// _gettimeofday link missing in STM32

#if defined(ARDUINO_ARCH_STM32)

#include <sys/time.h>

__attribute__((weak)) int _gettimeofday(struct timeval *tv, void *ignore __attribute__((unused)))
{
uint64_t t = 0;
tv->tv_sec = t / 1000000000;
tv->tv_usec = (t % 1000000000) / 1000;
return 0;
}

#endif
1 change: 1 addition & 0 deletions src/core/FirebaseCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ void FirebaseCore::tokenProcessingTask()
{

FBUtils::idle();
internal.fb_clock_rdy = timeReady();

if (!internal.fb_clock_rdy && (config->cert.data != NULL || config->cert.file.length() > 0 || config->signer.tokens.token_type == token_type_oauth2_access_token || config->signer.tokens.token_type == token_type_custom_token))
{
Expand Down

0 comments on commit 2506af0

Please sign in to comment.