Skip to content

Commit 704a295

Browse files
committed
Fix the RTDB session close handle crashed and others bugs fixed.
1 parent 64556ba commit 704a295

File tree

25 files changed

+251
-152
lines changed

25 files changed

+251
-152
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Firebase Arduino Client Library for ESP8266 and ESP32
22

33

4-
Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.2
4+
Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.3
55

66

77
This library supports ESP8266 and ESP32 MCU from Espressif. The following are platforms in which the libraries are also available (RTDB only).

examples/Authentications/Access_Token_from_File/Access_Token_from_File.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ void setup()
8484
/** The user UID set to empty to sign in as admin */
8585
auth.token.uid = "";
8686

87+
/** The scope of the OAuth2.0 authentication
88+
* If you wan't this access token for others Google Cloud Services.
89+
*/
90+
//config.signer.tokens.scope = "Google Scope 1 Url, Google Scope 2 Url,..";
91+
8792
Firebase.reconnectWiFi(true);
8893

8994
/* Now we start to signin using access token */

examples/Firestore/Import_Documents/Import_Documents.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void setup()
8989
Serial.println("------------------------------------");
9090
Serial.println("Import documents from the Storage bucket...");
9191

92-
if (Firebase.Firestore.importDocuments(&fbdo, FIREBASE_PROJECT_ID, "" /* databaseId can be (default) or empty */, STORAGE_BUCKET_ID, "test_path" /* The path in the Firebase Storage bucket to store the data */, "" /* Which collection ids to export. Unspecified means all collections. */))
92+
if (Firebase.Firestore.importDocuments(&fbdo, FIREBASE_PROJECT_ID, "" /* databaseId can be (default) or empty */, STORAGE_BUCKET_ID, "test_path" /* The path in the Firebase Storage bucket to store the data */, "" /* Which collection ids to import. Unspecified means all collections. */))
9393
{
9494
Serial.println("PASSED");
9595
Serial.println("------------------------------------");

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Migrate from Firebase-ESP32 or Firebase-ESP8266 library to Firebase-ESP-Client library
22

33

4-
This library includes the Firebase Storage fnctions and the Firebase Cloud Messageing upgrades.
4+
This library includes the Firebase and Google Cloud Storage fnctions, Cloud Firestore, Cloud Functions and the Firebase Cloud Messageing upgrades.
55

66
The major changes from Firebase-ESP32 or Firebase-ESP8266 library are.
77

8-
* All Firebase Realtime database functions moved from Firebase class to Firebase.RTDB class.
8+
* All Firebase Realtime database functions moved from Firebase class to Firebase.RTDB member class.
99

1010
* All parameters in RTDB functions are the pointer to the variables unless the String type value.
1111

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Firebase Arduino Client Library for ESP8266 and ESP32",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"keywords": "communication, REST, esp32, esp8266, arduino",
55
"description": "This client library provides the functions to work with Firebase Realtime database, Firestore, Storage and Cloud messaging.",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=Firebase Arduino Client Library for ESP8266 and ESP32
22

3-
version=2.0.2
3+
version=2.0.3
44

55
author=Mobizt
66

src/Firebase_ESP_Client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.2
2+
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.3
33
*
44
* This library supports Espressif ESP8266 and ESP32
55
*
6-
* Created February 18, 2021
6+
* Created February 21, 2021
77
*
88
* This work is a part of Firebase ESP Client library
99
* Copyright (c) 2020, 2021 K. Suwatchai (Mobizt)

src/Firebase_ESP_Client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.2
2+
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.3
33
*
44
* This library supports Espressif ESP8266 and ESP32
55
*
6-
* Created February 18, 2021
6+
* Created February 21, 2021
77
*
88
* This work is a part of Firebase ESP Client library
99
* Copyright (c) 2020, 2021 K. Suwatchai (Mobizt)

src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Firebase Arduino Client Library for ESP8266 and ESP32
22

33

4-
Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.2
4+
Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.3
55

66

77
## Global functions

src/common.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ enum fb_esp_method
133133
m_set_priority,
134134
};
135135

136+
enum fb_esp_http_connection_type
137+
{
138+
fb_esp_http_connection_type_undefined,
139+
fb_esp_http_connection_type_keep_alive,
140+
fb_esp_http_connection_type_close
141+
};
142+
136143
enum fb_esp_settings_provider_type
137144
{
138145
auth_provider_type_login,
@@ -387,6 +394,7 @@ struct fb_esp_auth_token_info_t
387394
std::string legacy_token;
388395
std::string auth_type;
389396
std::string jwt;
397+
std::string scope;
390398
unsigned long expires = 0;
391399
fb_esp_auth_token_type token_type = token_type_undefined;
392400
fb_esp_auth_token_status status = token_status_uninitialized;
@@ -551,7 +559,7 @@ struct fb_esp_fcs_file_list_item_t
551559

552560
typedef struct fb_esp_gcs_upload_status_info_t
553561
{
554-
size_t progress;
562+
size_t progress = 0;
555563
fb_esp_gcs_upload_status status = fb_esp_gcs_upload_status_unknown;
556564
std::string localFileName = "";
557565
std::string remoteFileName = "";
@@ -583,11 +591,12 @@ struct fb_esp_rtdb_info_t
583591
bool stream_data_changed = false;
584592
bool stream_path_changed = false;
585593
bool data_available = false;
586-
bool keep_alive = false;
594+
fb_esp_http_connection_type http_req_conn_type = fb_esp_http_connection_type_undefined;
595+
fb_esp_http_connection_type http_resp_conn_type = fb_esp_http_connection_type_undefined;
587596
bool data_mismatch = false;
588597
bool path_not_found = false;
589598
bool pause = false;
590-
bool stream_stop = false;
599+
bool stream_stop = true;
591600

592601
uint8_t connection_status = 0;
593602
uint32_t queue_ID = 0;
@@ -932,6 +941,9 @@ struct fb_esp_session_info_t
932941
bool chunked_encoding = false;
933942
bool connected = false;
934943
bool classic_request = false;
944+
std::string host = "";
945+
unsigned long last_conn_ms = 0;
946+
const uint32_t conn_timeout = 3 * 60 * 1000;
935947

936948
uint16_t resp_size = 2048;
937949
int http_code = -1000;

0 commit comments

Comments
 (0)