Skip to content

Commit f215332

Browse files
committed
Fix compilation options issue
1 parent a463b79 commit f215332

File tree

12 files changed

+59
-24
lines changed

12 files changed

+59
-24
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mobizt/FirebaseClient/.github%2Fworkflows%2Fcompile_library.yml?logo=github&label=compile) [![Github Stars](https://img.shields.io/github/stars/mobizt/FirebaseClient?logo=github)](https://github.com/mobizt/FirebaseClient/stargazers) ![Github Issues](https://img.shields.io/github/issues/mobizt/FirebaseClient?logo=github)
44

5-
![GitHub Release](https://img.shields.io/github/v/release/mobizt/FirebaseClient) ![Arduino](https://img.shields.io/badge/Arduino-v2.0.1-57C207?logo=arduino) ![PlatformIO](https://badges.registry.platformio.org/packages/mobizt/library/FirebaseClient.svg) ![GitHub Release Date](https://img.shields.io/github/release-date/mobizt/FirebaseClient)
5+
![GitHub Release](https://img.shields.io/github/v/release/mobizt/FirebaseClient) ![Arduino](https://img.shields.io/badge/Arduino-v2.0.2-57C207?logo=arduino) ![PlatformIO](https://badges.registry.platformio.org/packages/mobizt/library/FirebaseClient.svg) ![GitHub Release Date](https://img.shields.io/github/release-date/mobizt/FirebaseClient)
66

7-
Revision `2025-03-26`
7+
Revision `2025-04-07`
88

99
## Introduction
1010

@@ -737,8 +737,8 @@ FIREBASE_DISABLE_ONBOARD_WIFI // For disabling on-board WiFI functionality in ca
737737
FIREBASE_DISABLE_NATIVE_ETHERNET // For disabling native (sdk) Ethernet functionality in case external Client usage.
738738
FIREBASE_DISABLE_NATIVE_PPP // For disabling native ESP32 (sdk) PPP functionality.
739739
ENABLE_ASYNC_TCP_CLIENT // For Async TCP Client usage.
740-
FIREBASE_ASYNC_QUEUE_LIMIT // For maximum async queue limit setting for an async client.
741-
FIREBASE_PRINTF_PORT // For Firebase.printf debug port.
740+
FIREBASE_ASYNC_QUEUE_LIMIT // For maximum async queue limit (number) setting for an async client.
741+
FIREBASE_PRINTF_PORT // For Firebase.printf debug port class object.
742742
FIREBASE_PRINTF_BUFFER // Firebase.printf buffer size. The default printf buffer size is 1024 for ESP8266 and SAMD otherwise 4096. Some debug message may be truncated for larger text.
743743
```
744744

@@ -773,7 +773,7 @@ DISABLE_FIRESTORE // For disabling Firestore support
773773
DISABLE_FIRESTORE_QUERY // For Firestore Query feature compilation
774774
DISABLE_MESSAGING // For disabling Firebase Cloud Messaging support
775775
DISABLE_STORAGE // For disabling Firebase Storage support
776-
ENABLE_CLOUD_STORAGE // For disabling Google Cloud Storage support
776+
DISABLE_CLOUD_STORAGE // For disabling Google Cloud Storage support
777777
DISABLE_FUNCTIONS // For disabling Google Cloud Functions support
778778
DISABLE_RULESETS // For disabling RuleSets support
779779
DISABLE_PSRAM // For disabling PSRAM support

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "FirebaseClient",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"keywords": "communication, REST, esp32, esp8266, arduino",
55
"description": "Async Firebase Client library for Arduino.",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=FirebaseClient
22

3-
version=2.0.1
3+
version=2.0.2
44

55
author=Mobizt
66

src/client/SSLClient/ESP_SSLClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
*
3-
* The ESP SSL Client Class, ESP_SSLClient.h v2.1.16
3+
* The ESP SSL Client Class, ESP_SSLClient.h v2.1.17
44
*
5-
* Created January 9, 2025
5+
* Created April 7, 2025
66
*
77
* The MIT License (MIT)
88
* Copyright (c) 2025 K. Suwatchai (Mobizt)

src/client/SSLClient/client/BSSL_SSL_Client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* BSSL_SSL_Client library v1.0.19 for Arduino devices.
2+
* BSSL_SSL_Client library v1.0.20 for Arduino devices.
33
*
4-
* Created January 9, 2025
4+
* Created April 7, 2025
55
*
66
* This work contains codes based on WiFiClientSecure from Earle F. Philhower and SSLClient from OSU OPEnS Lab.
77
*
@@ -403,7 +403,7 @@ size_t BSSL_SSL_Client::write(Stream &stream)
403403
int BSSL_SSL_Client::peek()
404404
{
405405

406-
if (!_sc || !available())
406+
if ((!_sc && _secure) || !available())
407407
{
408408
#if defined(ESP_SSLCLIENT_ENABLE_DEBUG)
409409
esp_ssl_debug_print(PSTR("Not connected, none left available."), _debug_level, esp_ssl_debug_error, __func__);

src/client/SSLClient/client/BSSL_SSL_Client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* BSSL_SSL_Client library v1.0.19 for Arduino devices.
2+
* BSSL_SSL_Client library v1.0.20 for Arduino devices.
33
*
4-
* Created January 9, 2025
4+
* Created April 7, 2025
55
*
66
* This work contains codes based on WiFiClientSecure from Earle F. Philhower and SSLClient from OSU OPEnS Lab.
77
*

src/core/AsyncClient/AsyncClient.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66
#include "./core/Utils/OTA.h"
77
#include "./core/Utils/StringUtil.h"
88
#include "./core/AsyncClient/SlotManager.h"
9+
#if defined(ENABLE_DATABASE)
10+
#define PUBLIC_DATABASE_RESULT_IMPL_BASE : public RTDBResultImpl
11+
#else
12+
#define PUBLIC_DATABASE_RESULT_IMPL_BASE
13+
#endif
914

1015
using namespace firebase_ns;
1116

12-
class AsyncClientClass : public RTDBResultImpl
17+
class AsyncClientClass PUBLIC_DATABASE_RESULT_IMPL_BASE
1318
{
1419
friend class AppBase;
1520
friend class RealtimeDatabase;
@@ -413,8 +418,8 @@ class AsyncClientClass : public RTDBResultImpl
413418
// Hadles redirection (stop and connect).
414419
String ext;
415420
String _host = sData->request.getHost(false, &sData->response.val[resns::location], &ext);
416-
conn.stop();
417-
if (conn.connect(_host.c_str(), sData->request.port) > ret_failure)
421+
sman.stop();
422+
if (sman.connect(sData, _host.c_str(), sData->request.port) > ret_failure)
418423
{
419424
uut.relocate(sData->request.val[reqns::header], _host, ext);
420425
sut.clear(sData->request.val[reqns::payload]);

src/core/AsyncClient/SlotManager.h

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
#include "./core/AsyncClient/AsyncData.h"
99
#include "./core/Debug.h"
1010

11-
class SlotManager : public RTDBResultImpl
11+
#if defined(ENABLE_DATABASE)
12+
#define PUBLIC_DATABASE_RESULT_IMPL_BASE : public RTDBResultImpl
13+
#else
14+
#define PUBLIC_DATABASE_RESULT_IMPL_BASE
15+
#endif
16+
17+
class SlotManager PUBLIC_DATABASE_RESULT_IMPL_BASE
1218
{
1319
friend class AsyncClientClass;
1420

@@ -62,9 +68,15 @@ class SlotManager : public RTDBResultImpl
6268
else if (sse_index > -1)
6369
slot = sse_index;
6470

65-
// Multiple SSE modes
66-
if ((sse_index > -1 && options.sse) || sVec.size() >= FIREBASE_ASYNC_QUEUE_LIMIT)
71+
// Multiple SSE modes
72+
#if defined(FIREBASE_ASYNC_QUEUE_LIMIT)
73+
74+
if ((sse_index > -1 && options.sse) || sVec.size() >= (int)FIREBASE_ASYNC_QUEUE_LIMIT + 0)
6775
slot = -2;
76+
#else
77+
if (sse_index > -1 && options.sse)
78+
slot = -2;
79+
#endif
6880

6981
if (slot >= (int)sVec.size())
7082
slot = -1;
@@ -150,6 +162,7 @@ class SlotManager : public RTDBResultImpl
150162

151163
bool sseFilter(async_data *sData)
152164
{
165+
#if defined(ENABLE_DATABASE)
153166
String event = sData->aResult.rtdbResult.event();
154167
return (sse_events_filter.length() == 0 ||
155168
(sData->response.flags.http_response && sse_events_filter.indexOf("get") > -1 && event.indexOf("put") > -1) ||
@@ -158,6 +171,9 @@ class SlotManager : public RTDBResultImpl
158171
(sse_events_filter.indexOf("keep-alive") > -1 && event.indexOf("keep-alive") > -1) ||
159172
(sse_events_filter.indexOf("cancel") > -1 && event.indexOf("cancel") > -1) ||
160173
(sse_events_filter.indexOf("auth_revoked") > -1 && event.indexOf("auth_revoked") > -1));
174+
#else
175+
return false;
176+
#endif
161177
}
162178

163179
void reset(async_data *sData, bool disconnect)

src/core/AsyncResult/AsyncResult.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
#include "./core/AsyncResult/RTDBResult.h"
1212
#include "./core/AsyncResult/AppProgress.h"
1313

14+
#if defined(ENABLE_DATABASE)
15+
#define PUBLIC_DATABASE_RESULT_BASE : public RealtimeDatabaseResult
16+
#else
17+
#define PUBLIC_DATABASE_RESULT_BASE
18+
#endif
19+
1420
using namespace firebase_ns;
1521

1622
namespace ares_ns
@@ -25,7 +31,7 @@ namespace ares_ns
2531
};
2632
}
2733

28-
class AsyncResult : public RealtimeDatabaseResult
34+
class AsyncResult PUBLIC_DATABASE_RESULT_BASE
2935
{
3036
friend class AsyncClientClass;
3137
friend class AppBase;
@@ -280,8 +286,10 @@ class AsyncResult : public RealtimeDatabaseResult
280286
{
281287
data_log.read();
282288
static T o;
289+
#if defined(ENABLE_RTDB)
283290
if (std::is_same<T, RealtimeDatabaseResult>::value)
284291
return rtdbResult;
292+
#endif
285293
return o;
286294
}
287295

src/core/AsyncResult/RTDBResultImpl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <Arduino.h>
55
#include "./core/AsyncResult/AsyncResult.h"
6+
#if defined(ENABLE_DATABASE)
67

78
namespace firebase_ns
89
{
@@ -19,4 +20,5 @@ namespace firebase_ns
1920
void setRefPayload(RealtimeDatabaseResult *rtdbResult, String *payload) { rtdbResult->ref_payload = payload; }
2021
};
2122
}
23+
#endif
2224
#endif

0 commit comments

Comments
 (0)