Skip to content

Commit

Permalink
Update core.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Sep 10, 2023
1 parent cdfc77e commit 8dac11d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/FB_Const.h
Original file line number Diff line number Diff line change
Expand Up @@ -2582,6 +2582,7 @@ static const char firebase_rtdb_err_pgm_str_1[] PROGMEM = "backup data should be
static const char firebase_rtdb_err_pgm_str_2[] PROGMEM = "path not exist";
static const char firebase_rtdb_err_pgm_str_3[] PROGMEM = "data type mismatch";
static const char firebase_rtdb_err_pgm_str_4[] PROGMEM = "security rules is not a valid JSON";
static const char firebase_rtdb_err_pgm_str_5[] PROGMEM = "the FirebaseData object was paused";

// FCM error string
static const char firebase_fcm_err_pgm_str_1[] PROGMEM = "no ID token or registration token provided";
Expand Down
1 change: 1 addition & 0 deletions src/FB_Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@
#define FIREBASE_ERROR_TOKEN_ERROR_UNNOTIFY /* */ (FB_ERROR_RANGE - 37)
#define FIREBASE_ERROR_USER_TIME_SETTING_REQUIRED /* */ (FB_ERROR_RANGE - 38)
#define FIREBASE_ERROR_SYS_TIME_IS_NOT_READY /* */ (FB_ERROR_RANGE - 39)
#define FIREBASE_ERROR_USER_PAUSE /* */ (FB_ERROR_RANGE - 40)

#endif
4 changes: 2 additions & 2 deletions src/addons/FireSense/FireSense.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* FireSense v1.0.14
* FireSense v1.0.15
*
* The Programmable Data Logging and IO Control library.
*
* This library required FirebaseESP32 or FirebaseESP8266 or Firebase ESP Client to be installed.
*
* This library supports Espressif ESP8266, ESP32 and RP2040 Pico
*
* Created March 5, 2023
* Created September 10, 2023
*
* This work is a part of Firebase ESP Client library
* Copyright (c) 2023 K. Suwatchai (Mobizt)
Expand Down
3 changes: 3 additions & 0 deletions src/core/FirebaseCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2307,6 +2307,9 @@ void FirebaseCore::errorToString(int httpCode, MB_String &buff)
case FIREBASE_ERROR_INVALID_JSON_RULES:
buff += firebase_rtdb_err_pgm_str_4; // "security rules is not a valid JSON"
return;
case FIREBASE_ERROR_USER_PAUSE:
buff += firebase_rtdb_err_pgm_str_5; // "the FirebaseData object was paused"
break;

case FIREBASE_ERROR_NO_FCM_ID_TOKEN_PROVIDED:
buff += firebase_fcm_err_pgm_str_1; // "no ID token or registration token provided"
Expand Down
8 changes: 4 additions & 4 deletions src/rtdb/FB_RTDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ bool FB_RTDB::processRequest(FirebaseData *fbdo, struct firebase_rtdb_request_in

FBUtils::idle();

if (!preRequestCheck(fbdo, req))
if (preRequestCheck(fbdo, req) <= 0)
return false;

if (req->method != http_get)
Expand Down Expand Up @@ -1677,7 +1677,7 @@ bool FB_RTDB::handleRequest(FirebaseData *fbdo, struct firebase_rtdb_request_inf
{
FBUtils::idle();

if (!preRequestCheck(fbdo, req))
if (preRequestCheck(fbdo, req) <= 0)
return false;

#if defined(MB_ARDUINO_PICO)
Expand Down Expand Up @@ -1928,7 +1928,7 @@ int FB_RTDB::preRequestCheck(FirebaseData *fbdo, struct firebase_rtdb_request_in
if (!Core.config)
code = FIREBASE_ERROR_UNINITIALIZED;
else if (fbdo->session.rtdb.pause)
code = 0;
code = FIREBASE_ERROR_USER_PAUSE;
else if (!fbdo->tokenReady())
code = FIREBASE_ERROR_TOKEN_NOT_READY;
else if (req->path.length() == 0 ||
Expand Down Expand Up @@ -3452,7 +3452,7 @@ bool FB_RTDB::handleStreamRequest(FirebaseData *fbdo, const MB_String &path)
else
req.path = path.c_str();

if (!preRequestCheck(fbdo, &req))
if (preRequestCheck(fbdo, &req) <= 0)
return false;

if (!sendRequest(fbdo, &req))
Expand Down

0 comments on commit 8dac11d

Please sign in to comment.