From e88fc12de836626785bf9396a51752a319fe4cf1 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Wed, 2 Oct 2019 12:26:01 +0300 Subject: [PATCH] Make PrettyAsyncJsonResponse to use maxJsonBufferSize for ArduinoJson 6 (#607) --- src/AsyncJson.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AsyncJson.h b/src/AsyncJson.h index 6118afe..a6c461b 100644 --- a/src/AsyncJson.h +++ b/src/AsyncJson.h @@ -142,7 +142,11 @@ class AsyncJsonResponse: public AsyncAbstractResponse { class PrettyAsyncJsonResponse: public AsyncJsonResponse { public: - PrettyAsyncJsonResponse (bool isArray=false) : AsyncJsonResponse{isArray} {} +#ifdef ARDUINOJSON_5_COMPATIBILITY + PrettyAsyncJsonResponse (bool isArray=false) : AsyncJsonResponse{isArray} {} +#else + PrettyAsyncJsonResponse (bool isArray=false, size_t maxJsonBufferSize = DYNAMIC_JSON_DOCUMENT_SIZE) : AsyncJsonResponse{isArray, maxJsonBufferSize} {} +#endif size_t setLength () { #ifdef ARDUINOJSON_5_COMPATIBILITY _contentLength = _root.measurePrettyLength ();