SparkJson icon indicating copy to clipboard operation
SparkJson copied to clipboard

StaticJsonBuffer _size grows

Open HaydenDekker opened this issue 8 years ago • 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

HaydenDekker avatar May 09 '17 13:05 HaydenDekker