bblanchon / ArduinoJson

📟 JSON library for Arduino and embedded C++. Simple and efficient.
https://arduinojson.org
MIT License
6.63k stars 1.1k forks source link

V6 Documentation ArduinoJson PubSubClient with StreamUtils #2094

Closed softwarecrash closed 1 month ago

softwarecrash commented 1 month ago

hello, i struggle a bit with this example on https://arduinojson.org/v6/how-to/use-arduinojson-with-pubsubclient/

client.beginPublish(topic, measureJson(doc), retained);
WriteBufferingPrint bufferedClient(client, 32);
serializeJson(doc, bufferedClient);
bufferedClient.flush();
client.endPublish();

it deepens on Streamutils.

but streamutils doesnt have WriteBufferingPrint

so the compiler throws a error like error: 'WriteBufferingPrint' was not declared in this scope

what do i wrong?

ArduinoJson 6.21.3 PubSubClient 2.8 StreamUtils 1.8.0

bblanchon commented 1 month ago

Hi @softwarecrash,

Thank you very much for reporting this issue. It's BufferingPrint, not WriteBufferingPrint.

Best regards, Benoit