These are chat archives for SmingHub/Sming

20th
Jan 2019
kmihaylov
@kmihaylov
Jan 20 13:21

Hello. I have two questions.

  1. May someone clarify what advantages gives the use of JsonObjectStream (Sming stream functions) instead of directly using the Arduino Json library with DynamicJsonBuffer. A short example would be nice. Maybe I'm lacking knowledge of what streams are and what is their use in Sming.

  2. If I prefer to use JsonObjectStream it returns the root of a newly created JsonObject -> rootNode(buffer.createObject()). So JsonObjectStream is forcing the user to always create a JsonObject. What happens when a string has to be parsed? How can jsonBuffer.parseObject be called?
    I suggest that the JsonObjectStream constructor should be changed to allow not only creating an empty object, but also for parsing some input? Or maybe there is some way for doing this, but I don't see how.