Skip to content

Commit 0428c73

Browse files
committed
Bug fixes
1 parent 7a7578b commit 0428c73

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/FirebaseArduino.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void FirebaseArduino::setBool(const String& path, bool value) {
6161
}
6262

6363
void FirebaseArduino::setString(const String& path, const String& value) {
64-
JsonVariant json(value);
64+
JsonVariant json(value.c_str());
6565
set(path, json);
6666
}
6767

src/FirebaseArduino.h

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#ifndef FIREBASE_ARDUINO_H
1818
#define FIREBASE_ARDUINO_H
1919

20+
#include <string>
21+
// This is needed to compile std::string on esp8266.
22+
template class std::basic_string<char>;
23+
2024
#include "Firebase.h"
2125
#include "FirebaseObject.h"
2226

src/FirebaseHttpClient_Esp8266.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#include <sstream>
21

32
#include "FirebaseHttpClient.h"
43

4+
#include <stdio.h>
5+
56
// The ordering of these includes matters greatly.
67
#include <WiFiClientSecure.h>
78
#include <ESP8266WiFi.h>
@@ -60,9 +61,9 @@ class FirebaseHttpClientEsp8266 : public FirebaseHttpClient {
6061

6162
std::string errorToString(int error_code) override {
6263
#ifdef USE_ESP_ARDUINO_CORE_2_0_0
63-
std::ostringstream ss;
64-
ss << error_code;
65-
return ss.str();
64+
char buff[11];
65+
itoa(error_code, buff, 10);
66+
return buff;
6667
#else
6768
return HTTPClient::errorToString(error_code).c_str();
6869
#endif

test/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ firebase-test: ${OBJS}
5151
check: firebase-test
5252
./firebase-test
5353

54+
#TODO: had to echo this because it picks up FirebaseObject.h as well and deletes it :(
5455
clean:
5556
echo rm -f ${OBJS} firebase-test

0 commit comments

Comments
 (0)