Description

The macro ARDUINOJSON_ENABLE_ARDUINO_STREAM enables the support of Arduino’s Stream class in the library.

Stream defines the interface for byte streams in Arduino. It is the base class of:

The default value of ARDUINOJSON_ENABLE_ARDUINO_STREAM is 1 of ARDUINO is defined, and 0 otherwise. In other words, ArduinoJson supports the Stream class as soon as you work in an Arduino-compatible environment.

How to force the value?

If you need to force the support of Stream, add this at the top of your program:

#define ARDUINOJSON_ENABLE_ARDUINO_STREAM 1
#include <ArduinoJson.h>

On the other hand, if you need to disable Stream, do:

#define ARDUINOJSON_ENABLE_ARDUINO_STREAM 0
#include <ArduinoJson.h>

Only 0 and 1 are valid. Any other value (like false or true) will produce a compilation error.

See also