menan/SparkJson

StaticJsonBuffer _size grows

HaydenDekker opened this issue · 0 comments

I'm using this on the Electron and I need a fairly hefty buffer of size 8000.

My understanding is that using "StaticJsonBuffer<8000> jsonBuffer" in a function allocates the buffer on a stack so I placed it globally. In fact my device fell over when trying to use it in a function.

The problem then is that the _size never resets so eventually it over runs and fails to resolve. I could use Dynamic but I have a set size packet anyway.

Is there a way to clear the buffer or delete the object and reset the buffer?

Or should I be using DynamicJsonBuffer?

Thankyou Hayden