Skip to content

Commit da5b7b7

Browse files
committed
Fix stream error
1 parent 973d647 commit da5b7b7

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Firebase RTDB Arduino Client for ARM/AVR WIFI Dev Boards
22

33

4-
Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Development Boards based on WiFiNINA library, v 1.0.8
4+
Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Development Boards based on WiFiNINA library, v 1.0.9
55

66
This client library provides the most reliable operations for read, store, update Firebase RTDB through REST API.
77

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=Firebase Arduino based on WiFiNINA
22

3-
version=1.0.8
3+
version=1.0.9
44

55
author=Mobizt
66

src/Firebase_Arduino_WiFiNINA.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
/*
2-
* Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Dev Boards based on WiFiNINA library, version 1.0.8
2+
* Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Dev Boards based on WiFiNINA library, version 1.0.9
33
*
44
*
55
* This library required WiFiNINA Library to be installed.
66
* https://github.com/arduino-libraries/WiFiNINA
77
*
8-
* August 9, 2019
8+
* August 12, 2019
99
*
1010
* Feature Added:
1111
*
12-
*
1312
* Feature Fixed:
14-
*
13+
* - Stream error.
1514
*
1615
* This library provides ARM/AVR WIFI Development Boards to perform REST API by GET PUT, POST, PATCH, DELETE data from/to with Google's Firebase database using get, set, update
1716
* and delete calls.
@@ -602,6 +601,10 @@ bool Firebase_Arduino_WiFiNINA::getServerResponse(FirebaseData &dataObj)
602601
delay(1);
603602

604603
dataTime = millis();
604+
605+
if (client.connected() && !client.available())
606+
dataObj._httpCode = HTTPC_ERROR_READ_TIMEOUT;
607+
605608
if (client.connected() && client.available())
606609
{
607610
while (client.available())
@@ -940,7 +943,7 @@ bool Firebase_Arduino_WiFiNINA::getServerResponse(FirebaseData &dataObj)
940943
goto EXIT_2;
941944
}
942945

943-
if (dataObj._httpCode == -1000)
946+
if (dataObj._httpCode == -1000 && dataObj._r_method == FirebaseMethod::STREAM)
944947
flag = true;
945948

946949
dataObj._httpConnected = false;
@@ -963,7 +966,7 @@ bool Firebase_Arduino_WiFiNINA::getServerResponse(FirebaseData &dataObj)
963966

964967
if (dataObj._httpCode == HTTPC_ERROR_READ_TIMEOUT)
965968
return false;
966-
return dataObj._httpCode == _HTTP_CODE_OK || dataObj._httpCode == -1000;
969+
return dataObj._httpCode == _HTTP_CODE_OK || (dataObj._r_method == FirebaseMethod::STREAM && dataObj._httpCode == -1000);
967970

968971
EXIT_3:
969972

@@ -991,7 +994,7 @@ bool Firebase_Arduino_WiFiNINA::firebaseConnectStream(FirebaseData &dataObj, con
991994

992995
dataObj._streamStop = false;
993996

994-
if (dataObj._isStream && path == dataObj._streamPath)
997+
if (!dataObj._isStreamTimeout && dataObj._isStream && path == dataObj._streamPath)
995998
return true;
996999

9971000
if (strlen(path) == 0 || strlen(_host) == 0 || strlen(_auth) == 0)

src/Firebase_Arduino_WiFiNINA.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
/*
2-
* Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Dev Boards based on WiFiNINA library, version 1.0.8
2+
* Google's Firebase Realtime Database Arduino Library for ARM/AVR WIFI Dev Boards based on WiFiNINA library, version 1.0.9
33
*
44
*
55
* This library required WiFiNINA Library to be installed.
66
* https://github.com/arduino-libraries/WiFiNINA
77
*
8-
* August 9, 2019
8+
* August 12, 2019
99
*
1010
* Feature Added:
1111
*
12-
*
1312
* Feature Fixed:
14-
*
13+
* - Stream error.
1514
*
1615
* This library provides ARM/AVR WIFI Development Boards to perform REST API by GET PUT, POST, PATCH, DELETE data from/to with Google's Firebase database using get, set, update
1716
* and delete calls.

0 commit comments

Comments
 (0)