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

Commit 1128e67

Browse files
committed
Added back auth() and fixed begin-command to use new Firebase constructor
1 parent ecbefd2 commit 1128e67

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/Firebase.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Firebase::Firebase(const String& host, const String& auth) : host_(host), auth_(
3737
http_->setReuseConnection(true);
3838
}
3939

40+
const String& Firebase::auth() const {
41+
return auth_;
42+
}
43+
4044
FirebaseGet Firebase::get(const String& path) {
4145
return FirebaseGet(host_, auth_, path, http_.get());
4246
}

src/Firebase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class Firebase {
3939
public:
4040
Firebase(const String& host, const String& auth = "");
4141

42+
const String& auth() const;
43+
4244
// Fetch json encoded `value` at `path`.
4345
FirebaseGet get(const String& path);
4446
virtual std::unique_ptr<FirebaseGet> getPtr(const String& path);

src/modem/begin-command.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ bool BeginCommand::execute(const String& command,
3333
return false;
3434
}
3535

36-
new_firebase_.reset(new Firebase(host));
37-
if (auth.length() != 0) {
38-
new_firebase_->auth(auth);
39-
}
36+
new_firebase_.reset(new Firebase(host, auth));
4037

4138
out->println("+OK");
4239
return true;

src/third-party/arduino-json-5.1.1/include/ArduinoJson/Arduino/String.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99

1010
#ifndef ARDUINO
1111

12+
#ifndef ARDUINO_STRING_OVERRIDE
13+
#define ARDUINO_STRING_OVERRIDE
1214
#include <string>
1315
typedef std::string String;
16+
#endif
1417

1518
#else
1619

0 commit comments

Comments
 (0)