Added latest ArduinoJson library to third-party folder.

Small (and hopefully working) delay at startup added to avoid boot-loop at startup.
pull/109/head
Holger Wirtz 3 years ago
parent 5545c8a359
commit 49e8def8ee
  1. 1
      MicroDexed.ino
  2. 2
      config.h
  3. 8
      third-party/ArduinoJson/CHANGELOG.md
  4. 2
      third-party/ArduinoJson/CMakeLists.txt
  5. 4
      third-party/ArduinoJson/README.md
  6. 2
      third-party/ArduinoJson/appveyor.yml
  7. 1
      third-party/ArduinoJson/extras/tests/CMakeLists.txt
  8. 29
      third-party/ArduinoJson/extras/tests/Cpp20/CMakeLists.txt
  9. 15
      third-party/ArduinoJson/extras/tests/Cpp20/smoke_test.cpp
  10. 9
      third-party/ArduinoJson/extras/tests/JsonDeserializer/filter.cpp
  11. 19
      third-party/ArduinoJson/extras/tests/JsonDeserializer/string.cpp
  12. 2
      third-party/ArduinoJson/library.json
  13. 2
      third-party/ArduinoJson/library.properties
  14. 4
      third-party/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp
  15. 2
      third-party/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp
  16. 8
      third-party/ArduinoJson/src/ArduinoJson/Json/Utf8.hpp
  17. 3
      third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ArduinoStringAdapter.hpp
  18. 2
      third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ConstRamStringAdapter.hpp
  19. 2
      third-party/ArduinoJson/src/ArduinoJson/Variant/ConverterImpl.hpp
  20. 4
      third-party/ArduinoJson/src/ArduinoJson/version.hpp

@ -378,6 +378,7 @@ extern char seq_chord_names[7][4];
***********************************************************************/ ***********************************************************************/
void setup() void setup()
{ {
delay(50);
#ifdef DEBUG #ifdef DEBUG
Serial.begin(SERIAL_SPEED); Serial.begin(SERIAL_SPEED);
#endif #endif

@ -90,7 +90,7 @@
//************************************************************************************************* //*************************************************************************************************
//* DEBUG OUTPUT SETTINGS //* DEBUG OUTPUT SETTINGS
//************************************************************************************************* //*************************************************************************************************
#define DEBUG 1 //#define DEBUG 1
#define SERIAL_SPEED 230400 #define SERIAL_SPEED 230400
#define SHOW_XRUN 1 #define SHOW_XRUN 1
#define SHOW_CPU_LOAD_MSEC 5000 #define SHOW_CPU_LOAD_MSEC 5000

@ -1,6 +1,14 @@
ArduinoJson: change log ArduinoJson: change log
======================= =======================
v6.18.4 (2021-09-06)
-------
* Fixed error `'dummy' may be used uninitialized` on GCC 11
* Fixed error `expected unqualified-id before 'const'` on GCC 11 (issue #1622)
* Filter: exact match takes precedence over wildcard (issue #1628)
* Fixed deserialization of `\u0000` (issue #1646)
v6.18.3 (2021-07-27) v6.18.3 (2021-07-27)
------- -------

@ -11,7 +11,7 @@ if(ESP_PLATFORM)
return() return()
endif() endif()
project(ArduinoJson VERSION 6.18.3) project(ArduinoJson VERSION 6.18.4)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest) include(CTest)

@ -2,7 +2,7 @@
--- ---
[![arduino-library-badge](https://www.ardu-badge.com/badge/ArduinoJson.svg?version=6.18.3)](https://www.ardu-badge.com/ArduinoJson/6.18.3) [![arduino-library-badge](https://www.ardu-badge.com/badge/ArduinoJson.svg?version=6.18.4)](https://www.ardu-badge.com/ArduinoJson/6.18.4)
[![Continuous Integration](https://github.com/bblanchon/ArduinoJson/workflows/Continuous%20Integration/badge.svg?branch=6.x)](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A6.x) [![Continuous Integration](https://github.com/bblanchon/ArduinoJson/workflows/Continuous%20Integration/badge.svg?branch=6.x)](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A6.x)
[![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) [![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) [![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)
@ -78,7 +78,7 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
* Continuously tested on * Continuously tested on
* [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) * [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
* [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) * [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) * [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) * [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
* Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/) * Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/)

@ -1,4 +1,4 @@
version: 6.18.3.{build} version: 6.18.4.{build}
environment: environment:
matrix: matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019

@ -12,6 +12,7 @@ link_libraries(ArduinoJson catch)
include_directories(Helpers) include_directories(Helpers)
add_subdirectory(Cpp11) add_subdirectory(Cpp11)
add_subdirectory(Cpp17) add_subdirectory(Cpp17)
add_subdirectory(Cpp20)
add_subdirectory(FailingBuilds) add_subdirectory(FailingBuilds)
add_subdirectory(IntegrationTests) add_subdirectory(IntegrationTests)
add_subdirectory(JsonArray) add_subdirectory(JsonArray)

@ -0,0 +1,29 @@
# ArduinoJson - https://arduinojson.org
# Copyright Benoit Blanchon 2014-2021
# MIT License
if(MSVC_VERSION LESS 1910)
return()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
return()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
return()
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(Cpp20Tests
smoke_test.cpp
)
add_test(Cpp20 Cpp20Tests)
set_tests_properties(Cpp20
PROPERTIES
LABELS "Catch"
)

@ -0,0 +1,15 @@
#include <ArduinoJson.h>
#include <catch.hpp>
#include <string>
TEST_CASE("C++20 smoke test") {
StaticJsonDocument<128> doc;
deserializeJson(doc, "{\"hello\":\"world\"}");
REQUIRE(doc["hello"] == "world");
std::string json;
serializeJson(doc, json);
REQUIRE(json == "{\"hello\":\"world\"}");
}

@ -232,6 +232,15 @@ TEST_CASE("Filtering") {
"{\"example\":{\"outcome\":42}}", "{\"example\":{\"outcome\":42}}",
2 * JSON_OBJECT_SIZE(1) + 16 2 * JSON_OBJECT_SIZE(1) + 16
}, },
{
// exclusion filter (issue #1628)
"{\"example\":1,\"ignored\":2}",
"{\"*\":true,\"ignored\":false}",
10,
DeserializationError::Ok,
"{\"example\":1}",
JSON_OBJECT_SIZE(1) + 8
},
{ {
// only the first element of array counts // only the first element of array counts
"[1,2,3]", "[1,2,3]",

@ -46,6 +46,25 @@ TEST_CASE("Valid JSON strings value") {
} }
} }
TEST_CASE("\\u0000") {
StaticJsonDocument<200> doc;
DeserializationError err = deserializeJson(doc, "\"wx\\u0000yz\"");
REQUIRE(err == DeserializationError::Ok);
const char* result = doc.as<const char*>();
CHECK(result[0] == 'w');
CHECK(result[1] == 'x');
CHECK(result[2] == 0);
CHECK(result[3] == 'y');
CHECK(result[4] == 'z');
CHECK(result[5] == 0);
// ArduinoJson strings doesn't store string length, so the following returns 2
// instead of 5 (issue #1646)
CHECK(doc.as<std::string>().size() == 2);
}
TEST_CASE("Truncated JSON string") { TEST_CASE("Truncated JSON string") {
const char* testCases[] = {"\"hello", "\'hello", "'\\u", "'\\u00", "'\\u000"}; const char* testCases[] = {"\"hello", "\'hello", "'\\u", "'\\u00", "'\\u000"};
const size_t testCount = sizeof(testCases) / sizeof(testCases[0]); const size_t testCount = sizeof(testCases) / sizeof(testCases[0]);

@ -7,7 +7,7 @@
"type": "git", "type": "git",
"url": "https://github.com/bblanchon/ArduinoJson.git" "url": "https://github.com/bblanchon/ArduinoJson.git"
}, },
"version": "6.18.3", "version": "6.18.4",
"authors": { "authors": {
"name": "Benoit Blanchon", "name": "Benoit Blanchon",
"url": "https://blog.benoitblanchon.fr" "url": "https://blog.benoitblanchon.fr"

@ -1,5 +1,5 @@
name=ArduinoJson name=ArduinoJson
version=6.18.3 version=6.18.4
author=Benoit Blanchon <blog.benoitblanchon.fr> author=Benoit Blanchon <blog.benoitblanchon.fr>
maintainer=Benoit Blanchon <blog.benoitblanchon.fr> maintainer=Benoit Blanchon <blog.benoitblanchon.fr>
sentence=A simple and efficient JSON library for embedded C++. sentence=A simple and efficient JSON library for embedded C++.

@ -32,8 +32,8 @@ class Filter {
Filter operator[](const TKey& key) const { Filter operator[](const TKey& key) const {
if (_variant == true) // "true" means "allow recursively" if (_variant == true) // "true" means "allow recursively"
return *this; return *this;
else VariantConstRef member = _variant[key];
return Filter(_variant[key] | _variant["*"]); return Filter(member.isNull() ? _variant["*"] : member);
} }
private: private:

@ -17,7 +17,7 @@ struct Reader {
Reader(TSource& source) : _source(&source) {} Reader(TSource& source) : _source(&source) {}
int read() { int read() {
return _source->read(); return _source->read(); // Error here? You passed an unsupported input type
} }
size_t readBytes(char* buffer, size_t length) { size_t readBytes(char* buffer, size_t length) {

@ -13,14 +13,14 @@ template <typename TStringBuilder>
inline void encodeCodepoint(uint32_t codepoint32, TStringBuilder& str) { inline void encodeCodepoint(uint32_t codepoint32, TStringBuilder& str) {
// this function was optimize for code size on AVR // this function was optimize for code size on AVR
if (codepoint32 < 0x80) {
str.append(char(codepoint32));
} else {
// a buffer to store the string in reverse // a buffer to store the string in reverse
char buf[5]; char buf[5];
char* p = buf; char* p = buf;
*(p++) = 0; *(p++) = 0;
if (codepoint32 < 0x80) {
*(p++) = char((codepoint32));
} else {
*(p++) = char((codepoint32 | 0x80) & 0xBF); *(p++) = char((codepoint32 | 0x80) & 0xBF);
uint16_t codepoint16 = uint16_t(codepoint32 >> 6); uint16_t codepoint16 = uint16_t(codepoint32 >> 6);
if (codepoint16 < 0x20) { // 0x800 if (codepoint16 < 0x20) { // 0x800
@ -36,11 +36,11 @@ inline void encodeCodepoint(uint32_t codepoint32, TStringBuilder& str) {
*(p++) = char(codepoint16 | 0xF0); *(p++) = char(codepoint16 | 0xF0);
} }
} }
}
while (*(--p)) { while (*(--p)) {
str.append(*p); str.append(*p);
} }
} }
}
} // namespace Utf8 } // namespace Utf8
} // namespace ARDUINOJSON_NAMESPACE } // namespace ARDUINOJSON_NAMESPACE

@ -45,8 +45,7 @@ class StringAdapter< ::String> {
template <> template <>
class StringAdapter< ::StringSumHelper> : public StringAdapter< ::String> { class StringAdapter< ::StringSumHelper> : public StringAdapter< ::String> {
public: public:
StringAdapter< ::StringSumHelper>(const ::String& s) StringAdapter(const ::String& s) : StringAdapter< ::String>(s) {}
: StringAdapter< ::String>(s) {}
}; };
} // namespace ARDUINOJSON_NAMESPACE } // namespace ARDUINOJSON_NAMESPACE

@ -45,7 +45,7 @@ class StringAdapter<const char*> {
template <int N> template <int N>
class StringAdapter<const char[N]> : public StringAdapter<const char*> { class StringAdapter<const char[N]> : public StringAdapter<const char*> {
public: public:
StringAdapter<const char[N]>(const char* s) : StringAdapter<const char*>(s) {} StringAdapter(const char* s) : StringAdapter<const char*>(s) {}
}; };
} // namespace ARDUINOJSON_NAMESPACE } // namespace ARDUINOJSON_NAMESPACE

@ -27,7 +27,7 @@ struct Converter {
} }
static bool checkJson(VariantConstRef src) { static bool checkJson(VariantConstRef src) {
T dummy; T dummy = T();
// clang-format off // clang-format off
return canConvertFromJson(src, dummy); // Error here? See https://arduinojson.org/v6/unsupported-is/ return canConvertFromJson(src, dummy); // Error here? See https://arduinojson.org/v6/unsupported-is/
// clang-format on // clang-format on

@ -4,7 +4,7 @@
#pragma once #pragma once
#define ARDUINOJSON_VERSION "6.18.3" #define ARDUINOJSON_VERSION "6.18.4"
#define ARDUINOJSON_VERSION_MAJOR 6 #define ARDUINOJSON_VERSION_MAJOR 6
#define ARDUINOJSON_VERSION_MINOR 18 #define ARDUINOJSON_VERSION_MINOR 18
#define ARDUINOJSON_VERSION_REVISION 3 #define ARDUINOJSON_VERSION_REVISION 4

Loading…
Cancel
Save