简体   繁体   English

字符数组作为 json 到 esp32 中的 firebase(arduino IDE)

[英]Character array as json to firebase in esp32 ( arduino IDE)

I'm using Firebase 32 Client ( https://github.com/mobizt/Firebase-ESP32 ) in my project.我在我的项目中使用 Firebase 32 客户端 ( https://github.com/mobizt/Firebase-ESP32 )。 I'm not able to use a character array in json.set function .我无法在 json.set function 中使用字符数组 I need to send the character array of 7 bytes ( made of numbers) to RTDB as json .我需要将 7 个字节(由数字组成)的字符数组作为 json 发送到 RTDB。 Please guide me for the same.请指导我。

You can use the String class to create String object from char array like this.您可以像这样使用 String 类从 char 数组创建 String 对象。

String myString = String(myCharArray); String myString = String(myCharArray);

Use this string with the FirebaseJson function in the Firebase library.将此字符串与 Firebase 库中的 FirebaseJson 函数一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM