mobizt / Firebase-ESP32

[DEPRECATED]🔥 Firebase RTDB Arduino Library for ESP32. The complete, fast, secured and reliable Firebase Arduino client library that supports CRUD (create, read, update, delete) and Stream operations.
MIT License
415 stars 118 forks source link

HELP ..... #63

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi, I would like to thank you for actively maintaining this library. I need one help. I have gone through all the documentation. I'm not able to use a character array in json.set function. I need to send the character array of 7 bytes ( made of numbers) to RTDB as json . Please guide me for the same.

Thanking you in advance, Thank you, Thank you........

mobizt commented 4 years ago

You need to cast char array to constant char array, here the example

   FirebaseJsonArray arr;

  char str[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g','\0'};

  arr.set("/[0]/[1]", (const char*) str);

  Firebase.setArray(firebaseData, "test1", arr);

  arr.clear();

  arr.set(0, (const char *)str);

  Firebase.setArray(firebaseData, "test2", arr);