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 369e036 commit 109775e
Show file tree
Hide file tree
Showing 33 changed files with 57 additions and 52 deletions.
10 changes: 3 additions & 7 deletions examples/ExternalClient/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 ESP8266 Client",
"version": "4.4.1",
"version": "4.4.2",
"keywords": "communication, REST, esp8266, arduino",
"description": "The secure, fast and reliable Firebase Realtime database library to read, store, update, delete, listen, backup, and restore data. You can also read and modify the database security rules with this library.",
"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 ESP8266 Client

version=4.4.1
version=4.4.2

author=Mobizt

Expand Down
2 changes: 1 addition & 1 deletion src/FB_Const.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/FB_Error.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
6 changes: 5 additions & 1 deletion src/FB_Network.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand All @@ -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
2 changes: 1 addition & 1 deletion src/FB_Utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/Firebase.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/Firebase.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/FirebaseFS.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

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
3 changes: 2 additions & 1 deletion src/core/FirebaseCore.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down 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
2 changes: 1 addition & 1 deletion src/core/FirebaseCore.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/core/Firebase_Client_Version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef FIREBASE_CLIENT_VERSION
#define FIREBASE_CLIENT_VERSION "4.4.1"
#define FIREBASE_CLIENT_VERSION_NUM 40401
#define FIREBASE_CLIENT_VERSION "4.4.2"
#define FIREBASE_CLIENT_VERSION_NUM 40402

/* The inconsistent file version checking to prevent mixed versions compilation. */
#define FIREBASE_CLIENT_VERSION_CHECK(ver) (ver == FIREBASE_CLIENT_VERSION_NUM)
Expand Down
2 changes: 1 addition & 1 deletion src/message/FCM.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/message/FCM.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/message/LFCM.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/FB_RTDB.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/FB_RTDB.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/QueryFilter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/QueryFilter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/QueueInfo.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/QueueInfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/QueueManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/QueueManager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/stream/FB_MP_Stream.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/stream/FB_MP_Stream.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/stream/FB_Stream.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rtdb/stream/FB_Stream.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/session/FB_Session.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/session/FB_Session.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40401)
#if !FIREBASE_CLIENT_VERSION_CHECK(40402)
#error "Mixed versions compilation."
#endif

Expand Down

0 comments on commit 109775e

Please sign in to comment.