Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3af3a1a

Browse files
committed
Fixed!
1 parentf08825d commit3af3a1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/FirebaseArduino.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ FirebaseObject FirebaseArduino::readEvent() {
179179
String event = client->readStringUntil('\n').substring(6);
180180
client->readStringUntil('\n');// consume separator
181181
FirebaseObject obj =FirebaseObject(event.c_str());
182-
obj.getJsonVariant().as<JsonObject&>().set("type", type);
182+
183+
// required to have a copy of the string but use a char[] format which is
184+
// the only supported format for JsonObject#set (it does not like the std::string of the test env)
185+
char *cstr =newchar[type.length() +1];
186+
strcpy(cstr, type.c_str());
187+
obj.getJsonVariant().as<JsonObject&>().set("type", cstr);
183188
return obj;
184189
}
185190

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp