puuu / ESPiLight

ESPiLight - pilight 433.92 MHz protocols library for Arduino
GNU General Public License v3.0
110 stars 41 forks source link

ESPiLight.cpp: replace pilight json generation. #30

Closed janLo closed 6 years ago

janLo commented 6 years ago

The pilight jdon generation has the problem that it has a buffer that rets reallocated with twice the size every time it is too small. This causes the ESP to crash if we're <10k of free memory in some cases.

So this replaces this by a simple hand-written json generation that uses in advance how much space it needs.

puuu commented 6 years ago

You reserve one byte to much, because of the missing , of the first element. But accepted.

puuu commented 6 years ago

Thanks! Merged in 6088666793c1ce5ff944e4f01c48b1d18a7bf94d . New release is on the way.