From ded26feeb6ba78eef41dd6de4786618f7450df01 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 24 Jul 2023 08:16:37 +0100 Subject: [PATCH] upgrade arduinojson 6.21.3 --- lib/ArduinoJson/CHANGELOG.md | 9 +++++++++ lib/ArduinoJson/README.md | 6 +++--- lib/ArduinoJson/library.properties | 2 +- .../src/ArduinoJson/Deserialization/Reader.hpp | 4 +++- .../src/ArduinoJson/MsgPack/MsgPackSerializer.hpp | 2 +- lib/ArduinoJson/src/ArduinoJson/Namespace.hpp | 9 ++++----- .../src/ArduinoJson/Polyfills/preprocessor.hpp | 4 +--- lib/ArduinoJson/src/ArduinoJson/Variant/VariantImpl.hpp | 5 +++-- lib/ArduinoJson/src/ArduinoJson/version.hpp | 5 +++-- 9 files changed, 28 insertions(+), 18 deletions(-) diff --git a/lib/ArduinoJson/CHANGELOG.md b/lib/ArduinoJson/CHANGELOG.md index f5a9bb0ad..28c506ab2 100644 --- a/lib/ArduinoJson/CHANGELOG.md +++ b/lib/ArduinoJson/CHANGELOG.md @@ -1,6 +1,15 @@ ArduinoJson: change log ======================= +v6.21.3 (2023-07-23) +------- + +* Fix compatibility with the Blynk libary (issue #1914) +* Fix double lookup in `to()` +* Fix double call to `size()` in `serializeMsgPack()` +* Include `ARDUINOJSON_SLOT_OFFSET_SIZE` in the namespace name +* Show a link to the documentation when user passes an unsupported input type + v6.21.2 (2023-04-12) ------- diff --git a/lib/ArduinoJson/README.md b/lib/ArduinoJson/README.md index dbd78a8a2..16d93a3a6 100644 --- a/lib/ArduinoJson/README.md +++ b/lib/ArduinoJson/README.md @@ -8,9 +8,9 @@ [![Continuous Integration](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/6.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) [![Coveralls branch](https://img.shields.io/coveralls/github/bblanchon/ArduinoJson/6.x?logo=coveralls)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) -[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.21.2&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.21.2) -[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.21.2)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.21.2) -[![ESP IDF](https://img.shields.io/static/v1?label=ESP+IDF&message=v6.21.2&logo=cpu&logoColor=white&color=blue)](https://components.espressif.com/components/bblanchon/arduinojson) +[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.21.3&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.21.3) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.21.3)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.21.3) +[![ESP IDF](https://img.shields.io/static/v1?label=ESP+IDF&message=v6.21.3&logo=cpu&logoColor=white&color=blue)](https://components.espressif.com/components/bblanchon/arduinojson) [![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat&logo=github&color=orange)](https://github.com/bblanchon/ArduinoJson/stargazers) [![GitHub Sponsors](https://img.shields.io/github/sponsors/bblanchon?logo=github&color=orange)](https://github.com/sponsors/bblanchon) diff --git a/lib/ArduinoJson/library.properties b/lib/ArduinoJson/library.properties index 414daa469..6a285cf0d 100644 --- a/lib/ArduinoJson/library.properties +++ b/lib/ArduinoJson/library.properties @@ -1,5 +1,5 @@ name=ArduinoJson -version=6.21.2 +version=6.21.3 author=Benoit Blanchon maintainer=Benoit Blanchon sentence=A simple and efficient JSON library for embedded C++. diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp index 5f18c7b30..44437686a 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp @@ -18,7 +18,9 @@ struct Reader { Reader(TSource& source) : source_(&source) {} int read() { - return source_->read(); // Error here? You passed an unsupported input type + // clang-format off + return source_->read(); // Error here? See https://arduinojson.org/v6/invalid-input/ + // clang-format on } size_t readBytes(char* buffer, size_t length) { diff --git a/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp b/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp index 65769a16c..6125330c2 100644 --- a/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp @@ -47,7 +47,7 @@ class MsgPackSerializer : public Visitor { size_t visitArray(const CollectionData& array) { size_t n = array.size(); if (n < 0x10) { - writeByte(uint8_t(0x90 + array.size())); + writeByte(uint8_t(0x90 + n)); } else if (n < 0x10000) { writeByte(0xDC); writeInteger(uint16_t(n)); diff --git a/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp b/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp index 7f3b8b49b..7cce17480 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp @@ -11,16 +11,15 @@ #ifndef ARDUINOJSON_VERSION_NAMESPACE # define ARDUINOJSON_VERSION_NAMESPACE \ - ARDUINOJSON_CONCAT3( \ - ARDUINOJSON_CONCAT4(V, ARDUINOJSON_VERSION_MAJOR, \ - ARDUINOJSON_VERSION_MINOR, \ - ARDUINOJSON_VERSION_REVISION), \ + ARDUINOJSON_CONCAT4( \ + ARDUINOJSON_VERSION_MACRO, \ ARDUINOJSON_BIN2ALPHA( \ ARDUINOJSON_ENABLE_PROGMEM, ARDUINOJSON_USE_LONG_LONG, \ ARDUINOJSON_USE_DOUBLE, ARDUINOJSON_ENABLE_STRING_DEDUPLICATION), \ ARDUINOJSON_BIN2ALPHA( \ ARDUINOJSON_ENABLE_NAN, ARDUINOJSON_ENABLE_INFINITY, \ - ARDUINOJSON_ENABLE_COMMENTS, ARDUINOJSON_DECODE_UNICODE)) + ARDUINOJSON_ENABLE_COMMENTS, ARDUINOJSON_DECODE_UNICODE), \ + ARDUINOJSON_SLOT_OFFSET_SIZE) #endif diff --git a/lib/ArduinoJson/src/ArduinoJson/Polyfills/preprocessor.hpp b/lib/ArduinoJson/src/ArduinoJson/Polyfills/preprocessor.hpp index b91baf74a..36e5c44a4 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Polyfills/preprocessor.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Polyfills/preprocessor.hpp @@ -6,8 +6,6 @@ #define ARDUINOJSON_CONCAT_(A, B) A##B #define ARDUINOJSON_CONCAT2(A, B) ARDUINOJSON_CONCAT_(A, B) -#define ARDUINOJSON_CONCAT3(A, B, C) \ - ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT2(A, B), C) #define ARDUINOJSON_CONCAT4(A, B, C, D) \ ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT2(A, B), ARDUINOJSON_CONCAT2(C, D)) @@ -17,7 +15,7 @@ #define ARDUINOJSON_BIN2ALPHA_0011() D #define ARDUINOJSON_BIN2ALPHA_0100() E #define ARDUINOJSON_BIN2ALPHA_0101() F -#define ARDUINOJSON_BIN2ALPHA_0110() F +#define ARDUINOJSON_BIN2ALPHA_0110() G #define ARDUINOJSON_BIN2ALPHA_0111() H #define ARDUINOJSON_BIN2ALPHA_1000() I #define ARDUINOJSON_BIN2ALPHA_1001() J diff --git a/lib/ArduinoJson/src/ArduinoJson/Variant/VariantImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Variant/VariantImpl.hpp index 66a473bbd..c122a2f45 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Variant/VariantImpl.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Variant/VariantImpl.hpp @@ -138,8 +138,9 @@ template template typename enable_if::value, JsonVariant>::type VariantRefBase::to() const { - variantSetNull(getOrCreateData()); - return *this; + auto data = getOrCreateData(); + variantSetNull(data); + return JsonVariant(getPool(), data); } template diff --git a/lib/ArduinoJson/src/ArduinoJson/version.hpp b/lib/ArduinoJson/src/ArduinoJson/version.hpp index f0ee0afa7..5e6500a46 100644 --- a/lib/ArduinoJson/src/ArduinoJson/version.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/version.hpp @@ -4,7 +4,8 @@ #pragma once -#define ARDUINOJSON_VERSION "6.21.2" +#define ARDUINOJSON_VERSION "6.21.3" #define ARDUINOJSON_VERSION_MAJOR 6 #define ARDUINOJSON_VERSION_MINOR 21 -#define ARDUINOJSON_VERSION_REVISION 2 +#define ARDUINOJSON_VERSION_REVISION 3 +#define ARDUINOJSON_VERSION_MACRO V6213