OPEnSLab-OSU / Loom-V4

Open Source Internet Of Things Rapid Prototyping Framework For Environmental Sensing Applications
12 stars 1 forks source link

Port manager JSON to proper ArduinoJson usage. Using strings to store arduino #122

Closed WL-Richards closed 1 month ago

WL-Richards commented 10 months ago

We currently use a global instance of a DynamicJsonDocument in the Manager to hold our JSON data, which works fine. However, according to the ArduinoJson spec. This is not how we are supposed to do this. We should be storing JSON documents as c-strings and then when we wish to change some value of the document we create a temp. document to read the string in make the change and then write the data back to a "global" string held by the manager.

ZakaryW commented 9 months ago

So I updated how JSON data is being handled. Now whenever the JSON document is need, deserializeJson is called with the doc and jsonStr variable. Likewise, whenever changes have been made to the doc obj, serializeJson is called with the doc and jsonStr variable. So jsonStr is the json data stored as a cstring and is used for mediating changes to the document. Changes are on this branch --> https://github.com/OPEnSLab-OSU/Loom-V4/tree/json-overhaul

udellc commented 4 months ago

@WL-Richards , can we merge this with the Wisp, Chimes branch we're currently using - and plan to have @ZakaryW , @SorenEmmons and @Sarvesh-Thiruppathi test this the DAY it MERGES, to confirm if something is broken or if it works? Let's see some coordination

WL-Richards commented 1 month ago

Closing this as its done, and has been sidelined