Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Improve stability of the repo #296

Merged
merged 18 commits into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ addons:
packages:
- g++-4.8
env:
- ARDUINO_VERSION=1.6.9 ARDUINO_ESP8266_VERSION=2.3.0 LIB_NEOPIXEL_VERSION=v1.0.5 LIB_GFX_VERSION=v1.1.5 LIB_SSD1306_VERSION=1.1.0 ARDUINO_ROOT=${HOME}/arduino-${ARDUINO_VERSION} ARDUINO_ESP8266_ROOT=${ARDUINO_ROOT}/hardware/esp8266com/esp8266 ARDUINO_HOME=${HOME}/Arduino
- ARDUINO_VERSION=nightly ARDUINO_ESP8266_VERSION=master LIB_NEOPIXEL_VERSION=master LIB_GFX_VERSION=master LIB_SSD1306_VERSION=master ARDUINO_ROOT=${HOME}/arduino-${ARDUINO_VERSION} ARDUINO_ESP8266_ROOT=${ARDUINO_ROOT}/hardware/esp8266com/esp8266 ARDUINO_HOME=${HOME}/Arduino
- ARDUINO_VERSION=1.6.9 ARDUINO_ESP8266_VERSION=2.3.0 LIB_NEOPIXEL_VERSION=v1.0.5 LIB_GFX_VERSION=v1.1.5 LIB_SSD1306_VERSION=1.1.0 LIB_JSON_VERSION=v5.11.2 ARDUINO_ROOT=${HOME}/arduino-${ARDUINO_VERSION} ARDUINO_ESP8266_ROOT=${ARDUINO_ROOT}/hardware/esp8266com/esp8266 ARDUINO_HOME=${HOME}/Arduino
install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- ( cd ${HOME} && wget https://downloads.arduino.cc/arduino-${ARDUINO_VERSION}-linux64.tar.xz && tar xf arduino-${ARDUINO_VERSION}-linux64.tar.xz )
- ( LIB=SoftwareSerial VERSION=097712eb07f5b3a70ef419b6e7a7ed2ada5aab85 && cd ${HOME} && wget https://github.com/plerup/espsoftwareserial/archive/${VERSION}.zip -q -O ${LIB}.zip && unzip -q ${LIB}.zip && rm ${LIB}.zip && mv espsoftwareserial-* ${LIB} )
- ( LIB=Adafruit_NeoPixel VERSION=${LIB_NEOPIXEL_VERSION} && cd ${HOME} && wget https://github.com/adafruit/${LIB}/archive/${VERSION}.zip -q -O ${LIB}.zip && unzip -q ${LIB}.zip && rm ${LIB}.zip && mv ${LIB}-* ${LIB} )
- ( LIB=Adafruit-GFX-Library VERSION=${LIB_GFX_VERSION} && cd ${HOME} && wget https://github.com/adafruit/${LIB}/archive/${VERSION}.zip -q -O ${LIB}.zip && unzip -q ${LIB}.zip && rm ${LIB}.zip && mv ${LIB}-* ${LIB} )
- ( LIB=Adafruit_SSD1306 VERSION=${LIB_SSD1306_VERSION} && cd ${HOME} && wget https://github.com/adafruit/${LIB}/archive/${VERSION}.zip -q -O ${LIB}.zip && unzip -q ${LIB}.zip && rm ${LIB}.zip && mv ${LIB}-* ${LIB} )
- ( LIB=ArduinoJson VERSION=${LIB_JSON_VERSION} && cd ${HOME} && wget https://github.com/bblanchon/${LIB}/archive/${VERSION}.zip -q -O ${LIB}.zip && unzip -q ${LIB}.zip && rm ${LIB}.zip && mv ${LIB}-* ${LIB} )
- git clone --branch ${ARDUINO_ESP8266_VERSION} https://github.com/esp8266/Arduino.git ${ARDUINO_ESP8266_ROOT}
- git submodule init && git submodule update
- ( cd ${ARDUINO_ESP8266_ROOT}/tools && python get.py )
before_script:
- mkdir -p ${ARDUINO_HOME}/libraries
- ( cd ${ARDUINO_HOME}/libraries && ln -s ${TRAVIS_BUILD_DIR} firebase-arduino && ln -s ${TRAVIS_BUILD_DIR}/src/third-party/arduino-json-5.6.7 ArduinoJson && ln -s ${HOME}/SoftwareSerial ./ && ln -s ${HOME}/Adafruit_NeoPixel ./ && ln -s ${HOME}/Adafruit-GFX-Library ./ && ln -s ${HOME}/Adafruit_SSD1306 ./)
- ( cd ${ARDUINO_HOME}/libraries && ln -s ${TRAVIS_BUILD_DIR} firebase-arduino && ln -s ${HOME}/SoftwareSerial ./ && ln -s ${HOME}/Adafruit_NeoPixel ./ && ln -s ${HOME}/Adafruit-GFX-Library ./ && ln -s ${HOME}/Adafruit_SSD1306 ./ && ln -s ${HOME}/ArduinoJson ./)
script:
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseDemo_ESP8266/FirebaseDemo_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseNeoPixel_ESP8266/FirebaseNeoPixel_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseRoom_ESP8266/FirebaseRoom_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M -prefs build.f_cpu=80000000 examples/FirebaseDemo_ESP8266/FirebaseDemo_ESP8266.ino
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why this is not already added by the board package:
https://github.com/esp8266/Arduino/blob/master/boards.txt#L1353

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did not work without it, I had to create my own travis docker container to figure out why the heck it was failing.

- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M -prefs build.f_cpu=80000000 examples/FirebaseNeoPixel_ESP8266/FirebaseNeoPixel_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M -prefs build.f_cpu=80000000 examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M -prefs build.f_cpu=80000000 examples/FirebaseRoom_ESP8266/FirebaseRoom_ESP8266.ino
- ( cd contrib/test && make check )
- ( cd contrib/test/modem/ && make test )
- contrib/test/travis/check_all_examples_use_standard_init.sh
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ FirebaseArduino is a library to simplify connecting to the Firebase database fro
arduino clients.

It is a full abstraction of Firebase's REST API exposed through C++ calls in a wiring
friendly way. All Json parsing is handled by the library and you may deal in pure C/Arduino
types.
friendly way.

ArduinoJson is no longer part of this library and you will have to install latest version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add a new # DEPENDENCIES sections in the README?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

in Arduino environment yourself. (through Board manager or download+unpack from master:
https://github.com/bblanchon/ArduinoJson )

----------------------------------
2 changes: 1 addition & 1 deletion contrib/src/modem/db/stream-command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool StreamCommand::execute(const String& command,
out->print(FirebaseStream::EventToName(event).c_str());
out->print(" ");
const auto& object = buffer.parseObject(json.c_str());
String data = object["data"];
String data = object["data"].asString();
out->println(object["path"].asString());
out->println(data.length());
out->println(data);
Expand Down
2 changes: 1 addition & 1 deletion contrib/src/thing/Config.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Arduino.h"
#include "thing/Config.h"
#include "third-party/arduino-json-5.6.7/include/ArduinoJson.h"
#include <ArduinoJson.h>

namespace thing {

Expand Down
2 changes: 1 addition & 1 deletion contrib/src/thing/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "Arduino.h"
#include <string>
#include <functional>
#include "third-party/arduino-json-5.6.7/include/ArduinoJson.h"
#include <ArduinoJson.h>

namespace thing {

Expand Down
2 changes: 1 addition & 1 deletion contrib/src/thing/Portal.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "thing/Portal.h"
#include "third-party/arduino-json-5.6.7/include/ArduinoJson.h"
#include <ArduinoJson.h>

namespace thing {

Expand Down
1 change: 1 addition & 0 deletions contrib/test/FirebaseArduino_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "FirebaseObject.h"
#include "gtest/gtest.h"


TEST(FirebaseObjectTest, GetBool) {
FirebaseObject obj("true");
EXPECT_EQ(true, obj.getBool());
Expand Down
4 changes: 2 additions & 2 deletions contrib/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

FIREBASE_DIR=../..
GTEST_DIR=googletest/googletest
ARDUINOJSON_DIR=../../src/third-party/arduino-json-5.6.7
ARDUINOJSON_DIR=${ARDUINO_HOME}/libraries/ArduinoJson

FIREBASE_SRCS=${FIREBASE_DIR}/src/FirebaseObject.cpp
GTEST_SRCS=${GTEST_DIR}/src/gtest-all.cpp
Expand All @@ -27,7 +27,7 @@ SRCS=FirebaseArduino_test.cpp\

OBJS=${SRCS:.cpp=.o}

CXXFLAGS=-I. -I${FIREBASE_DIR}/src -Igoogletest/googletest/include -Igoogletest/googletest -std=c++11 -g
CXXFLAGS=-I. -I${FIREBASE_DIR}/src -I${ARDUINOJSON_DIR}/src -Igoogletest/googletest/include -Igoogletest/googletest -std=c++11 -g
LDFLAGS=-lpthread

all: check
Expand Down
2 changes: 2 additions & 0 deletions contrib/test/modem/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ FIREBASE_ROOT = ../../..
PROJECT_ROOT = ../..
SRC_ROOT = $(PROJECT_ROOT)/src
FIREBASE_SRC_ROOT = $(FIREBASE_ROOT)/src
ARDUINOJSON_DIR=$(ARDUINO_HOME)/libraries/ArduinoJson

# Flags passed to the preprocessor.
# Set Google Test and Google Mock's header directories as system
Expand All @@ -45,6 +46,7 @@ CPPFLAGS += -isystem $(GTEST_DIR)/include -isystem $(GMOCK_DIR)/include \
-I$(PROJECT_ROOT)/test/dummies \
-I$(PROJECT_ROOT)/src \
-I$(FIREBASE_ROOT)/src \
-I$(ARDUINOJSON_DIR)/src \
-I$(PROJECT_ROOT)

# Flags passed to the C++ compiler.
Expand Down
3 changes: 3 additions & 0 deletions contrib/test/modem/WString.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <string>

typedef std::string String;
64 changes: 34 additions & 30 deletions src/Firebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "Firebase.h"

using std::unique_ptr;
using std::shared_ptr;

namespace {
std::string makeFirebaseURL(const std::string& path, const std::string& auth) {
Expand All @@ -42,55 +43,56 @@ const std::string& Firebase::auth() const {
}

FirebaseGet Firebase::get(const std::string& path) {
return FirebaseGet(host_, auth_, path, http_.get());
return FirebaseGet(host_, auth_, path, http_);
}

unique_ptr<FirebaseGet> Firebase::getPtr(const std::string& path) {
return unique_ptr<FirebaseGet>(new FirebaseGet(host_, auth_, path, http_.get()));
unique_ptr<FirebaseGet> Firebase::getPtr(const std::string& path) {
return unique_ptr<FirebaseGet>(new FirebaseGet(host_, auth_, path, http_));
}

FirebaseSet Firebase::set(const std::string& path, const std::string& value) {
return FirebaseSet(host_, auth_, path, value, http_.get());
return FirebaseSet(host_, auth_, path, value, http_);
}

unique_ptr<FirebaseSet> Firebase::setPtr(const std::string& path,
const std::string& value) {
return unique_ptr<FirebaseSet>(
new FirebaseSet(host_, auth_, path, value, http_.get()));
unique_ptr<FirebaseSet> Firebase::setPtr(const std::string& path,
const std::string& value) {
return unique_ptr<FirebaseSet>(
new FirebaseSet(host_, auth_, path, value, http_));
}

FirebasePush Firebase::push(const std::string& path, const std::string& value) {
return FirebasePush(host_, auth_, path, value, http_.get());
return FirebasePush(host_, auth_, path, value, http_);
}
unique_ptr<FirebasePush> Firebase::pushPtr(const std::string& path, const std::string& value) {
return unique_ptr<FirebasePush>(
new FirebasePush(host_, auth_, path, value, http_.get()));

unique_ptr<FirebasePush> Firebase::pushPtr(const std::string& path, const std::string& value) {
return unique_ptr<FirebasePush>(
new FirebasePush(host_, auth_, path, value, http_));
}

FirebaseRemove Firebase::remove(const std::string& path) {
return FirebaseRemove(host_, auth_, path, http_.get());
return FirebaseRemove(host_, auth_, path, http_);
}

unique_ptr<FirebaseRemove> Firebase::removePtr(const std::string& path) {
return unique_ptr<FirebaseRemove>(
new FirebaseRemove(host_, auth_, path, http_.get()));
unique_ptr<FirebaseRemove> Firebase::removePtr(const std::string& path) {
return unique_ptr<FirebaseRemove>(
new FirebaseRemove(host_, auth_, path, http_));
}

FirebaseStream Firebase::stream(const std::string& path) {
// TODO: create new client dedicated to stream.
return FirebaseStream(host_, auth_, path, http_.get());
return FirebaseStream(host_, auth_, path, http_);
}

unique_ptr<FirebaseStream> Firebase::streamPtr(const std::string& path) {
// TODO: create new client dedicated to stream.
return unique_ptr<FirebaseStream>(
new FirebaseStream(host_, auth_, path, http_.get()));
unique_ptr<FirebaseStream> Firebase::streamPtr(const std::string& path) {
// TODO: create new client dedicated to stream.
return unique_ptr<FirebaseStream>(
new FirebaseStream(host_, auth_, path, http_));
}

// FirebaseCall
FirebaseCall::FirebaseCall(const std::string& host, const std::string& auth,
const char* method, const std::string& path,
const std::string& data, FirebaseHttpClient* http) : http_(http) {
const std::string& data, const std::shared_ptr<FirebaseHttpClient> http) : http_(http) {
std::string path_with_auth = makeFirebaseURL(path, auth);
http_->setReuseConnection(true);
http_->begin(host, path_with_auth);
Expand Down Expand Up @@ -141,22 +143,24 @@ FirebaseCall::~FirebaseCall() {

const JsonObject& FirebaseCall::json() {
//TODO(edcoyne): This is not efficient, we should do something smarter with
//the buffers.
buffer_ = DynamicJsonBuffer();
return buffer_.parseObject(response().c_str());
//the buffers. kotl: Is this still valid?
if (buffer_.get() == NULL) {
buffer_.reset(new StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>());
}
return buffer_.get()->parseObject(response().c_str());
}

// FirebaseGet
FirebaseGet::FirebaseGet(const std::string& host, const std::string& auth,
const std::string& path,
FirebaseHttpClient* http)
const std::shared_ptr<FirebaseHttpClient> http)
: FirebaseCall(host, auth, "GET", path, "", http) {
}

// FirebaseSet
FirebaseSet::FirebaseSet(const std::string& host, const std::string& auth,
const std::string& path, const std::string& value,
FirebaseHttpClient* http)
const std::shared_ptr<FirebaseHttpClient> http)
: FirebaseCall(host, auth, "PUT", path, value, http) {
if (!error()) {
// TODO: parse json
Expand All @@ -167,7 +171,7 @@ FirebaseSet::FirebaseSet(const std::string& host, const std::string& auth,
// FirebasePush
FirebasePush::FirebasePush(const std::string& host, const std::string& auth,
const std::string& path, const std::string& value,
FirebaseHttpClient* http)
const std::shared_ptr<FirebaseHttpClient> http)
: FirebaseCall(host, auth, "POST", path, value, http) {
if (!error()) {
name_ = json()["name"].as<const char*>();
Expand All @@ -177,14 +181,14 @@ FirebasePush::FirebasePush(const std::string& host, const std::string& auth,
// FirebaseRemove
FirebaseRemove::FirebaseRemove(const std::string& host, const std::string& auth,
const std::string& path,
FirebaseHttpClient* http)
const std::shared_ptr<FirebaseHttpClient> http)
: FirebaseCall(host, auth, "DELETE", path, "", http) {
}

// FirebaseStream
FirebaseStream::FirebaseStream(const std::string& host, const std::string& auth,
const std::string& path,
FirebaseHttpClient* http)
const std::shared_ptr<FirebaseHttpClient> http)
: FirebaseCall(host, auth, "STREAM", path, "", http) {
}

Expand Down
24 changes: 13 additions & 11 deletions src/Firebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
#ifndef firebase_h
#define firebase_h

#include "WString.h"
#include <Arduino.h>
#include <memory>
#include <ArduinoJson.h>

#include "FirebaseHttpClient.h"
#include "FirebaseError.h"
#define ARDUINOJSON_USE_ARDUINO_STRING 1
#include "third-party/arduino-json-5.6.7/include/ArduinoJson.h"
#include "FirebaseObject.h"

class FirebaseGet;
class FirebaseSet;
Expand Down Expand Up @@ -65,7 +67,7 @@ class Firebase {
Firebase() {}

private:
std::unique_ptr<FirebaseHttpClient> http_;
std::shared_ptr<FirebaseHttpClient> http_;
std::string host_;
std::string auth_;
};
Expand All @@ -76,7 +78,7 @@ class FirebaseCall {
FirebaseCall(const std::string& host, const std::string& auth,
const char* method, const std::string& path,
const std::string& data = "",
FirebaseHttpClient* http = NULL);
const std::shared_ptr<FirebaseHttpClient> http = NULL);
virtual ~FirebaseCall();

virtual const FirebaseError& error() const {
Expand All @@ -90,17 +92,17 @@ class FirebaseCall {
const JsonObject& json();

protected:
FirebaseHttpClient* http_;
const std::shared_ptr<FirebaseHttpClient> http_;
FirebaseError error_;
std::string response_;
DynamicJsonBuffer buffer_;
std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could simply be statically allocated as
StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE> buffer_ without shared_ptr?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember the details, but I am pretty sure latest version of JSONArduino is very strict on memory allocations so passing this buffer around as-is results in compilation errors.

};

class FirebaseGet : public FirebaseCall {
public:
FirebaseGet() {}
FirebaseGet(const std::string& host, const std::string& auth,
const std::string& path, FirebaseHttpClient* http = NULL);
const std::string& path, const std::shared_ptr<FirebaseHttpClient> http = NULL);

private:
std::string json_;
Expand All @@ -110,7 +112,7 @@ class FirebaseSet: public FirebaseCall {
public:
FirebaseSet() {}
FirebaseSet(const std::string& host, const std::string& auth,
const std::string& path, const std::string& value, FirebaseHttpClient* http = NULL);
const std::string& path, const std::string& value, const std::shared_ptr<FirebaseHttpClient> http = NULL);


private:
Expand All @@ -121,7 +123,7 @@ class FirebasePush : public FirebaseCall {
public:
FirebasePush() {}
FirebasePush(const std::string& host, const std::string& auth,
const std::string& path, const std::string& value, FirebaseHttpClient* http = NULL);
const std::string& path, const std::string& value, const std::shared_ptr<FirebaseHttpClient> http = NULL);
virtual ~FirebasePush() {}

virtual const std::string& name() const {
Expand All @@ -136,15 +138,15 @@ class FirebaseRemove : public FirebaseCall {
public:
FirebaseRemove() {}
FirebaseRemove(const std::string& host, const std::string& auth,
const std::string& path, FirebaseHttpClient* http = NULL);
const std::string& path, const std::shared_ptr<FirebaseHttpClient> http = NULL);
};


class FirebaseStream : public FirebaseCall {
public:
FirebaseStream() {}
FirebaseStream(const std::string& host, const std::string& auth,
const std::string& path, FirebaseHttpClient* http = NULL);
const std::string& path, const std::shared_ptr<FirebaseHttpClient> http = NULL);
virtual ~FirebaseStream() {}

// Return if there is any event available to read.
Expand Down
Loading