diff --git a/.gitignore b/.gitignore index b5c2a14..9b884b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,108 +1,6 @@ - -# Created by https://www.gitignore.io/api/clion+all,platformio,visualstudiocode -# Edit at https://www.gitignore.io/?templates=clion+all,platformio,visualstudiocode - -### CLion+all ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/modules.xml -# .idea/*.iml -# .idea/modules - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### CLion+all Patch ### -# Ignores the whole .idea folder and all .iml files -# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 - -.idea/ - -# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 - -*.iml -modules.xml -.idea/misc.xml -*.ipr - -### PlatformIO ### -.pioenvs -.piolibdeps -.clang_complete -.gcc-flags.json -CMakeListsPrivate.txt -CMakeLists.txt -cmake-build-debug - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history - -# End of https://www.gitignore.io/api/clion+all,platformio,visualstudiocode -# -secrets.h +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/extensions.json +.vscode/launch.json +.vscode/ipch diff --git a/.pio/build/project.checksum b/.pio/build/project.checksum deleted file mode 100644 index 33ea39c..0000000 --- a/.pio/build/project.checksum +++ /dev/null @@ -1 +0,0 @@ -d03f253803ab29b9105b4976c1a1c7e882ed3b02 \ No newline at end of file diff --git a/README.md b/README.md index 4f9099d..19c745b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,17 @@ # esp32-keyble +## changes in this fork +Changes in this fork compared to https://github.com/lumokitho/ +* NimBLE is used as bluetooth stack. With this, both WiFi and BLE can be active at the same time +* some smaller changes in the eQ3 library to improve stability (see here and here) +* in file `main.cpp` + * WiFi is kept active + * BLE connection to the keylock is kept active. Doing so, the keylock stays very responsive, but drains more battery + * use of a hardware button connected to GPIO is commented out, because it constantly triggered if no button was connected to the GPIO +* Libraries "ArduinoJson", "AutoConnect", "PageBuilder", and "PubSubClient" are no longer saved as copies in folder "lib", but latest versions are retrieved from GitHub +* esp32 partition table `partitions_ble.csv` was removed (was no longer valid) and replaced with `min_spiffs.csv` (because of size of the firmware) + +## original description + ESP32 port of the keyble library working, with some additions! diff --git a/lib/ArduinoJson/.clang-format b/lib/ArduinoJson/.clang-format deleted file mode 100644 index 63de381..0000000 --- a/lib/ArduinoJson/.clang-format +++ /dev/null @@ -1,9 +0,0 @@ -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html - -BasedOnStyle: Google -Standard: Cpp03 -AllowShortFunctionsOnASingleLine: Empty -IncludeBlocks: Preserve - -# Always break after if to get accurate coverage -AllowShortIfStatementsOnASingleLine: false diff --git a/lib/ArduinoJson/.gitattributes b/lib/ArduinoJson/.gitattributes deleted file mode 100644 index 526c8a3..0000000 --- a/lib/ArduinoJson/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.sh text eol=lf \ No newline at end of file diff --git a/lib/ArduinoJson/.gitignore b/lib/ArduinoJson/.gitignore deleted file mode 100644 index 8a9610f..0000000 --- a/lib/ArduinoJson/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -.DS_Store -/.idea -/build -/bin -/lib -/sftp-config.json -.tags -.tags_sorted_by_file -/extras/fuzzing/*_fuzzer -/extras/fuzzing/*_fuzzer.options -/extras/fuzzing/*_fuzzer_seed_corpus.zip -.vs/ - -# Used by CI for Particle -/src/*.ino -/project.properties diff --git a/lib/ArduinoJson/.mbedignore b/lib/ArduinoJson/.mbedignore deleted file mode 100644 index 9a8a814..0000000 --- a/lib/ArduinoJson/.mbedignore +++ /dev/null @@ -1,3 +0,0 @@ -.github/ -examples/ -extras/ \ No newline at end of file diff --git a/lib/ArduinoJson/.piopm b/lib/ArduinoJson/.piopm deleted file mode 100644 index a535d73..0000000 --- a/lib/ArduinoJson/.piopm +++ /dev/null @@ -1 +0,0 @@ -{"type": "library", "name": "ArduinoJson", "version": "6.18.0", "spec": {"owner": "bblanchon", "id": 64, "name": "ArduinoJson", "requirements": null, "url": null}} \ No newline at end of file diff --git a/lib/ArduinoJson/.prettierignore b/lib/ArduinoJson/.prettierignore deleted file mode 100644 index dd44972..0000000 --- a/lib/ArduinoJson/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -*.md diff --git a/lib/ArduinoJson/ArduinoJson.h b/lib/ArduinoJson/ArduinoJson.h deleted file mode 100644 index ba79dc8..0000000 --- a/lib/ArduinoJson/ArduinoJson.h +++ /dev/null @@ -1,5 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#include "src/ArduinoJson.h" diff --git a/lib/ArduinoJson/CHANGELOG.md b/lib/ArduinoJson/CHANGELOG.md deleted file mode 100644 index ff7c40f..0000000 --- a/lib/ArduinoJson/CHANGELOG.md +++ /dev/null @@ -1,1115 +0,0 @@ -ArduinoJson: change log -======================= - -v6.18.0 (2021-05-05) -------- - -* Added support for custom converters (issue #687) -* Added support for `Printable` (issue #1444) -* Removed support for `char` values, see below (issue #1498) -* `deserializeJson()` leaves `\uXXXX` unchanged instead of returning `NotSupported` -* `deserializeMsgPack()` inserts `null` instead of returning `NotSupported` -* Removed `DeserializationError::NotSupported` -* Added `JsonVariant::is()` (issue #1412) -* Added `JsonVariant::is()` (issue #1412) -* Changed `JsonVariantConst::is()` to return `false` (issue #1412) -* Simplified `JsonVariant::as()` to always return `T` (see below) -* Updated folders list in `.mbedignore` (PR #1515 by @AGlass0fMilk) -* Fixed member-call-on-null-pointer in `getMember()` when array is empty -* `serializeMsgPack(doc, buffer, size)` doesn't add null-terminator anymore (issue #1545) -* `serializeJson(doc, buffer, size)` adds null-terminator only if there is enough room -* PlatformIO: set `build.libArchive` to `false` (PR #1550 by @askreet) - -> ### BREAKING CHANGES -> -> #### Support for `char` removed -> -> We cannot cast a `JsonVariant` to a `char` anymore, so the following will break: -> ```c++ -> char age = doc["age"]; // error: no matching function for call to 'variantAs(VariantData*&)' -> ``` -> Instead, you must use another integral type, such as `int8_t`: -> ```c++ -> int8_t age = doc["age"]; // OK -> ``` -> -> Similarly, we cannot assign from a `char` anymore, so the following will break: -> ```c++ -> char age; -> doc["age"] = age; // error: no matching function for call to 'VariantRef::set(const char&)' -> ``` -> Instead, you must use another integral type, such as `int8_t`: -> ```c++ -> int8_t age; -> doc["age"] = age; // OK -> ``` -> A deprecation warning with the message "Support for `char` is deprecated, use `int8_t` or `uint8_t` instead" was added to allow a smooth transition. -> -> #### `as()` always returns `T` -> -> Previously, `JsonVariant::as()` could return a type different from `T`. -> The most common example is `as()` that returned a `const char*`. -> While this feature simplified a few use cases, it was confusing and complicated the -> implementation of custom converters. -> -> Starting from this version, `as` doesn't try to auto-correct the return type and always return `T`, -> which means that you cannot write this anymore: -> -> ```c++ -> Serial.println(doc["sensor"].as()); // error: invalid conversion from 'const char*' to 'char*' [-fpermissive] -> ``` -> -> Instead, you must write: -> -> ```c++ -> Serial.println(doc["sensor"].as()); // OK -> ``` -> -> A deprecation warning with the message "Replace `as()` with `as()`" was added to allow a smooth transition. -> -> #### `DeserializationError::NotSupported` removed -> -> On a different topic, `DeserializationError::NotSupported` has been removed. -> Instead of returning this error: -> -> * `deserializeJson()` leaves `\uXXXX` unchanged (only when `ARDUINOJSON_DECODE_UNICODE` is `0`) -> * `deserializeMsgPack()` replaces unsupported values with `null`s -> -> #### Const-aware `is()` -> -> Lastly, a very minor change concerns `JsonVariantConst::is()`. -> It used to return `true` for `JsonArray` and `JsonOject`, but now it returns `false`. -> Instead, you must use `JsonArrayConst` and `JsonObjectConst`. - -v6.17.3 (2021-02-15) -------- - -* Made `JsonDocument`'s destructor protected (issue #1480) -* Added missing calls to `client.stop()` in `JsonHttpClient.ino` (issue #1485) -* Fixed error `expected ')' before 'char'` when `isdigit()` is a macro (issue #1487) -* Fixed error `definition of implicit copy constructor is deprecated` on Clang 10 -* PlatformIO: set framework compatibility to `*` (PR #1490 by @maxgerhardt) - -v6.17.2 (2020-11-14) -------- - -* Fixed invalid conversion error in `operator|(JsonVariant, char*)` (issue #1432) -* Changed the default value of `ARDUINOJSON_ENABLE_PROGMEM` (issue #1433). - It now checks that the `pgm_read_XXX` macros are defined before enabling `PROGMEM`. - -v6.17.1 (2020-11-07) -------- - -* Fixed error `ambiguous overload for 'operator|'` (issue #1411) -* Fixed `operator|(MemberProxy, JsonObject)` (issue #1415) -* Allowed more than 32767 values in non-embedded mode (issue #1414) - -v6.17.0 (2020-10-19) -------- - -* Added a build failure when nullptr is defined as a macro (issue #1355) -* Added `JsonDocument::overflowed()` which tells if the memory pool was too small (issue #1358) -* Added `DeserializationError::EmptyInput` which tells if the input was empty -* Added `DeserializationError::f_str()` which returns a `const __FlashStringHelper*` (issue #846) -* Added `operator|(JsonVariantConst, JsonVariantConst)` -* Added filtering for MessagePack (issue #1298, PR #1394 by Luca Passarella) -* Moved float convertion tables to PROGMEM -* Fixed `JsonVariant::set((char*)0)` which returned false instead of true (issue #1368) -* Fixed error `No such file or directory #include ` (issue #1381) - -v6.16.1 (2020-08-04) -------- - -* Fixed `deserializeJson()` that stopped reading after `{}` (issue #1335) - -v6.16.0 (2020-08-01) -------- - -* Added comparisons (`>`, `>=`, `==`, `!=`, `<`, and `<=`) between `JsonVariant`s -* Added string deduplication (issue #1303) -* Added `JsonString::operator!=` -* Added wildcard key (`*`) for filters (issue #1309) -* Set `ARDUINOJSON_DECODE_UNICODE` to `1` by default -* Fixed `copyArray()` not working with `String`, `ElementProxy`, and `MemberProxy` -* Fixed error `getOrAddElement is not a member of ElementProxy` (issue #1311) -* Fixed excessive stack usage when compiled with `-Og` (issues #1210 and #1314) -* Fixed `Warning[Pa093]: implicit conversion from floating point to integer` on IAR compiler (PR #1328 by @stawiski) - -v6.15.2 (2020-05-15) -------- - -* CMake: don't build tests when imported in another project -* CMake: made project arch-independent -* Visual Studio: fixed error C2766 with flag `/Zc:__cplusplus` (issue #1250) -* Added support for `JsonDocument` to `copyArray()` (issue #1255) -* Added support for `enum`s in `as()` and `is()` (issue #1256) -* Added `JsonVariant` as an input type for `deserializeXxx()` - For example, you can do: `deserializeJson(doc2, doc1["payload"])` -* Break the build if using 64-bit integers with ARDUINOJSON_USE_LONG_LONG==0 - -v6.15.1 (2020-04-08) -------- - -* Fixed "maybe-uninitialized" warning (issue #1217) -* Fixed "statement is unreachable" warning on IAR (issue #1233) -* Fixed "pointless integer comparison" warning on IAR (issue #1233) -* Added CMake "install" target (issue #1209) -* Disabled alignment on AVR (issue #1231) - -v6.15.0 (2020-03-22) -------- - -* Added `DeserializationOption::Filter` (issue #959) -* Added example `JsonFilterExample.ino` -* Changed the array subscript operator to automatically add missing elements -* Fixed "deprecated-copy" warning on GCC 9 (fixes #1184) -* Fixed `MemberProxy::set(char[])` not duplicating the string (issue #1191) -* Fixed enums serialized as booleans (issue #1197) -* Fixed incorrect string comparison on some platforms (issue #1198) -* Added move-constructor and move-assignment to `BasicJsonDocument` -* Added `BasicJsonDocument::garbageCollect()` (issue #1195) -* Added `StaticJsonDocument::garbageCollect()` -* Changed copy-constructor of `BasicJsonDocument` to preserve the capacity of the source. -* Removed copy-constructor of `JsonDocument` (issue #1189) - -> ### BREAKING CHANGES -> -> #### Copy-constructor of `BasicJsonDocument` -> -> In previous versions, the copy constructor of `BasicJsonDocument` looked at the source's `memoryUsage()` to choose its capacity. -> Now, the copy constructor of `BasicJsonDocument` uses the same capacity as the source. -> -> Example: -> -> ```c++ -> DynamicJsonDocument doc1(64); -> doc1.set(String("example")); -> -> DynamicJsonDocument doc2 = doc1; -> Serial.print(doc2.capacity()); // 8 with ArduinoJson 6.14 -> // 64 with ArduinoJson 6.15 -> ``` -> -> I made this change to get consistent results between copy-constructor and move-constructor, and whether RVO applies or not. -> -> If you use the copy-constructor to optimize your documents, you can use `garbageCollect()` or `shrinkToFit()` instead. -> -> #### Copy-constructor of `JsonDocument` -> -> In previous versions, it was possible to create a function that take a `JsonDocument` by value. -> -> ```c++ -> void myFunction(JsonDocument doc) {} -> ``` -> -> This function gives the wrong clues because it doesn't receive a copy of the `JsonDocument`, only a sliced version. -> It worked because the copy constructor copied the internal pointers, but it was an accident. -> -> From now, if you need to pass a `JsonDocument` to a function, you must use a reference: -> -> ```c++ -> void myFunction(JsonDocument& doc) {} -> ``` - -v6.14.1 (2020-01-27) -------- - -* Fixed regression in UTF16 decoding (issue #1173) -* Fixed `containsKey()` on `JsonVariantConst` -* Added `getElement()` and `getMember()` to `JsonVariantConst` - -v6.14.0 (2020-01-16) -------- - -* Added `BasicJsonDocument::shrinkToFit()` -* Added support of `uint8_t` for `serializeJson()`, `serializeJsonPretty()`, and `serializeMsgPack()` (issue #1142) -* Added `ARDUINOJSON_ENABLE_COMMENTS` to enable support for comments (defaults to 0) -* Auto enable support for `std::string` and `std::stream` on modern compilers (issue #1156) - (No need to define `ARDUINOJSON_ENABLE_STD_STRING` and `ARDUINOJSON_ENABLE_STD_STREAM` anymore) -* Improved decoding of UTF-16 surrogate pairs (PR #1157 by @kaysievers) - (ArduinoJson now produces standard UTF-8 instead of CESU-8) -* Added `measureJson`, `measureJsonPretty`, and `measureMsgPack` to `keywords.txt` - (This file is used for syntax highlighting in the Arduino IDE) -* Fixed `variant.is()` -* Fixed value returned by `serializeJson()`, `serializeJsonPretty()`, and `serializeMsgPack()` when writing to a `String` -* Improved speed of `serializeJson()`, `serializeJsonPretty()`, and `serializeMsgPack()` when writing to a `String` - -> ### BREAKING CHANGES -> -> #### Comments -> -> Support for comments in input is now optional and disabled by default. -> -> If you need support for comments, you must defined `ARDUINOJSON_ENABLE_COMMENTS` to `1`; otherwise, you'll receive `InvalidInput` errors. -> -> ```c++ -> #define ARDUINOJSON_ENABLE_COMMENTS 1 -> #include -> ``` - -v6.13.0 (2019-11-01) -------- - -* Added support for custom writer/reader classes (issue #1088) -* Added conversion from `JsonArray` and `JsonObject` to `bool`, to be consistent with `JsonVariant` -* Fixed `deserializeJson()` when input contains duplicate keys (issue #1095) -* Improved `deserializeMsgPack()` speed by reading several bytes at once -* Added detection of Atmel AVR8/GNU C Compiler (issue #1112) -* Fixed deserializer that stopped reading at the first `0xFF` (PR #1118 by @mikee47) -* Fixed dangling reference in copies of `MemberProxy` and `ElementProxy` (issue #1120) - -v6.12.0 (2019-09-05) -------- - -* Use absolute instead of relative includes (issue #1072) -* Changed `JsonVariant::as()` to return `true` for any non-null value (issue #1005) -* Moved ancillary files to `extras/` (issue #1011) - -v6.11.5 (2019-08-23) -------- - -* Added fallback implementations of `strlen_P()`, `strncmp_P()`, `strcmp_P()`, and `memcpy_P()` (issue #1073) - -v6.11.4 (2019-08-12) -------- - -* Added `measureJson()` to the `ArduinoJson` namespace (PR #1069 by @nomis) -* Added support for `basic_string` (issue #1045) -* Fixed example `JsonConfigFile.ino` for ESP8266 -* Include `Arduino.h` if `ARDUINO` is defined (PR #1071 by @nomis) - -v6.11.3 (2019-07-22) -------- - -* Added operators `==` and `!=` for `JsonDocument`, `ElementProxy`, and `MemberProxy` -* Fixed comparison of `JsonVariant` when one contains a linked string and the other contains an owned string (issue #1051) - -v6.11.2 (2019-07-08) -------- - -* Fixed assignment of `JsonDocument` to `JsonVariant` (issue #1023) -* Fix invalid conversion error on Particle Argon (issue #1035) - -v6.11.1 (2019-06-21) -------- - -* Fixed `serialized()` not working with Flash strings (issue #1030) - -v6.11.0 (2019-05-26) -------- - -* Fixed `deserializeJson()` silently accepting a `Stream*` (issue #978) -* Fixed invalid result from `operator|` (issue #981) -* Made `deserializeJson()` more picky about trailing characters (issue #980) -* Added `ARDUINOJSON_ENABLE_NAN` (default=0) to enable NaN in JSON (issue #973) -* Added `ARDUINOJSON_ENABLE_INFINITY` (default=0) to enable Infinity in JSON -* Removed implicit conversion in comparison operators (issue #998) -* Added lexicographical comparison for `JsonVariant` -* Added support for `nullptr` (issue #998) - -> ### BREAKING CHANGES -> -> #### NaN and Infinity -> -> The JSON specification allows neither NaN not Infinity, but previous -> versions of ArduinoJson supported it. Now, ArduinoJson behaves like most -> other libraries: a NaN or and Infinity in the `JsonDocument`, becomes -> a `null` in the output JSON. Also, `deserializeJson()` returns -> `InvalidInput` if the JSON document contains NaN or Infinity. -> -> This version still supports NaN and Infinity in JSON documents, but -> it's disabled by default to be compatible with other JSON parsers. -> If you need the old behavior back, define `ARDUINOJSON_ENABLE_NAN` and -> `ARDUINOJSON_ENABLE_INFINITY` to `1`;: -> -> ```c++ -> #define ARDUINOJSON_ENABLE_NAN 1 -> #define ARDUINOJSON_ENABLE_INFINITY 1 -> #include -> ``` -> -> #### The "or" operator -> -> This version slightly changes the behavior of the | operator when the -> variant contains a float and the user requests an integer. -> -> Older versions returned the floating point value truncated. -> Now, it returns the default value. -> -> ```c++ -> // suppose variant contains 1.2 -> int value = variant | 3; -> -> // old behavior: -> value == 1 -> -> // new behavior -> value == 3 -> ``` -> -> If you need the old behavior, you must add `if (variant.is())`. - -v6.10.1 (2019-04-23) -------- - -* Fixed error "attributes are not allowed on a function-definition" -* Fixed `deserializeJson()` not being picky enough (issue #969) -* Fixed error "no matching function for call to write(uint8_t)" (issue #972) - -v6.10.0 (2019-03-22) -------- - -* Fixed an integer overflow in the JSON deserializer -* Added overflow handling in `JsonVariant::as()` and `JsonVariant::is()`. - - `as()` returns `0` if the integer `T` overflows - - `is()` returns `false` if the integer `T` overflows -* Added `BasicJsonDocument` to support custom allocator (issue #876) -* Added `JsonDocument::containsKey()` (issue #938) -* Added `JsonVariant::containsKey()` - -v6.9.1 (2019-03-01) ------- - -* Fixed warning "unused variable" with GCC 4.4 (issue #912) -* Fixed warning "cast increases required alignment" (issue #914) -* Fixed warning "conversion may alter value" (issue #914) -* Fixed naming conflict with "CAPACITY" (issue #839) -* Muted warning "will change in GCC 7.1" (issue #914) -* Added a clear error message for `StaticJsonBuffer` and `DynamicJsonBuffer` -* Marked ArduinoJson.h as a "system header" - -v6.9.0 (2019-02-26) ------- - -* Decode escaped Unicode characters like \u00DE (issue #304, PR #791) - Many thanks to Daniel Schulte (aka @trilader) who implemented this feature. -* Added option ARDUINOJSON_DECODE_UNICODE to enable it -* Converted `JsonArray::copyFrom()/copyTo()` to free functions `copyArray()` -* Renamed `JsonArray::copyFrom()` and `JsonObject::copyFrom()` to `set()` -* Renamed `JsonArray::get()` to `getElement()` -* Renamed `JsonArray::add()` (without arg) to `addElement()` -* Renamed `JsonObject::get()` to `getMember()` -* Renamed `JsonObject::getOrCreate()` to `getOrAddMember()` -* Fixed `JsonVariant::isNull()` not returning `true` after `set((char*)0)` -* Fixed segfault after `variant.set(serialized((char*)0))` -* Detect `IncompleteInput` in `false`, `true`, and `null` -* Added `JsonDocument::size()` -* Added `JsonDocument::remove()` -* Added `JsonVariant::clear()` -* Added `JsonVariant::remove()` - -v6.8.0-beta (2019-01-30) ------------ - -* Import functions in the ArduinoJson namespace to get clearer errors -* Improved syntax highlighting in Arduino IDE -* Removed default capacity of `DynamicJsonDocument` -* `JsonArray::copyFrom()` accepts `JsonArrayConst` -* `JsonVariant::set()` accepts `JsonArrayConst` and `JsonObjectConst` -* `JsonDocument` was missing in the ArduinoJson namespace -* Added `memoryUsage()` to `JsonArray`, `JsonObject`, and `JsonVariant` -* Added `nesting()` to `JsonArray`, `JsonDocument`, `JsonObject`, and `JsonVariant` -* Replaced `JsonDocument::nestingLimit` with an additional parameter - to `deserializeJson()` and `deserializeMsgPack()` -* Fixed uninitialized variant in `JsonDocument` -* Fixed `StaticJsonDocument` copy constructor and copy assignment -* The copy constructor of `DynamicJsonDocument` chooses the capacity according to the memory usage of the source, not from the capacity of the source. -* Added the ability to create/assign a `StaticJsonDocument`/`DynamicJsonDocument` from a `JsonArray`/`JsonObject`/`JsonVariant` -* Added `JsonDocument::isNull()` -* Added `JsonDocument::operator[]` -* Added `ARDUINOJSON_TAB` to configure the indentation character -* Reduced the size of the pretty JSON serializer -* Added `add()`, `createNestedArray()` and `createNestedObject()` to `JsonVariant` -* `JsonVariant` automatically promotes to `JsonObject` or `JsonArray` on write. - Calling `JsonVariant::to()` is not required anymore. -* `JsonDocument` now support the same operations as `JsonVariant`. - Calling `JsonDocument::as()` is not required anymore. -* Fixed example `JsonHttpClient.ino` -* User can now use a `JsonString` as a key or a value - -> ### BREAKING CHANGES -> -> #### `DynamicJsonDocument`'s constructor -> -> The parameter to the constructor of `DynamicJsonDocument` is now mandatory -> -> Old code: -> -> ```c++ -> DynamicJsonDocument doc; -> ``` -> -> New code: -> -> ```c++ -> DynamicJsonDocument doc(1024); -> ``` -> -> #### Nesting limit -> -> `JsonDocument::nestingLimit` was replaced with a new parameter to `deserializeJson()` and `deserializeMsgPack()`. -> -> Old code: -> -> ```c++ -> doc.nestingLimit = 15; -> deserializeJson(doc, input); -> ``` -> -> New code: -> -> ```c++ -> deserializeJson(doc, input, DeserializationOption::NestingLimit(15)); -> ``` - -v6.7.0-beta (2018-12-07) ------------ - -* Removed the automatic expansion of `DynamicJsonDocument`, it now has a fixed capacity. -* Restored the monotonic allocator because the code was getting too big -* Reduced the memory usage -* Reduced the code size -* Renamed `JsonKey` to `JsonString` -* Removed spurious files in the Particle library - -v6.6.0-beta (2018-11-13) ------------ - -* Removed `JsonArray::is(i)` and `JsonArray::set(i,v)` -* Removed `JsonObject::is(k)` and `JsonObject::set(k,v)` -* Replaced `T JsonArray::get(i)` with `JsonVariant JsonArray::get(i)` -* Replaced `T JsonObject::get(k)` with `JsonVariant JsonObject::get(k)` -* Added `JSON_STRING_SIZE()` -* ~~Replacing or removing a value now releases the memory~~ -* Added `DeserializationError::code()` to be used in switch statements (issue #846) - -v6.5.0-beta (2018-10-13) ------------ - -* Added implicit conversion from `JsonArray` and `JsonObject` to `JsonVariant` -* Allow mixed configuration in compilation units (issue #809) -* Fixed object keys not being duplicated -* `JsonPair::key()` now returns a `JsonKey` -* Increased the default capacity of `DynamicJsonDocument` -* Fixed `JsonVariant::is()` (closes #763) -* Added `JsonArrayConst`, `JsonObjectConst`, and `JsonVariantConst` -* Added copy-constructor and copy-assignment-operator for `JsonDocument` (issue #827) - -v6.4.0-beta (2018-09-11) ------------ - -* Copy `JsonArray` and `JsonObject`, instead of storing pointers (issue #780) -* Added `JsonVariant::to()` and `JsonVariant::to()` - -v6.3.0-beta (2018-08-31) ------------ - -* Implemented reference semantics for `JsonVariant` -* Replaced `JsonPair`'s `key` and `value` with `key()` and `value()` -* Fixed `serializeJson(obj[key], dst)` (issue #794) - -> ### BREAKING CHANGES -> -> #### JsonVariant -> -> `JsonVariant` now has a semantic similar to `JsonObject` and `JsonArray`. -> It's a reference to a value stored in the `JsonDocument`. -> As a consequence, a `JsonVariant` cannot be used as a standalone variable anymore. -> -> Old code: -> -> ```c++ -> JsonVariant myValue = 42; -> ``` -> -> New code: -> -> ```c++ -> DynamicJsonDocument doc; -> JsonVariant myValue = doc.to(); -> myValue.set(42); -> ``` -> -> #### JsonPair -> -> Old code: -> -> ```c++ -> for(JsonPair p : myObject) { -> Serial.println(p.key); -> Serial.println(p.value.as()); -> } -> ``` -> -> New code: -> -> ```c++ -> for(JsonPair p : myObject) { -> Serial.println(p.key()); -> Serial.println(p.value().as()); -> } -> ``` -> -> CAUTION: the key is now read only! - -v6.2.3-beta (2018-07-19) ------------ - -* Fixed exception when using Flash strings as object keys (issue #784) - -v6.2.2-beta (2018-07-18) ------------ - -* Fixed `invalid application of 'sizeof' to incomplete type '__FlashStringHelper'` (issue #783) -* Fixed `char[]` not duplicated when passed to `JsonVariant::operator[]` - -v6.2.1-beta (2018-07-17) ------------ - -* Fixed `JsonObject` not inserting keys of type `String` (issue #782) - -v6.2.0-beta (2018-07-12) ------------ - -* Disabled lazy number deserialization (issue #772) -* Fixed `JsonVariant::is()` that returned true for empty strings -* Improved float serialization when `-fsingle-precision-constant` is used -* Renamed function `RawJson()` to `serialized()` -* `serializeMsgPack()` now supports values marked with `serialized()` - -> ### BREAKING CHANGES -> -> #### Non quoted strings -> -> Non quoted strings are now forbidden in values, but they are still allowed in keys. -> For example, `{key:"value"}` is accepted, but `{key:value}` is not. -> -> #### Preformatted values -> -> Old code: -> -> ```c++ -> object["values"] = RawJson("[1,2,3,4]"); -> ``` -> -> New code: -> -> ```c++ -> object["values"] = serialized("[1,2,3,4]"); -> ``` - -v6.1.0-beta (2018-07-02) ------------ - -* Return `JsonArray` and `JsonObject` by value instead of reference (issue #309) -* Replaced `success()` with `isNull()` - -> ### BREAKING CHANGES -> -> Old code: -> -> ```c++ -> JsonObject& obj = doc.to(); -> JsonArray& arr = obj.createNestedArray("key"); -> if (!arr.success()) { -> Serial.println("Not enough memory"); -> return; -> } -> ``` -> -> New code: -> -> ```c++ -> JsonObject obj = doc.to(); -> JsonArray arr = obj.createNestedArray("key"); -> if (arr.isNull()) { -> Serial.println("Not enough memory"); -> return; -> } -> ``` - -v6.0.1-beta (2018-06-11) ------------ - -* Fixed conflicts with `isnan()` and `isinf()` macros (issue #752) - -v6.0.0-beta (2018-06-07) ------------ - -* Added `DynamicJsonDocument` and `StaticJsonDocument` -* Added `deserializeJson()` -* Added `serializeJson()` and `serializeJsonPretty()` -* Added `measureJson()` and `measureJsonPretty()` -* Added `serializeMsgPack()`, `deserializeMsgPack()` and `measureMsgPack()` (issue #358) -* Added example `MsgPackParser.ino` (issue #358) -* Added support for non zero-terminated strings (issue #704) -* Removed `JsonBuffer::parseArray()`, `parseObject()` and `parse()` -* Removed `JsonBuffer::createArray()` and `createObject()` -* Removed `printTo()` and `prettyPrintTo()` -* Removed `measureLength()` and `measurePrettyLength()` -* Removed all deprecated features - -> ### BREAKING CHANGES -> -> #### Deserialization -> -> Old code: -> -> ```c++ -> DynamicJsonBuffer jb; -> JsonObject& obj = jb.parseObject(json); -> if (obj.success()) { -> -> } -> ``` -> -> New code: -> -> ```c++ -> DynamicJsonDocument doc; -> DeserializationError error = deserializeJson(doc, json); -> if (error) { -> -> } -> JsonObject& obj = doc.as(); -> ``` -> -> #### Serialization -> -> Old code: -> -> ```c++ -> DynamicJsonBuffer jb; -> JsonObject& obj = jb.createObject(); -> obj["key"] = "value"; -> obj.printTo(Serial); -> ``` -> -> New code: -> -> ```c++ -> DynamicJsonDocument obj; -> JsonObject& obj = doc.to(); -> obj["key"] = "value"; -> serializeJson(doc, Serial); -> ``` - -v5.13.2 -------- - -* Fixed `JsonBuffer::parse()` not respecting nesting limit correctly (issue #693) -* Fixed inconsistencies in nesting level counting (PR #695 from Zhenyu Wu) -* Fixed null values that could be pass to `strcmp()` (PR #745 from Mike Karlesky) -* Added macros `ARDUINOJSON_VERSION`, `ARDUINOJSON_VERSION_MAJOR`... - -v5.13.1 -------- - -* Fixed `JsonVariant::operator|(int)` that returned the default value if the variant contained a double (issue #675) -* Allowed non-quoted key to contain underscores (issue #665) - -v5.13.0 -------- - -* Changed the rules of string duplication (issue #658) -* `RawJson()` accepts any kind of string and obeys to the same rules for duplication -* Changed the return type of `strdup()` to `const char*` to prevent double duplication -* Marked `strdup()` as deprecated - -> ### New rules for string duplication -> -> | type | duplication | -> |:---------------------------|:------------| -> | const char* | no | -> | char* | ~~no~~ yes | -> | String | yes | -> | std::string | yes | -> | const __FlashStringHelper* | yes | -> -> These new rules make `JsonBuffer::strdup()` useless. - -v5.12.0 -------- - -* Added `JsonVariant::operator|` to return a default value (see below) -* Added a clear error message when compiled as C instead of C++ (issue #629) -* Added detection of MPLAB XC compiler (issue #629) -* Added detection of Keil ARM Compiler (issue #629) -* Added an example that shows how to save and load a configuration file -* Reworked all other examples - -> ### How to use the new feature? -> -> If you have a block like this: -> -> ```c++ -> const char* ssid = root["ssid"]; -> if (!ssid) -> ssid = "default ssid"; -> ``` -> -> You can simplify like that: -> -> ```c++ -> const char* ssid = root["ssid"] | "default ssid"; -> ``` - -v5.11.2 -------- - -* Fixed `DynamicJsonBuffer::clear()` not resetting allocation size (issue #561) -* Fixed incorrect rounding for float values (issue #588) - -v5.11.1 -------- - -* Removed dependency on `PGM_P` as Particle 0.6.2 doesn't define it (issue #546) -* Fixed warning "dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]" -* Fixed warning "floating constant exceeds range of 'float' [-Woverflow]" (issue #544) -* Fixed warning "this statement may fall through" [-Wimplicit-fallthrough=] (issue #539) -* Removed `ARDUINOJSON_DOUBLE_IS_64BITS` as it became useless. -* Fixed too many decimals places in float serialization (issue #543) - -v5.11.0 -------- - -* Made `JsonBuffer` non-copyable (PR #524 by @luisrayas3) -* Added `StaticJsonBuffer::clear()` -* Added `DynamicJsonBuffer::clear()` - -v5.10.1 -------- - -* Fixed IntelliSense errors in Visual Micro (issue #483) -* Fixed compilation in IAR Embedded Workbench (issue #515) -* Fixed reading "true" as a float (issue #516) -* Added `ARDUINOJSON_DOUBLE_IS_64BITS` -* Added `ARDUINOJSON_EMBEDDED_MODE` - -v5.10.0 -------- - -* Removed configurable number of decimal places (issues #288, #427 and #506) -* Changed exponentiation thresholds to `1e7` and `1e-5` (issues #288, #427 and #506) -* `JsonVariant::is()` now returns `true` for integers -* Fixed error `IsBaseOf is not a member of ArduinoJson::TypeTraits` (issue #495) -* Fixed error `forming reference to reference` (issue #495) - -> ### BREAKING CHANGES :warning: -> -> | Old syntax | New syntax | -> |:--------------------------------|:--------------------| -> | `double_with_n_digits(3.14, 2)` | `3.14` | -> | `float_with_n_digits(3.14, 2)` | `3.14f` | -> | `obj.set("key", 3.14, 2)` | `obj["key"] = 3.14` | -> | `arr.add(3.14, 2)` | `arr.add(3.14)` | -> -> | Input | Old output | New output | -> |:----------|:-----------|:-----------| -> | `3.14159` | `3.14` | `3.14159` | -> | `42.0` | `42.00` | `42` | -> | `0.0` | `0.00` | `0` | -> -> | Expression | Old result | New result | -> |:-------------------------------|:-----------|:-----------| -> | `JsonVariant(42).is()` | `true` | `true` | -> | `JsonVariant(42).is()` | `false` | `true` | -> | `JsonVariant(42).is()` | `false` | `true` | - -v5.9.0 ------- - -* Added `JsonArray::remove(iterator)` (issue #479) -* Added `JsonObject::remove(iterator)` -* Renamed `JsonArray::removeAt(size_t)` into `remove(size_t)` -* Renamed folder `include/` to `src/` -* Fixed warnings `floating constant exceeds range of float`and `floating constant truncated to zero` (issue #483) -* Removed `Print` class and converted `printTo()` to a template method (issue #276) -* Removed example `IndentedPrintExample.ino` -* Now compatible with Particle 0.6.1, thanks to Jacob Nite (issue #294 and PR #461 by @foodbag) - -v5.8.4 ------- - -* Added custom implementation of `strtod()` (issue #453) -* Added custom implementation of `strtol()` (issue #465) -* `char` is now treated as an integral type (issue #337, #370) - -v5.8.3 ------- - -* Fixed an access violation in `DynamicJsonBuffer` when memory allocation fails (issue #433) -* Added operators `==` and `!=` for two `JsonVariant`s (issue #436) -* Fixed `JsonVariant::operator[const FlashStringHelper*]` (issue #441) - -v5.8.2 ------- - -* Fixed parsing of comments (issue #421) -* Fixed ignored `Stream` timeout (issue #422) -* Made sure we don't read more that necessary (issue #422) -* Fixed error when the key of a `JsonObject` is a `char[]` (issue #423) -* Reduced code size when using `const` references -* Fixed error with string of type `unsigned char*` (issue #428) -* Added `deprecated` attribute on `asArray()`, `asObject()` and `asString()` (issue #420) - -v5.8.1 ------- - -* Fixed error when assigning a `volatile int` to a `JsonVariant` (issue #415) -* Fixed errors with Variable Length Arrays (issue #416) -* Fixed error when both `ARDUINOJSON_ENABLE_STD_STREAM` and `ARDUINOJSON_ENABLE_ARDUINO_STREAM` are set to `1` -* Fixed error "Stream does not name a type" (issue #412) - -v5.8.0 ------- - -* Added operator `==` to compare `JsonVariant` and strings (issue #402) -* Added support for `Stream` (issue #300) -* Reduced memory consumption by not duplicating spaces and comments - -> ### BREAKING CHANGES :warning: -> -> `JsonBuffer::parseObject()` and `JsonBuffer::parseArray()` have been pulled down to the derived classes `DynamicJsonBuffer` and `StaticJsonBufferBase`. -> -> This means that if you have code like: -> -> ```c++ -> void myFunction(JsonBuffer& jsonBuffer); -> ``` -> -> you need to replace it with one of the following: -> -> ```c++ -> void myFunction(DynamicJsonBuffer& jsonBuffer); -> void myFunction(StaticJsonBufferBase& jsonBuffer); -> template void myFunction(TJsonBuffer& jsonBuffer); -> ``` - -v5.7.3 ------- - -* Added an `printTo(char[N])` and `prettyPrintTo(char[N])` (issue #292) -* Added ability to set a nested value like this: `root["A"]["B"] = "C"` (issue #352) -* Renamed `*.ipp` to `*Impl.hpp` because they were ignored by Arduino IDE (issue #396) - -v5.7.2 ------- - -* Made PROGMEM available on more platforms (issue #381) -* Fixed PROGMEM causing an exception on ESP8266 (issue #383) - -v5.7.1 ------- - -* Added support for PROGMEM (issue #76) -* Fixed compilation error when index is not an `int` (issue #381) - -v5.7.0 ------- - -* Templatized all functions using `String` or `std::string` -* Removed `ArduinoJson::String` -* Removed `JsonVariant::defaultValue()` -* Removed non-template `JsonObject::get()` and `JsonArray.get()` -* Fixed support for `StringSumHelper` (issue #184) -* Replaced `ARDUINOJSON_USE_ARDUINO_STRING` by `ARDUINOJSON_ENABLE_STD_STRING` and `ARDUINOJSON_ENABLE_ARDUINO_STRING` (issue #378) -* Added example `StringExample.ino` to show where `String` can be used -* Increased default nesting limit to 50 when compiled for a computer (issue #349) - -> ### BREAKING CHANGES :warning: -> -> The non-template functions `JsonObject::get()` and `JsonArray.get()` have been removed. This means that you need to explicitely tell the type you expect in return. -> -> Old code: -> -> ```c++ -> #define ARDUINOJSON_USE_ARDUINO_STRING 0 -> JsonVariant value1 = myObject.get("myKey"); -> JsonVariant value2 = myArray.get(0); -> ``` -> -> New code: -> -> ```c++ -> #define ARDUINOJSON_ENABLE_ARDUINO_STRING 0 -> #define ARDUINOJSON_ENABLE_STD_STRING 1 -> JsonVariant value1 = myObject.get("myKey"); -> JsonVariant value2 = myArray.get(0); -> ``` - -v5.6.7 ------- - -* Fixed `array[idx].as()` and `object[key].as()` -* Fixed return value of `JsonObject::set()` (issue #350) -* Fixed undefined behavior in `Prettyfier` and `Print` (issue #354) -* Fixed parser that incorrectly rejected floats containing a `+` (issue #349) - -v5.6.6 ------- - -* Fixed `-Wparentheses` warning introduced in v5.6.5 (PR #335 by @nuket) -* Added `.mbedignore` for ARM mbdeb (PR #334 by @nuket) -* Fixed `JsonVariant::success()` which didn't propagate `JsonArray::success()` nor `JsonObject::success()` (issue #342). - -v5.6.5 ------- - -* `as()` now returns `true` when input is `null` (issue #330) - -v5.6.4 ------- - -* Fixed error in float serialization (issue #324) - -v5.6.3 ------- - -* Improved speed of float serialization (about twice faster) -* Added `as()` as a synonym for `as()`... (issue #291) -* Fixed `call of overloaded isinf(double&) is ambiguous` (issue #284) - -v5.6.2 ------- - -* Fixed build when another lib does `#undef isnan` (issue #284) - -v5.6.1 ------- - -* Added missing `#pragma once` (issue #310) - -v5.6.0 ------- - -* ArduinoJson is now a header-only library (issue #199) - -v5.5.1 ------- - -* Fixed compilation error with Intel Galileo (issue #299) - -v5.5.0 ------- - -* Added `JsonVariant::success()` (issue #279) -* Renamed `JsonVariant::invalid()` to `JsonVariant::defaultValue()` - -v5.4.0 ------- - -* Changed `::String` to `ArduinoJson::String` (issue #275) -* Changed `::Print` to `ArduinoJson::Print` too - -v5.3.0 ------- - -* Added custom implementation of `ftoa` (issues #266, #267, #269 and #270) -* Added `JsonVariant JsonBuffer::parse()` (issue #265) -* Fixed `unsigned long` printed as `signed long` (issue #170) - -v5.2.0 ------- - -* Added `JsonVariant::as()` as a synonym for `JsonVariant::as()` (issue #257) -* Added example `JsonHttpClient` (issue #256) -* Added `JsonArray::copyTo()` and `JsonArray::copyFrom()` (issue #254) -* Added `RawJson()` to insert pregenerated JSON portions (issue #259) - -v5.1.1 ------- - -* Removed `String` duplication when one replaces a value in a `JsonObject` (PR #232 by @ulion) - -v5.1.0 ------- - -* Added support of `long long` (issue #171) -* Moved all build settings to `ArduinoJson/Configuration.hpp` - -> ### BREAKING CHANGE :warning: -> -> If you defined `ARDUINOJSON_ENABLE_STD_STREAM`, you now need to define it to `1`. - -v5.0.8 ------- - -* Made the library compatible with [PlatformIO](http://platformio.org/) (issue #181) -* Fixed `JsonVariant::is()` that was incorrectly returning false (issue #214) - -v5.0.7 ------- - -* Made library easier to use from a CMake project: simply `add_subdirectory(ArduinoJson/src)` -* Changed `String` to be a `typedef` of `std::string` (issues #142 and #161) - -> ### BREAKING CHANGES :warning: -> -> - `JsonVariant(true).as()` now returns `"true"` instead of `"1"` -> - `JsonVariant(false).as()` now returns `"false"` instead of `"0"` - -v5.0.6 ------- - -* Added parameter to `DynamicJsonBuffer` constructor to set initial size (issue #152) -* Fixed warning about library category in Arduino 1.6.6 (issue #147) -* Examples: Added a loop to wait for serial port to be ready (issue #156) - -v5.0.5 ------- - -* Added overload `JsonObjectSuscript::set(value, decimals)` (issue #143) -* Use `float` instead of `double` to reduce the size of `JsonVariant` (issue #134) - -v5.0.4 ------- - -* Fixed ambiguous overload with `JsonArraySubscript` and `JsonObjectSubscript` (issue #122) - -v5.0.3 ------- - -* Fixed `printTo(String)` which wrote numbers instead of strings (issue #120) -* Fixed return type of `JsonArray::is()` and some others (issue #121) - -v5.0.2 ------- - -* Fixed segmentation fault in `parseObject(String)` and `parseArray(String)`, when the - `StaticJsonBuffer` is too small to hold a copy of the string -* Fixed Clang warning "register specifier is deprecated" (issue #102) -* Fixed GCC warning "declaration shadows a member" (issue #103) -* Fixed memory alignment, which made ESP8266 crash (issue #104) -* Fixed compilation on Visual Studio 2010 and 2012 (issue #107) - -v5.0.1 ------- - -* Fixed compilation with Arduino 1.0.6 (issue #99) - -v5.0.0 ------- - -* Added support of `String` class (issues #55, #56, #70, #77) -* Added `JsonBuffer::strdup()` to make a copy of a string (issues #10, #57) -* Implicitly call `strdup()` for `String` but not for `char*` (issues #84, #87) -* Added support of non standard JSON input (issue #44) -* Added support of comments in JSON input (issue #88) -* Added implicit cast between numerical types (issues #64, #69, #93) -* Added ability to read number values as string (issue #90) -* Redesigned `JsonVariant` to leverage converting constructors instead of assignment operators (issue #66) -* Switched to new the library layout (requires Arduino 1.0.6 or above) - -> ### BREAKING CHANGES :warning: -> -> - `JsonObject::add()` was renamed to `set()` -> - `JsonArray::at()` and `JsonObject::at()` were renamed to `get()` -> - Number of digits of floating point value are now set with `double_with_n_digits()` - -**Personal note about the `String` class**: -Support of the `String` class has been added to the library because many people use it in their programs. -However, you should not see this as an invitation to use the `String` class. -The `String` class is **bad** because it uses dynamic memory allocation. -Compared to static allocation, it compiles to a bigger, slower program, and is less predictable. -You certainly don't want that in an embedded environment! diff --git a/lib/ArduinoJson/CONTRIBUTING.md b/lib/ArduinoJson/CONTRIBUTING.md deleted file mode 100644 index d32a04f..0000000 --- a/lib/ArduinoJson/CONTRIBUTING.md +++ /dev/null @@ -1,10 +0,0 @@ -# Contribution to ArduinoJson - -First, thank you for taking the time to contribute to this project. - -You can submit changes via GitHub Pull Requests. - -Please: - -1. Update the test suite for any change of behavior -2. Use clang-format in "file" mode to format the code diff --git a/lib/ArduinoJson/LICENSE.md b/lib/ArduinoJson/LICENSE.md deleted file mode 100644 index bfe3ec5..0000000 --- a/lib/ArduinoJson/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -The MIT License (MIT) ---------------------- - -Copyright © 2014-2021 Benoit BLANCHON - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lib/ArduinoJson/README.md b/lib/ArduinoJson/README.md deleted file mode 100644 index 91000a3..0000000 --- a/lib/ArduinoJson/README.md +++ /dev/null @@ -1,140 +0,0 @@ -![ArduinoJson](banner.svg) - ---- - -[![arduino-library-badge](https://www.ardu-badge.com/badge/ArduinoJson.svg?version=6.18.0)](https://www.ardu-badge.com/ArduinoJson/6.18.0) -[![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) -[![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) -[![Coverage Status](https://coveralls.io/repos/github/bblanchon/ArduinoJson/badge.svg?branch=6.x)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) -[![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat)](https://github.com/bblanchon/ArduinoJson/stargazers) - -ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). - -## Features - -* [JSON deserialization](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme) - * [Optionally decodes UTF-16 escape sequences to UTF-8](https://arduinojson.org/v6/api/config/decode_unicode/?utm_source=github&utm_medium=readme) - * [Optionally stores links to the input buffer (zero-copy)](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme) - * [Optionally supports comments in the input](https://arduinojson.org/v6/api/config/enable_comments/?utm_source=github&utm_medium=readme) - * [Optionally filters the input to keep only desired values](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme#filtering) - * Supports single quotes as a string delimiter - * Compatible with [NDJSON](http://ndjson.org/) and [JSON Lines](https://jsonlines.org/) -* [JSON serialization](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme) - * [Can write to a buffer or a stream](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme) - * [Optionally indents the document (prettified JSON)](https://arduinojson.org/v6/api/json/serializejsonpretty/?utm_source=github&utm_medium=readme) -* [MessagePack serialization](https://arduinojson.org/v6/api/msgpack/serializemsgpack/?utm_source=github&utm_medium=readme) -* [MessagePack deserialization](https://arduinojson.org/v6/api/msgpack/deserializemsgpack/?utm_source=github&utm_medium=readme) -* Efficient - * [Twice smaller than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/?utm_source=github&utm_medium=readme) - * [Almost 10% faster than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/?utm_source=github&utm_medium=readme) - * [Consumes roughly 10% less RAM than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/?utm_source=github&utm_medium=readme) - * [Fixed memory allocation, no heap fragmentation](https://arduinojson.org/v6/api/jsondocument/?utm_source=github&utm_medium=readme) - * [Optionally works without heap memory (zero malloc)](https://arduinojson.org/v6/api/staticjsondocument/?utm_source=github&utm_medium=readme) - * Deduplicates strings -* Versatile - * [Supports custom allocators (to use external RAM chip, for example)](https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/?utm_source=github&utm_medium=readme) - * Supports [Arduino's `String`](https://arduinojson.org/v6/api/config/enable_arduino_string/?utm_source=github&utm_medium=readme) and [STL's `std::string`](https://arduinojson.org/v6/api/config/enable_std_string/?utm_source=github&utm_medium=readme) - * Supports [Arduino's `Stream`](https://arduinojson.org/v6/api/config/enable_arduino_stream/?utm_source=github&utm_medium=readme) and [STL's `std::istream`/`std::ostream`](https://arduinojson.org/v6/api/config/enable_std_stream/?utm_source=github&utm_medium=readme) - * [Supports Flash strings](https://arduinojson.org/v6/api/config/enable_progmem/?utm_source=github&utm_medium=readme) - * Supports [custom readers](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme#custom-reader) and [custom writers](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme#custom-writer) - * Supports custom converters -* Portable - * Usable on any C++ project (not limited to Arduino) - * Compatible with C++98 - * Zero warnings with `-Wall -Wextra -pedantic` and `/W4` - * [Header-only library](https://en.wikipedia.org/wiki/Header-only) - * Works with virtually any board - * Arduino boards: [Uno](https://amzn.to/38aL2ik), [Due](https://amzn.to/36YkWi2), [Micro](https://amzn.to/35WkdwG), [Nano](https://amzn.to/2QTvwRX), [Mega](https://amzn.to/36XWhuf), [Yun](https://amzn.to/30odURc), [Leonardo](https://amzn.to/36XWjlR)... - * Espressif chips: [ESP8266](https://amzn.to/36YluV8), [ESP32](https://amzn.to/2G4pRCB) - * Lolin (WeMos) boards: [D1 mini](https://amzn.to/2QUpz7q), [D1 Mini Pro](https://amzn.to/36UsGSs)... - * Teensy boards: [4.0](https://amzn.to/30ljXGq), [3.2](https://amzn.to/2FT0EuC), [2.0](https://amzn.to/2QXUMXj) - * Particle boards: [Argon](https://amzn.to/2FQHa9X), [Boron](https://amzn.to/36WgLUd), [Electron](https://amzn.to/30vEc4k), [Photon](https://amzn.to/387F9Cd)... - * Texas Instruments boards: [MSP430](https://amzn.to/30nJWgg)... - * Tested on all major development environments - * [Arduino IDE](https://www.arduino.cc/en/Main/Software) - * [Atmel Studio](http://www.atmel.com/microsite/atmel-studio/) - * [Atollic TrueSTUDIO](https://atollic.com/truestudio/) - * [Energia](http://energia.nu/) - * [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/) - * [Keil uVision](http://www.keil.com/) - * [MPLAB X IDE](http://www.microchip.com/mplab/mplab-x-ide) - * [Particle](https://www.particle.io/) - * [PlatformIO](http://platformio.org/) - * [Sloeber plugin for Eclipse](https://eclipse.baeyens.it/) - * [Visual Micro](http://www.visualmicro.com/) - * [Visual Studio](https://www.visualstudio.com/) - * [Even works with online compilers like wandbox.org](https://wandbox.org/permlink/RlZSKy17DjJ6HcdN) - * [CMake friendly](https://arduinojson.org/v6/how-to/use-arduinojson-with-cmake/?utm_source=github&utm_medium=readme) -* Well designed - * [Elegant API](http://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme) - * [Thread-safe](https://en.wikipedia.org/wiki/Thread_safety) - * Self-contained (no external dependency) - * `const` friendly - * [`for` friendly](https://arduinojson.org/v6/api/jsonobject/begin_end/?utm_source=github&utm_medium=readme) - * [TMP friendly](https://en.wikipedia.org/wiki/Template_metaprogramming) - * Handles [integer overflows](https://arduinojson.org/v6/api/jsonvariant/as/?utm_source=github&utm_medium=readme#integer-overflows) -* Well tested - * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) - * Continuously tested on - * [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) - * [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) -* Well documented - * [Tutorials](https://arduinojson.org/v6/doc/deserialization/?utm_source=github&utm_medium=readme) - * [Examples](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme) - * [How-tos](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme) - * [FAQ](https://arduinojson.org/v6/faq/?utm_source=github&utm_medium=readme) - * [Book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme) - * [Changelog](CHANGELOG.md) -* Vibrant user community - * Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories) and [PlatformIO](https://platformio.org/lib/search) - * [Used in hundreds of projects](https://www.hackster.io/search?i=projects&q=arduinojson) - * [Responsive support](https://github.com/bblanchon/ArduinoJson/issues?q=is%3Aissue+is%3Aclosed) - -## Quickstart - -### Deserialization - -Here is a program that parses a JSON document with ArduinoJson. - -```c++ -char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; - -DynamicJsonDocument doc(1024); -deserializeJson(doc, json); - -const char* sensor = doc["sensor"]; -long time = doc["time"]; -double latitude = doc["data"][0]; -double longitude = doc["data"][1]; -``` - -See the [tutorial on arduinojson.org](https://arduinojson.org/doc/decoding/?utm_source=github&utm_medium=readme) - -### Serialization - -Here is a program that generates a JSON document with ArduinoJson: - -```c++ -DynamicJsonDocument doc(1024); - -doc["sensor"] = "gps"; -doc["time"] = 1351824120; -doc["data"][0] = 48.756080; -doc["data"][1] = 2.302038; - -serializeJson(doc, Serial); -// This prints: -// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]} -``` - -See the [tutorial on arduinojson.org](https://arduinojson.org/doc/encoding/?utm_source=github&utm_medium=readme) - -## Support the project - -Do you like this library? Please [star this project on GitHub](https://github.com/bblanchon/ArduinoJson/stargazers)! - -What? You don't like it but you *love* it? -We don't take donations anymore, but [we sell a book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme), so you can help and learn at the same time. diff --git a/lib/ArduinoJson/SUPPORT.md b/lib/ArduinoJson/SUPPORT.md deleted file mode 100644 index c47e1b1..0000000 --- a/lib/ArduinoJson/SUPPORT.md +++ /dev/null @@ -1,27 +0,0 @@ -# ArduinoJson Support - -First off, thank you very much for using ArduinoJson. - -We'll be very happy to help you, but first please read the following. - -## Before asking for help - -1. Read the [FAQ](https://arduinojson.org/faq/?utm_source=github&utm_medium=support) -2. Search in the [API Reference](https://arduinojson.org/api/?utm_source=github&utm_medium=support) - -If you did not find the answer, please create a [new issue on GitHub](https://github.com/bblanchon/ArduinoJson/issues/new). - -It is OK to add a comment to a currently opened issue, but please avoid adding comments to a closed issue. - -## Before hitting the Submit button - -Please provide all the relevant information: - -* Good title -* Short description of the problem -* Target platform -* Compiler model and version -* [MVCE](https://stackoverflow.com/help/mcve) -* Compiler output - -Good questions get fast answers! diff --git a/lib/ArduinoJson/appveyor.yml b/lib/ArduinoJson/appveyor.yml deleted file mode 100644 index 957e10d..0000000 --- a/lib/ArduinoJson/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 6.18.0.{build} -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - CMAKE_GENERATOR: Visual Studio 16 2019 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - CMAKE_GENERATOR: Visual Studio 15 2017 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CMAKE_GENERATOR: Visual Studio 14 2015 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - CMAKE_GENERATOR: Visual Studio 12 2013 - - CMAKE_GENERATOR: Visual Studio 11 2012 - - CMAKE_GENERATOR: Visual Studio 10 2010 - - CMAKE_GENERATOR: MinGW Makefiles -configuration: Debug -before_build: -- set PATH=C:\MinGW\bin;%PATH:C:\Program Files\Git\usr\bin;=% # Workaround for CMake not wanting sh.exe on PATH for MinGW -- cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%CMAKE_GENERATOR%" . -build_script: -- cmake --build . --config %CONFIGURATION% -test_script: -- ctest -C %CONFIGURATION% --output-on-failure . diff --git a/lib/ArduinoJson/banner.svg b/lib/ArduinoJson/banner.svg deleted file mode 100644 index 5176096..0000000 --- a/lib/ArduinoJson/banner.svg +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/ArduinoJson/component.mk b/lib/ArduinoJson/component.mk deleted file mode 100644 index dc25d1c..0000000 --- a/lib/ArduinoJson/component.mk +++ /dev/null @@ -1 +0,0 @@ -COMPONENT_ADD_INCLUDEDIRS := src diff --git a/lib/ArduinoJson/examples/JsonConfigFile/JsonConfigFile.ino b/lib/ArduinoJson/examples/JsonConfigFile/JsonConfigFile.ino deleted file mode 100644 index 88d3f13..0000000 --- a/lib/ArduinoJson/examples/JsonConfigFile/JsonConfigFile.ino +++ /dev/null @@ -1,160 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to store your project configuration in a file. -// It uses the SD library but can be easily modified for any other file-system. -// -// The file contains a JSON document with the following content: -// { -// "hostname": "examples.com", -// "port": 2731 -// } -// -// To run this program, you need an SD card connected to the SPI bus as follows: -// * MOSI <-> pin 11 -// * MISO <-> pin 12 -// * CLK <-> pin 13 -// * CS <-> pin 4 -// -// https://arduinojson.org/v6/example/config/ - -#include -#include -#include - -// Our configuration structure. -// -// Never use a JsonDocument to store the configuration! -// A JsonDocument is *not* a permanent storage; it's only a temporary storage -// used during the serialization phase. See: -// https://arduinojson.org/v6/faq/why-must-i-create-a-separate-config-object/ -struct Config { - char hostname[64]; - int port; -}; - -const char *filename = "/config.txt"; // <- SD library uses 8.3 filenames -Config config; // <- global configuration object - -// Loads the configuration from a file -void loadConfiguration(const char *filename, Config &config) { - // Open file for reading - File file = SD.open(filename); - - // Allocate a temporary JsonDocument - // Don't forget to change the capacity to match your requirements. - // Use https://arduinojson.org/v6/assistant to compute the capacity. - StaticJsonDocument<512> doc; - - // Deserialize the JSON document - DeserializationError error = deserializeJson(doc, file); - if (error) - Serial.println(F("Failed to read file, using default configuration")); - - // Copy values from the JsonDocument to the Config - config.port = doc["port"] | 2731; - strlcpy(config.hostname, // <- destination - doc["hostname"] | "example.com", // <- source - sizeof(config.hostname)); // <- destination's capacity - - // Close the file (Curiously, File's destructor doesn't close the file) - file.close(); -} - -// Saves the configuration to a file -void saveConfiguration(const char *filename, const Config &config) { - // Delete existing file, otherwise the configuration is appended to the file - SD.remove(filename); - - // Open file for writing - File file = SD.open(filename, FILE_WRITE); - if (!file) { - Serial.println(F("Failed to create file")); - return; - } - - // Allocate a temporary JsonDocument - // Don't forget to change the capacity to match your requirements. - // Use https://arduinojson.org/assistant to compute the capacity. - StaticJsonDocument<256> doc; - - // Set the values in the document - doc["hostname"] = config.hostname; - doc["port"] = config.port; - - // Serialize JSON to file - if (serializeJson(doc, file) == 0) { - Serial.println(F("Failed to write to file")); - } - - // Close the file - file.close(); -} - -// Prints the content of a file to the Serial -void printFile(const char *filename) { - // Open file for reading - File file = SD.open(filename); - if (!file) { - Serial.println(F("Failed to read file")); - return; - } - - // Extract each characters by one by one - while (file.available()) { - Serial.print((char)file.read()); - } - Serial.println(); - - // Close the file - file.close(); -} - -void setup() { - // Initialize serial port - Serial.begin(9600); - while (!Serial) continue; - - // Initialize SD library - const int chipSelect = 4; - while (!SD.begin(chipSelect)) { - Serial.println(F("Failed to initialize SD library")); - delay(1000); - } - - // Should load default config if run for the first time - Serial.println(F("Loading configuration...")); - loadConfiguration(filename, config); - - // Create configuration file - Serial.println(F("Saving configuration...")); - saveConfiguration(filename, config); - - // Dump config file - Serial.println(F("Print config file...")); - printFile(filename); -} - -void loop() { - // not used in this example -} - -// Performance issue? -// ------------------ -// -// File is an unbuffered stream, which is not optimal for ArduinoJson. -// See: https://arduinojson.org/v6/how-to/improve-speed/ - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any -// serialization or deserialization problem. -// -// The book "Mastering ArduinoJson" contains a case study of a project that has -// a complex configuration with nested members. -// Contrary to this example, the project in the book uses the SPIFFS filesystem. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/JsonFilterExample/JsonFilterExample.ino b/lib/ArduinoJson/examples/JsonFilterExample/JsonFilterExample.ino deleted file mode 100644 index 927a628..0000000 --- a/lib/ArduinoJson/examples/JsonFilterExample/JsonFilterExample.ino +++ /dev/null @@ -1,63 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to use DeserializationOpion::Filter -// -// https://arduinojson.org/v6/example/filter/ - -#include - -void setup() { - // Initialize serial port - Serial.begin(9600); - while (!Serial) continue; - - // The huge input: an extract from OpenWeatherMap response - const __FlashStringHelper* input_json = F( - "{\"cod\":\"200\",\"message\":0,\"list\":[{\"dt\":1581498000,\"main\":{" - "\"temp\":3.23,\"feels_like\":-3.63,\"temp_min\":3.23,\"temp_max\":4.62," - "\"pressure\":1014,\"sea_level\":1014,\"grnd_level\":1010,\"humidity\":" - "58,\"temp_kf\":-1.39},\"weather\":[{\"id\":800,\"main\":\"Clear\"," - "\"description\":\"clear " - "sky\",\"icon\":\"01d\"}],\"clouds\":{\"all\":0},\"wind\":{\"speed\":6." - "19,\"deg\":266},\"sys\":{\"pod\":\"d\"},\"dt_txt\":\"2020-02-12 " - "09:00:00\"},{\"dt\":1581508800,\"main\":{\"temp\":6.09,\"feels_like\":-" - "1.07,\"temp_min\":6.09,\"temp_max\":7.13,\"pressure\":1015,\"sea_" - "level\":1015,\"grnd_level\":1011,\"humidity\":48,\"temp_kf\":-1.04}," - "\"weather\":[{\"id\":800,\"main\":\"Clear\",\"description\":\"clear " - "sky\",\"icon\":\"01d\"}],\"clouds\":{\"all\":9},\"wind\":{\"speed\":6." - "64,\"deg\":268},\"sys\":{\"pod\":\"d\"},\"dt_txt\":\"2020-02-12 " - "12:00:00\"}],\"city\":{\"id\":2643743,\"name\":\"London\",\"coord\":{" - "\"lat\":51.5085,\"lon\":-0.1257},\"country\":\"GB\",\"population\":" - "1000000,\"timezone\":0,\"sunrise\":1581492085,\"sunset\":1581527294}}"); - - // The filter: it contains "true" for each value we want to keep - StaticJsonDocument<200> filter; - filter["list"][0]["dt"] = true; - filter["list"][0]["main"]["temp"] = true; - - // Deserialize the document - StaticJsonDocument<400> doc; - deserializeJson(doc, input_json, DeserializationOption::Filter(filter)); - - // Print the result - serializeJsonPretty(doc, Serial); -} - -void loop() { - // not used in this example -} - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any -// deserialization problem. -// -// The book "Mastering ArduinoJson" contains a tutorial on deserialization. -// It begins with a simple example, like the one above, and then adds more -// features like deserializing directly from a file or an HTTP request. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino b/lib/ArduinoJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino deleted file mode 100644 index 9abcea0..0000000 --- a/lib/ArduinoJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino +++ /dev/null @@ -1,77 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to generate a JSON document with ArduinoJson. -// -// https://arduinojson.org/v6/example/generator/ - -#include - -void setup() { - // Initialize Serial port - Serial.begin(9600); - while (!Serial) continue; - - // Allocate the JSON document - // - // Inside the brackets, 200 is the RAM allocated to this document. - // Don't forget to change this value to match your requirement. - // Use https://arduinojson.org/v6/assistant to compute the capacity. - StaticJsonDocument<200> doc; - - // StaticJsonObject allocates memory on the stack, it can be - // replaced by DynamicJsonDocument which allocates in the heap. - // - // DynamicJsonDocument doc(200); - - // Add values in the document - // - doc["sensor"] = "gps"; - doc["time"] = 1351824120; - - // Add an array. - // - JsonArray data = doc.createNestedArray("data"); - data.add(48.756080); - data.add(2.302038); - - // Generate the minified JSON and send it to the Serial port. - // - serializeJson(doc, Serial); - // The above line prints: - // {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]} - - // Start a new line - Serial.println(); - - // Generate the prettified JSON and send it to the Serial port. - // - serializeJsonPretty(doc, Serial); - // The above line prints: - // { - // "sensor": "gps", - // "time": 1351824120, - // "data": [ - // 48.756080, - // 2.302038 - // ] - // } -} - -void loop() { - // not used in this example -} - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any -// serialization problem. -// -// The book "Mastering ArduinoJson" contains a tutorial on serialization. -// It begins with a simple example, like the one above, and then adds more -// features like serializing directly to a file or an HTTP request. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/JsonHttpClient/JsonHttpClient.ino b/lib/ArduinoJson/examples/JsonHttpClient/JsonHttpClient.ino deleted file mode 100644 index 032e3c5..0000000 --- a/lib/ArduinoJson/examples/JsonHttpClient/JsonHttpClient.ino +++ /dev/null @@ -1,126 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to parse a JSON document in an HTTP response. -// It uses the Ethernet library, but can be easily adapted for Wifi. -// -// It performs a GET resquest on https://arduinojson.org/example.json -// Here is the expected response: -// { -// "sensor": "gps", -// "time": 1351824120, -// "data": [ -// 48.756080, -// 2.302038 -// ] -// } -// -// https://arduinojson.org/v6/example/http-client/ - -#include -#include -#include - -void setup() { - // Initialize Serial port - Serial.begin(9600); - while (!Serial) continue; - - // Initialize Ethernet library - byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; - if (!Ethernet.begin(mac)) { - Serial.println(F("Failed to configure Ethernet")); - return; - } - delay(1000); - - Serial.println(F("Connecting...")); - - // Connect to HTTP server - EthernetClient client; - client.setTimeout(10000); - if (!client.connect("arduinojson.org", 80)) { - Serial.println(F("Connection failed")); - return; - } - - Serial.println(F("Connected!")); - - // Send HTTP request - client.println(F("GET /example.json HTTP/1.0")); - client.println(F("Host: arduinojson.org")); - client.println(F("Connection: close")); - if (client.println() == 0) { - Serial.println(F("Failed to send request")); - client.stop(); - return; - } - - // Check HTTP status - char status[32] = {0}; - client.readBytesUntil('\r', status, sizeof(status)); - // It should be "HTTP/1.0 200 OK" or "HTTP/1.1 200 OK" - if (strcmp(status + 9, "200 OK") != 0) { - Serial.print(F("Unexpected response: ")); - Serial.println(status); - client.stop(); - return; - } - - // Skip HTTP headers - char endOfHeaders[] = "\r\n\r\n"; - if (!client.find(endOfHeaders)) { - Serial.println(F("Invalid response")); - client.stop(); - return; - } - - // Allocate the JSON document - // Use https://arduinojson.org/v6/assistant to compute the capacity. - const size_t capacity = JSON_OBJECT_SIZE(3) + JSON_ARRAY_SIZE(2) + 60; - DynamicJsonDocument doc(capacity); - - // Parse JSON object - DeserializationError error = deserializeJson(doc, client); - if (error) { - Serial.print(F("deserializeJson() failed: ")); - Serial.println(error.f_str()); - client.stop(); - return; - } - - // Extract values - Serial.println(F("Response:")); - Serial.println(doc["sensor"].as()); - Serial.println(doc["time"].as()); - Serial.println(doc["data"][0].as(), 6); - Serial.println(doc["data"][1].as(), 6); - - // Disconnect - client.stop(); -} - -void loop() { - // not used in this example -} - -// Performance issue? -// ------------------ -// -// EthernetClient is an unbuffered stream, which is not optimal for ArduinoJson. -// See: https://arduinojson.org/v6/how-to/improve-speed/ - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any -// serialization problem. -// -// The book "Mastering ArduinoJson" contains a tutorial on deserialization -// showing how to parse the response from GitHub's API. In the last chapter, -// it shows how to parse the huge documents from OpenWeatherMap -// and Reddit. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/JsonParserExample/JsonParserExample.ino b/lib/ArduinoJson/examples/JsonParserExample/JsonParserExample.ino deleted file mode 100644 index 36bf59f..0000000 --- a/lib/ArduinoJson/examples/JsonParserExample/JsonParserExample.ino +++ /dev/null @@ -1,80 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to deserialize a JSON document with ArduinoJson. -// -// https://arduinojson.org/v6/example/parser/ - -#include - -void setup() { - // Initialize serial port - Serial.begin(9600); - while (!Serial) continue; - - // Allocate the JSON document - // - // Inside the brackets, 200 is the capacity of the memory pool in bytes. - // Don't forget to change this value to match your JSON document. - // Use https://arduinojson.org/v6/assistant to compute the capacity. - StaticJsonDocument<200> doc; - - // StaticJsonDocument allocates memory on the stack, it can be - // replaced by DynamicJsonDocument which allocates in the heap. - // - // DynamicJsonDocument doc(200); - - // JSON input string. - // - // Using a char[], as shown here, enables the "zero-copy" mode. This mode uses - // the minimal amount of memory because the JsonDocument stores pointers to - // the input buffer. - // If you use another type of input, ArduinoJson must copy the strings from - // the input to the JsonDocument, so you need to increase the capacity of the - // JsonDocument. - char json[] = - "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; - - // Deserialize the JSON document - DeserializationError error = deserializeJson(doc, json); - - // Test if parsing succeeds. - if (error) { - Serial.print(F("deserializeJson() failed: ")); - Serial.println(error.f_str()); - return; - } - - // Fetch values. - // - // Most of the time, you can rely on the implicit casts. - // In other case, you can do doc["time"].as(); - const char* sensor = doc["sensor"]; - long time = doc["time"]; - double latitude = doc["data"][0]; - double longitude = doc["data"][1]; - - // Print values. - Serial.println(sensor); - Serial.println(time); - Serial.println(latitude, 6); - Serial.println(longitude, 6); -} - -void loop() { - // not used in this example -} - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any -// deserialization problem. -// -// The book "Mastering ArduinoJson" contains a tutorial on deserialization. -// It begins with a simple example, like the one above, and then adds more -// features like deserializing directly from a file or an HTTP request. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/JsonServer/JsonServer.ino b/lib/ArduinoJson/examples/JsonServer/JsonServer.ino deleted file mode 100644 index 2c46dd5..0000000 --- a/lib/ArduinoJson/examples/JsonServer/JsonServer.ino +++ /dev/null @@ -1,117 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to implement an HTTP server that sends a JSON document -// in the response. -// It uses the Ethernet library but can be easily adapted for Wifi. -// -// The JSON document contains the values of the analog and digital pins. -// It looks like that: -// { -// "analog": [0, 76, 123, 158, 192, 205], -// "digital": [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0] -// } -// -// https://arduinojson.org/v6/example/http-server/ - -#include -#include -#include - -byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; -EthernetServer server(80); - -void setup() { - // Initialize serial port - Serial.begin(9600); - while (!Serial) continue; - - // Initialize Ethernet libary - if (!Ethernet.begin(mac)) { - Serial.println(F("Failed to initialize Ethernet library")); - return; - } - - // Start to listen - server.begin(); - - Serial.println(F("Server is ready.")); - Serial.print(F("Please connect to http://")); - Serial.println(Ethernet.localIP()); -} - -void loop() { - // Wait for an incomming connection - EthernetClient client = server.available(); - - // Do we have a client? - if (!client) - return; - - Serial.println(F("New client")); - - // Read the request (we ignore the content in this example) - while (client.available()) client.read(); - - // Allocate a temporary JsonDocument - // Use https://arduinojson.org/v6/assistant to compute the capacity. - StaticJsonDocument<500> doc; - - // Create the "analog" array - JsonArray analogValues = doc.createNestedArray("analog"); - for (int pin = 0; pin < 6; pin++) { - // Read the analog input - int value = analogRead(pin); - - // Add the value at the end of the array - analogValues.add(value); - } - - // Create the "digital" array - JsonArray digitalValues = doc.createNestedArray("digital"); - for (int pin = 0; pin < 14; pin++) { - // Read the digital input - int value = digitalRead(pin); - - // Add the value at the end of the array - digitalValues.add(value); - } - - Serial.print(F("Sending: ")); - serializeJson(doc, Serial); - Serial.println(); - - // Write response headers - client.println(F("HTTP/1.0 200 OK")); - client.println(F("Content-Type: application/json")); - client.println(F("Connection: close")); - client.print(F("Content-Length: ")); - client.println(measureJsonPretty(doc)); - client.println(); - - // Write JSON document - serializeJsonPretty(doc, client); - - // Disconnect - client.stop(); -} - -// Performance issue? -// ------------------ -// -// EthernetClient is an unbuffered stream, which is not optimal for ArduinoJson. -// See: https://arduinojson.org/v6/how-to/improve-speed/ - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any -// serialization problem. -// -// The book "Mastering ArduinoJson" contains a tutorial on serialization. -// It begins with a simple example, then adds more features like serializing -// directly to a file or an HTTP client. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino b/lib/ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino deleted file mode 100644 index ffa8414..0000000 --- a/lib/ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino +++ /dev/null @@ -1,106 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to send a JSON document to a UDP socket. -// At regular interval, it sends a UDP packet that contains the status of -// analog and digital pins. -// It looks like that: -// { -// "analog": [0, 76, 123, 158, 192, 205], -// "digital": [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0] -// } -// -// If you want to test this program, you need to be able to receive the UDP -// packets. -// For example, you can run netcat on your computer -// $ ncat -ulp 8888 -// See https://nmap.org/ncat/ -// -// https://arduinojson.org/v6/example/udp-beacon/ - -#include -#include -#include - -byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; -IPAddress remoteIp(192, 168, 0, 108); // <- EDIT!!!! -unsigned short remotePort = 8888; -unsigned short localPort = 8888; -EthernetUDP udp; - -void setup() { - // Initialize serial port - Serial.begin(9600); - while (!Serial) continue; - - // Initialize Ethernet libary - if (!Ethernet.begin(mac)) { - Serial.println(F("Failed to initialize Ethernet library")); - return; - } - - // Enable UDP - udp.begin(localPort); -} - -void loop() { - // Allocate a temporary JsonDocument - // Use https://arduinojson.org/v6/assistant to compute the capacity. - StaticJsonDocument<500> doc; - - // Create the "analog" array - JsonArray analogValues = doc.createNestedArray("analog"); - for (int pin = 0; pin < 6; pin++) { - // Read the analog input - int value = analogRead(pin); - - // Add the value at the end of the array - analogValues.add(value); - } - - // Create the "digital" array - JsonArray digitalValues = doc.createNestedArray("digital"); - for (int pin = 0; pin < 14; pin++) { - // Read the digital input - int value = digitalRead(pin); - - // Add the value at the end of the array - digitalValues.add(value); - } - - // Log - Serial.print(F("Sending to ")); - Serial.print(remoteIp); - Serial.print(F(" on port ")); - Serial.println(remotePort); - serializeJson(doc, Serial); - - // Send UDP packet - udp.beginPacket(remoteIp, remotePort); - serializeJson(doc, udp); - udp.println(); - udp.endPacket(); - - // Wait - delay(10000); -} - -// Performance issue? -// ------------------ -// -// EthernetUDP is an unbuffered stream, which is not optimal for ArduinoJson. -// See: https://arduinojson.org/v6/how-to/improve-speed/ - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any -// serialization problem. -// -// The book "Mastering ArduinoJson" contains a tutorial on serialization. -// It begins with a simple example, then adds more features like serializing -// directly to a file or any stream. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/MsgPackParser/MsgPackParser.ino b/lib/ArduinoJson/examples/MsgPackParser/MsgPackParser.ino deleted file mode 100644 index e7da098..0000000 --- a/lib/ArduinoJson/examples/MsgPackParser/MsgPackParser.ino +++ /dev/null @@ -1,75 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows how to deserialize a MessagePack document with -// ArduinoJson. -// -// https://arduinojson.org/v6/example/msgpack-parser/ - -#include - -void setup() { - // Initialize serial port - Serial.begin(9600); - while (!Serial) continue; - - // Allocate the JSON document - // - // Inside the brackets, 200 is the capacity of the memory pool in bytes. - // Don't forget to change this value to match your JSON document. - // Use https://arduinojson.org/v6/assistant to compute the capacity. - StaticJsonDocument<200> doc; - - // StaticJsonObject allocates memory on the stack, it can be - // replaced by DynamicJsonObject which allocates in the heap. - // - // DynamicJsonObject doc(200); - - // MessagePack input string. - // - // Using a char[], as shown here, enables the "zero-copy" mode. This mode uses - // the minimal amount of memory because the JsonDocument stores pointers to - // the input buffer. - // If you use another type of input, ArduinoJson must copy the strings from - // the input to the JsonDocument, so you need to increase the capacity of the - // JsonDocument. - uint8_t input[] = {131, 166, 115, 101, 110, 115, 111, 114, 163, 103, 112, 115, - 164, 116, 105, 109, 101, 206, 80, 147, 50, 248, 164, 100, - 97, 116, 97, 146, 203, 64, 72, 96, 199, 58, 188, 148, - 112, 203, 64, 2, 106, 146, 230, 33, 49, 169}; - // This MessagePack document contains: - // { - // "sensor": "gps", - // "time": 1351824120, - // "data": [48.75608, 2.302038] - // } - - DeserializationError error = deserializeMsgPack(doc, input); - - // Test if parsing succeeded. - if (error) { - Serial.print("deserializeMsgPack() failed: "); - Serial.println(error.f_str()); - return; - } - - // Fetch values. - // - // Most of the time, you can rely on the implicit casts. - // In other case, you can do doc["time"].as(); - const char* sensor = doc["sensor"]; - long time = doc["time"]; - double latitude = doc["data"][0]; - double longitude = doc["data"][1]; - - // Print values. - Serial.println(sensor); - Serial.println(time); - Serial.println(latitude, 6); - Serial.println(longitude, 6); -} - -void loop() { - // not used in this example -} diff --git a/lib/ArduinoJson/examples/ProgmemExample/ProgmemExample.ino b/lib/ArduinoJson/examples/ProgmemExample/ProgmemExample.ino deleted file mode 100644 index 203c888..0000000 --- a/lib/ArduinoJson/examples/ProgmemExample/ProgmemExample.ino +++ /dev/null @@ -1,72 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows the different ways you can use Flash strings with -// ArduinoJson. -// -// Use Flash strings sparingly, because ArduinoJson duplicates them in the -// JsonDocument. Prefer plain old char*, as they are more efficient in term of -// code size, speed, and memory usage. -// -// https://arduinojson.org/v6/example/progmem/ - -#include - -void setup() { -#ifdef PROGMEM // <- check that Flash strings are supported - - DynamicJsonDocument doc(1024); - - // You can use a Flash String as your JSON input. - // WARNING: the strings in the input will be duplicated in the JsonDocument. - deserializeJson(doc, F("{\"sensor\":\"gps\",\"time\":1351824120," - "\"data\":[48.756080,2.302038]}")); - JsonObject obj = doc.as(); - - // You can use a Flash String to get an element of a JsonObject - // No duplication is done. - long time = obj[F("time")]; - - // You can use a Flash String to set an element of a JsonObject - // WARNING: the content of the Flash String will be duplicated in the - // JsonDocument. - obj[F("time")] = time; - - // You can set a Flash String to a JsonObject or JsonArray: - // WARNING: the content of the Flash String will be duplicated in the - // JsonDocument. - obj["sensor"] = F("gps"); - - // It works with serialized() too: - obj["sensor"] = serialized(F("\"gps\"")); - obj["sensor"] = serialized(F("\xA3gps"), 3); - - // You can compare the content of a JsonVariant to a Flash String - if (obj["sensor"] == F("gps")) { - // ... - } - -#else - -#warning PROGMEM is not supported on this platform - -#endif -} - -void loop() { - // not used in this example -} - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any memory -// problem. -// -// The book "Mastering ArduinoJson" contains a quick C++ course that explains -// how your microcontroller stores strings in memory. It also tells why you -// should not abuse Flash strings with ArduinoJson. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/examples/StringExample/StringExample.ino b/lib/ArduinoJson/examples/StringExample/StringExample.ino deleted file mode 100644 index 22330f5..0000000 --- a/lib/ArduinoJson/examples/StringExample/StringExample.ino +++ /dev/null @@ -1,77 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License -// -// This example shows the different ways you can use String with ArduinoJson. -// -// Use String objects sparingly, because ArduinoJson duplicates them in the -// JsonDocument. Prefer plain old char[], as they are more efficient in term of -// code size, speed, and memory usage. -// -// https://arduinojson.org/v6/example/string/ - -#include - -void setup() { - DynamicJsonDocument doc(1024); - - // You can use a String as your JSON input. - // WARNING: the string in the input will be duplicated in the JsonDocument. - String input = - "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; - deserializeJson(doc, input); - JsonObject obj = doc.as(); - - // You can use a String to get an element of a JsonObject - // No duplication is done. - long time = obj[String("time")]; - - // You can use a String to set an element of a JsonObject - // WARNING: the content of the String will be duplicated in the JsonDocument. - obj[String("time")] = time; - - // You can get a String from a JsonObject or JsonArray: - // No duplication is done, at least not in the JsonDocument. - String sensor = obj["sensor"]; - - // Unfortunately, the following doesn't work (issue #118): - // sensor = obj["sensor"]; // <- error "ambiguous overload for 'operator='" - // As a workaround, you need to replace by: - sensor = obj["sensor"].as(); - - // You can set a String to a JsonObject or JsonArray: - // WARNING: the content of the String will be duplicated in the JsonDocument. - obj["sensor"] = sensor; - - // It works with serialized() too: - obj["sensor"] = serialized(sensor); - - // You can also concatenate strings - // WARNING: the content of the String will be duplicated in the JsonDocument. - obj[String("sen") + "sor"] = String("gp") + "s"; - - // You can compare the content of a JsonObject with a String - if (obj["sensor"] == sensor) { - // ... - } - - // Lastly, you can print the resulting JSON to a String - String output; - serializeJson(doc, output); -} - -void loop() { - // not used in this example -} - -// See also -// -------- -// -// https://arduinojson.org/ contains the documentation for all the functions -// used above. It also includes an FAQ that will help you solve any problem. -// -// The book "Mastering ArduinoJson" contains a quick C++ course that explains -// how your microcontroller stores strings in memory. On several occasions, it -// shows how you can avoid String in your program. -// Learn more at https://arduinojson.org/book/ -// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤ diff --git a/lib/ArduinoJson/keywords.txt b/lib/ArduinoJson/keywords.txt deleted file mode 100644 index 3dff06b..0000000 --- a/lib/ArduinoJson/keywords.txt +++ /dev/null @@ -1,40 +0,0 @@ -# Macros -JSON_ARRAY_SIZE KEYWORD2 -JSON_OBJECT_SIZE KEYWORD2 -JSON_STRING_SIZE KEYWORD2 - -# Free functions -deserializeJson KEYWORD2 -deserializeMsgPack KEYWORD2 -serialized KEYWORD2 -serializeJson KEYWORD2 -serializeJsonPretty KEYWORD2 -serializeMsgPack KEYWORD2 -measureJson KEYWORD2 -measureJsonPretty KEYWORD2 -measureMsgPack KEYWORD2 - -# Methods -add KEYWORD2 -as KEYWORD2 -createNestedArray KEYWORD2 -createNestedObject KEYWORD2 -get KEYWORD2 -set KEYWORD2 -to KEYWORD2 - -# Type names -DeserializationError KEYWORD1 DATA_TYPE -DynamicJsonDocument KEYWORD1 DATA_TYPE -JsonArray KEYWORD1 DATA_TYPE -JsonArrayConst KEYWORD1 DATA_TYPE -JsonDocument KEYWORD1 DATA_TYPE -JsonFloat KEYWORD1 DATA_TYPE -JsonInteger KEYWORD1 DATA_TYPE -JsonObject KEYWORD1 DATA_TYPE -JsonObjectConst KEYWORD1 DATA_TYPE -JsonString KEYWORD1 DATA_TYPE -JsonUInt KEYWORD1 DATA_TYPE -JsonVariant KEYWORD1 DATA_TYPE -JsonVariantConst KEYWORD1 DATA_TYPE -StaticJsonDocument KEYWORD1 DATA_TYPE diff --git a/lib/ArduinoJson/library.json b/lib/ArduinoJson/library.json deleted file mode 100644 index 4d6d60e..0000000 --- a/lib/ArduinoJson/library.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "ArduinoJson", - "keywords": "json, rest, http, web", - "description": "A simple and efficient JSON library for embedded C++. ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation.", - "homepage": "https://arduinojson.org/?utm_source=meta&utm_medium=library.json", - "repository": { - "type": "git", - "url": "https://github.com/bblanchon/ArduinoJson.git" - }, - "version": "6.18.0", - "authors": { - "name": "Benoit Blanchon", - "url": "https://blog.benoitblanchon.fr" - }, - "exclude": [ - ".github", - "extras" - ], - "frameworks": "*", - "platforms": "*", - "build": { - "libArchive": false - } -} diff --git a/lib/ArduinoJson/library.properties b/lib/ArduinoJson/library.properties deleted file mode 100644 index c6b2d90..0000000 --- a/lib/ArduinoJson/library.properties +++ /dev/null @@ -1,11 +0,0 @@ -name=ArduinoJson -version=6.18.0 -author=Benoit Blanchon -maintainer=Benoit Blanchon -sentence=A simple and efficient JSON library for embedded C++. -paragraph=ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation. -category=Data Processing -url=https://arduinojson.org/?utm_source=meta&utm_medium=library.properties -architectures=* -repository=https://github.com/bblanchon/ArduinoJson.git -license=MIT diff --git a/lib/ArduinoJson/src/ArduinoJson.h b/lib/ArduinoJson/src/ArduinoJson.h deleted file mode 100644 index 2984c23..0000000 --- a/lib/ArduinoJson/src/ArduinoJson.h +++ /dev/null @@ -1,17 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#ifdef __cplusplus - -#include "ArduinoJson.hpp" - -using namespace ArduinoJson; - -#else - -#error ArduinoJson requires a C++ compiler, please change file extension to .cc or .cpp - -#endif diff --git a/lib/ArduinoJson/src/ArduinoJson.hpp b/lib/ArduinoJson/src/ArduinoJson.hpp deleted file mode 100644 index 28d42ee..0000000 --- a/lib/ArduinoJson/src/ArduinoJson.hpp +++ /dev/null @@ -1,73 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include "ArduinoJson/Configuration.hpp" - -#if !ARDUINOJSON_DEBUG -#ifdef __clang__ -#pragma clang system_header -#elif defined __GNUC__ -#pragma GCC system_header -#endif -#endif - -#include "ArduinoJson/Array/ArrayRef.hpp" -#include "ArduinoJson/Object/ObjectRef.hpp" -#include "ArduinoJson/Variant/VariantRef.hpp" - -#include "ArduinoJson/Document/DynamicJsonDocument.hpp" -#include "ArduinoJson/Document/StaticJsonDocument.hpp" - -#include "ArduinoJson/Array/ArrayImpl.hpp" -#include "ArduinoJson/Array/ElementProxy.hpp" -#include "ArduinoJson/Array/Utilities.hpp" -#include "ArduinoJson/Collection/CollectionImpl.hpp" -#include "ArduinoJson/Object/MemberProxy.hpp" -#include "ArduinoJson/Object/ObjectImpl.hpp" -#include "ArduinoJson/Variant/ConverterImpl.hpp" -#include "ArduinoJson/Variant/VariantCompare.hpp" -#include "ArduinoJson/Variant/VariantImpl.hpp" - -#include "ArduinoJson/Json/JsonDeserializer.hpp" -#include "ArduinoJson/Json/JsonSerializer.hpp" -#include "ArduinoJson/Json/PrettyJsonSerializer.hpp" -#include "ArduinoJson/MsgPack/MsgPackDeserializer.hpp" -#include "ArduinoJson/MsgPack/MsgPackSerializer.hpp" - -#include "ArduinoJson/compatibility.hpp" - -namespace ArduinoJson { -typedef ARDUINOJSON_NAMESPACE::ArrayConstRef JsonArrayConst; -typedef ARDUINOJSON_NAMESPACE::ArrayRef JsonArray; -typedef ARDUINOJSON_NAMESPACE::Float JsonFloat; -typedef ARDUINOJSON_NAMESPACE::Integer JsonInteger; -typedef ARDUINOJSON_NAMESPACE::ObjectConstRef JsonObjectConst; -typedef ARDUINOJSON_NAMESPACE::ObjectRef JsonObject; -typedef ARDUINOJSON_NAMESPACE::Pair JsonPair; -typedef ARDUINOJSON_NAMESPACE::PairConst JsonPairConst; -typedef ARDUINOJSON_NAMESPACE::String JsonString; -typedef ARDUINOJSON_NAMESPACE::UInt JsonUInt; -typedef ARDUINOJSON_NAMESPACE::VariantConstRef JsonVariantConst; -typedef ARDUINOJSON_NAMESPACE::VariantRef JsonVariant; -using ARDUINOJSON_NAMESPACE::BasicJsonDocument; -using ARDUINOJSON_NAMESPACE::copyArray; -using ARDUINOJSON_NAMESPACE::DeserializationError; -using ARDUINOJSON_NAMESPACE::deserializeJson; -using ARDUINOJSON_NAMESPACE::deserializeMsgPack; -using ARDUINOJSON_NAMESPACE::DynamicJsonDocument; -using ARDUINOJSON_NAMESPACE::JsonDocument; -using ARDUINOJSON_NAMESPACE::measureJson; -using ARDUINOJSON_NAMESPACE::serialized; -using ARDUINOJSON_NAMESPACE::serializeJson; -using ARDUINOJSON_NAMESPACE::serializeJsonPretty; -using ARDUINOJSON_NAMESPACE::serializeMsgPack; -using ARDUINOJSON_NAMESPACE::StaticJsonDocument; - -namespace DeserializationOption { -using ARDUINOJSON_NAMESPACE::Filter; -using ARDUINOJSON_NAMESPACE::NestingLimit; -} // namespace DeserializationOption -} // namespace ArduinoJson diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayFunctions.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayFunctions.hpp deleted file mode 100644 index e7cdc4c..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayFunctions.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -namespace ARDUINOJSON_NAMESPACE { - -inline VariantData *arrayAdd(CollectionData *arr, MemoryPool *pool) { - return arr ? arr->addElement(pool) : 0; -} - -template -inline typename TVisitor::result_type arrayAccept(const CollectionData *arr, - TVisitor &visitor) { - if (arr) - return visitor.visitArray(*arr); - else - return visitor.visitNull(); -} - -inline bool arrayEquals(const CollectionData *lhs, const CollectionData *rhs) { - if (lhs == rhs) - return true; - if (!lhs || !rhs) - return false; - return lhs->equalsArray(*rhs); -} -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp deleted file mode 100644 index ae06b20..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -inline ArrayRef ArrayShortcuts::createNestedArray() const { - return impl()->addElement().template to(); -} - -template -inline ObjectRef ArrayShortcuts::createNestedObject() const { - return impl()->addElement().template to(); -} - -template -inline ElementProxy ArrayShortcuts::operator[]( - size_t index) const { - return ElementProxy(*impl(), index); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayIterator.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayIterator.hpp deleted file mode 100644 index fcacc6b..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayIterator.hpp +++ /dev/null @@ -1,121 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -class VariantPtr { - public: - VariantPtr(MemoryPool *pool, VariantData *data) : _variant(pool, data) {} - - VariantRef *operator->() { - return &_variant; - } - - VariantRef &operator*() { - return _variant; - } - - private: - VariantRef _variant; -}; - -class ArrayIterator { - public: - ArrayIterator() : _slot(0) {} - explicit ArrayIterator(MemoryPool *pool, VariantSlot *slot) - : _pool(pool), _slot(slot) {} - - VariantRef operator*() const { - return VariantRef(_pool, _slot->data()); - } - VariantPtr operator->() { - return VariantPtr(_pool, _slot->data()); - } - - bool operator==(const ArrayIterator &other) const { - return _slot == other._slot; - } - - bool operator!=(const ArrayIterator &other) const { - return _slot != other._slot; - } - - ArrayIterator &operator++() { - _slot = _slot->next(); - return *this; - } - - ArrayIterator &operator+=(size_t distance) { - _slot = _slot->next(distance); - return *this; - } - - VariantSlot *internal() { - return _slot; - } - - private: - MemoryPool *_pool; - VariantSlot *_slot; -}; - -class VariantConstPtr { - public: - VariantConstPtr(const VariantData *data) : _variant(data) {} - - VariantConstRef *operator->() { - return &_variant; - } - - VariantConstRef &operator*() { - return _variant; - } - - private: - VariantConstRef _variant; -}; - -class ArrayConstRefIterator { - public: - ArrayConstRefIterator() : _slot(0) {} - explicit ArrayConstRefIterator(const VariantSlot *slot) : _slot(slot) {} - - VariantConstRef operator*() const { - return VariantConstRef(_slot->data()); - } - VariantConstPtr operator->() { - return VariantConstPtr(_slot->data()); - } - - bool operator==(const ArrayConstRefIterator &other) const { - return _slot == other._slot; - } - - bool operator!=(const ArrayConstRefIterator &other) const { - return _slot != other._slot; - } - - ArrayConstRefIterator &operator++() { - _slot = _slot->next(); - return *this; - } - - ArrayConstRefIterator &operator+=(size_t distance) { - _slot = _slot->next(distance); - return *this; - } - - const VariantSlot *internal() { - return _slot; - } - - private: - const VariantSlot *_slot; -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp deleted file mode 100644 index a991db0..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp +++ /dev/null @@ -1,205 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -// Returns the size (in bytes) of an array with n elements. -// Can be very handy to determine the size of a StaticMemoryPool. -#define JSON_ARRAY_SIZE(NUMBER_OF_ELEMENTS) \ - ((NUMBER_OF_ELEMENTS) * sizeof(ARDUINOJSON_NAMESPACE::VariantSlot)) - -namespace ARDUINOJSON_NAMESPACE { - -class ObjectRef; -template -class ElementProxy; - -template -class ArrayRefBase { - public: - operator VariantConstRef() const { - const void* data = _data; // prevent warning cast-align - return VariantConstRef(reinterpret_cast(data)); - } - - template - FORCE_INLINE typename TVisitor::result_type accept(TVisitor& visitor) const { - return arrayAccept(_data, visitor); - } - - FORCE_INLINE bool isNull() const { - return _data == 0; - } - - FORCE_INLINE operator bool() const { - return _data != 0; - } - - FORCE_INLINE size_t memoryUsage() const { - return _data ? _data->memoryUsage() : 0; - } - - FORCE_INLINE size_t nesting() const { - return _data ? _data->nesting() : 0; - } - - FORCE_INLINE size_t size() const { - return _data ? _data->size() : 0; - } - - protected: - ArrayRefBase(TData* data) : _data(data) {} - TData* _data; -}; - -class ArrayConstRef : public ArrayRefBase, - public Visitable { - friend class ArrayRef; - typedef ArrayRefBase base_type; - - public: - typedef ArrayConstRefIterator iterator; - - FORCE_INLINE iterator begin() const { - if (!_data) - return iterator(); - return iterator(_data->head()); - } - - FORCE_INLINE iterator end() const { - return iterator(); - } - - FORCE_INLINE ArrayConstRef() : base_type(0) {} - FORCE_INLINE ArrayConstRef(const CollectionData* data) : base_type(data) {} - - FORCE_INLINE bool operator==(ArrayConstRef rhs) const { - return arrayEquals(_data, rhs._data); - } - - FORCE_INLINE VariantConstRef operator[](size_t index) const { - return getElement(index); - } - - FORCE_INLINE VariantConstRef getElement(size_t index) const { - return VariantConstRef(_data ? _data->getElement(index) : 0); - } -}; - -class ArrayRef : public ArrayRefBase, - public ArrayShortcuts, - public Visitable { - typedef ArrayRefBase base_type; - - public: - typedef ArrayIterator iterator; - - FORCE_INLINE ArrayRef() : base_type(0), _pool(0) {} - FORCE_INLINE ArrayRef(MemoryPool* pool, CollectionData* data) - : base_type(data), _pool(pool) {} - - operator VariantRef() { - void* data = _data; // prevent warning cast-align - return VariantRef(_pool, reinterpret_cast(data)); - } - - operator ArrayConstRef() const { - return ArrayConstRef(_data); - } - - VariantRef addElement() const { - return VariantRef(_pool, arrayAdd(_data, _pool)); - } - - FORCE_INLINE iterator begin() const { - if (!_data) - return iterator(); - return iterator(_pool, _data->head()); - } - - FORCE_INLINE iterator end() const { - return iterator(); - } - - // Copy a ArrayRef - FORCE_INLINE bool set(ArrayConstRef src) const { - if (!_data || !src._data) - return false; - return _data->copyFrom(*src._data, _pool); - } - - FORCE_INLINE bool operator==(ArrayRef rhs) const { - return arrayEquals(_data, rhs._data); - } - - // Internal use - FORCE_INLINE VariantRef getOrAddElement(size_t index) const { - return VariantRef(_pool, _data ? _data->getOrAddElement(index, _pool) : 0); - } - - // Gets the value at the specified index. - FORCE_INLINE VariantRef getElement(size_t index) const { - return VariantRef(_pool, _data ? _data->getElement(index) : 0); - } - - // Removes element at specified position. - FORCE_INLINE void remove(iterator it) const { - if (!_data) - return; - _data->removeSlot(it.internal()); - } - - // Removes element at specified index. - FORCE_INLINE void remove(size_t index) const { - if (!_data) - return; - _data->removeElement(index); - } - - private: - MemoryPool* _pool; -}; - -template <> -struct Converter { - static bool toJson(VariantConstRef src, VariantRef dst) { - return variantCopyFrom(getData(dst), getData(src), getPool(dst)); - } - - static ArrayConstRef fromJson(VariantConstRef src) { - return ArrayConstRef(variantAsArray(getData(src))); - } - - static bool checkJson(VariantConstRef src) { - const VariantData* data = getData(src); - return data && data->isArray(); - } -}; - -template <> -struct Converter { - static bool toJson(VariantConstRef src, VariantRef dst) { - return variantCopyFrom(getData(dst), getData(src), getPool(dst)); - } - - static ArrayRef fromJson(VariantRef src) { - VariantData* data = getData(src); - MemoryPool* pool = getPool(src); - return ArrayRef(pool, data != 0 ? data->asArray() : 0); - } - - static bool checkJson(VariantConstRef) { - return false; - } - - static bool checkJson(VariantRef src) { - VariantData* data = getData(src); - return data && data->isArray(); - } -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayShortcuts.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayShortcuts.hpp deleted file mode 100644 index fd26d04..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayShortcuts.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -namespace ARDUINOJSON_NAMESPACE { -// Forward declarations. -class ArrayRef; -class ObjectRef; -template -class ElementProxy; - -template -class ArrayShortcuts { - public: - // Returns the element at specified index if the variant is an array. - FORCE_INLINE ElementProxy operator[](size_t index) const; - - FORCE_INLINE ObjectRef createNestedObject() const; - - FORCE_INLINE ArrayRef createNestedArray() const; - - // Adds the specified value at the end of the array. - // - // bool add(TValue); - // TValue = bool, long, int, short, float, double, serialized, VariantRef, - // std::string, String, ObjectRef - template - FORCE_INLINE bool add(const T &value) const { - return impl()->addElement().set(value); - } - // - // bool add(TValue); - // TValue = char*, const char*, const __FlashStringHelper* - template - FORCE_INLINE bool add(T *value) const { - return impl()->addElement().set(value); - } - - private: - const TArray *impl() const { - return static_cast(this); - } -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp deleted file mode 100644 index c6062e4..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp +++ /dev/null @@ -1,193 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4522) -#endif - -namespace ARDUINOJSON_NAMESPACE { - -template -class ElementProxy : public VariantOperators >, - public VariantShortcuts >, - public Visitable, - public VariantTag { - typedef ElementProxy this_type; - - public: - typedef VariantRef variant_type; - - FORCE_INLINE ElementProxy(TArray array, size_t index) - : _array(array), _index(index) {} - - FORCE_INLINE ElementProxy(const ElementProxy& src) - : _array(src._array), _index(src._index) {} - - FORCE_INLINE this_type& operator=(const this_type& src) { - getOrAddUpstreamElement().set(src.as()); - return *this; - } - - // Replaces the value - // - // operator=(const TValue&) - // TValue = bool, long, int, short, float, double, serialized, VariantRef, - // std::string, String, ArrayRef, ObjectRef - template - FORCE_INLINE this_type& operator=(const T& src) { - getOrAddUpstreamElement().set(src); - return *this; - } - // - // operator=(TValue) - // TValue = char*, const char*, const __FlashStringHelper* - template - FORCE_INLINE this_type& operator=(T* src) { - getOrAddUpstreamElement().set(src); - return *this; - } - - FORCE_INLINE void clear() const { - getUpstreamElement().clear(); - } - - FORCE_INLINE bool isNull() const { - return getUpstreamElement().isNull(); - } - - template - FORCE_INLINE typename enable_if::value, T>::type as() - const { - return getUpstreamElement().template as(); - } - - template - FORCE_INLINE typename enable_if::value, const char*>::type - ARDUINOJSON_DEPRECATED("Replace as() with as()") - as() const { - return as(); - } - - template - FORCE_INLINE operator T() const { - return getUpstreamElement(); - } - - template - FORCE_INLINE bool is() const { - return getUpstreamElement().template is(); - } - - template - FORCE_INLINE typename VariantTo::type to() const { - return getOrAddUpstreamElement().template to(); - } - - // Replaces the value - // - // bool set(const TValue&) - // TValue = bool, long, int, short, float, double, serialized, VariantRef, - // std::string, String, ArrayRef, ObjectRef - template - FORCE_INLINE bool set(const TValue& value) const { - return getOrAddUpstreamElement().set(value); - } - // - // bool set(TValue) - // TValue = char*, const char*, const __FlashStringHelper* - template - FORCE_INLINE bool set(TValue* value) const { - return getOrAddUpstreamElement().set(value); - } - - template - typename TVisitor::result_type accept(TVisitor& visitor) const { - return getUpstreamElement().accept(visitor); - } - - FORCE_INLINE size_t size() const { - return getUpstreamElement().size(); - } - - template - VariantRef getMember(TNestedKey* key) const { - return getUpstreamElement().getMember(key); - } - - template - VariantRef getMember(const TNestedKey& key) const { - return getUpstreamElement().getMember(key); - } - - template - VariantRef getOrAddMember(TNestedKey* key) const { - return getOrAddUpstreamElement().getOrAddMember(key); - } - - template - VariantRef getOrAddMember(const TNestedKey& key) const { - return getOrAddUpstreamElement().getOrAddMember(key); - } - - VariantRef addElement() const { - return getOrAddUpstreamElement().addElement(); - } - - VariantRef getElement(size_t index) const { - return getOrAddUpstreamElement().getElement(index); - } - - VariantRef getOrAddElement(size_t index) const { - return getOrAddUpstreamElement().getOrAddElement(index); - } - - FORCE_INLINE void remove(size_t index) const { - getUpstreamElement().remove(index); - } - // remove(char*) const - // remove(const char*) const - // remove(const __FlashStringHelper*) const - template - FORCE_INLINE typename enable_if::value>::type remove( - TChar* key) const { - getUpstreamElement().remove(key); - } - // remove(const std::string&) const - // remove(const String&) const - template - FORCE_INLINE typename enable_if::value>::type remove( - const TString& key) const { - getUpstreamElement().remove(key); - } - - private: - FORCE_INLINE VariantRef getUpstreamElement() const { - return _array.getElement(_index); - } - - FORCE_INLINE VariantRef getOrAddUpstreamElement() const { - return _array.getOrAddElement(_index); - } - - friend bool convertToJson(const this_type& src, VariantRef dst) { - return dst.set(src.getUpstreamElement()); - } - - TArray _array; - const size_t _index; -}; - -} // namespace ARDUINOJSON_NAMESPACE - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp deleted file mode 100644 index 619b91d..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp +++ /dev/null @@ -1,133 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -// Copy a 1D array to a JsonArray -template -inline typename enable_if::value && - !is_base_of::value, - bool>::type -copyArray(T (&src)[N], const TDestination& dst) { - return copyArray(src, N, dst); -} - -// Copy a 1D array to a JsonDocument -template -inline bool copyArray(T (&src)[N], JsonDocument& dst) { - return copyArray(src, dst.to()); -} - -// Copy a 1D array to a JsonArray -template -inline typename enable_if::value && - !is_base_of::value, - bool>::type -copyArray(T* src, size_t len, const TDestination& dst) { - bool ok = true; - for (size_t i = 0; i < len; i++) { - ok &= dst.add(src[i]); - } - return ok; -} - -// Copy a 1D array to a JsonDocument -template -inline bool copyArray(T* src, size_t len, JsonDocument& dst) { - return copyArray(src, len, dst.to()); -} - -// Copy a 2D array to a JsonArray -template -inline typename enable_if::value, - bool>::type -copyArray(T (&src)[N1][N2], const TDestination& dst) { - bool ok = true; - for (size_t i = 0; i < N1; i++) { - ArrayRef nestedArray = dst.createNestedArray(); - for (size_t j = 0; j < N2; j++) { - ok &= nestedArray.add(src[i][j]); - } - } - return ok; -} - -// Copy a 2D array to a JsonDocument -template -inline bool copyArray(T (&src)[N1][N2], JsonDocument& dst) { - return copyArray(src, dst.to()); -} - -template -class ArrayCopier1D : public Visitor { - public: - ArrayCopier1D(T* destination, size_t capacity) - : _destination(destination), _capacity(capacity) {} - - size_t visitArray(const CollectionData& array) { - size_t size = 0; - VariantSlot* slot = array.head(); - - while (slot != 0 && size < _capacity) { - _destination[size++] = - Converter::fromJson(VariantConstRef(slot->data())); - slot = slot->next(); - } - return size; - } - - private: - T* _destination; - size_t _capacity; -}; - -template -class ArrayCopier2D : public Visitor { - public: - ArrayCopier2D(T (*destination)[N1][N2]) : _destination(destination) {} - - void visitArray(const CollectionData& array) { - VariantSlot* slot = array.head(); - size_t n = 0; - while (slot != 0 && n < N1) { - ArrayCopier1D copier((*_destination)[n++], N2); - variantAccept(slot->data(), copier); - slot = slot->next(); - } - } - - private: - T (*_destination)[N1][N2]; - size_t _capacity1, _capacity2; -}; - -// Copy a JsonArray to a 1D array -template -inline typename enable_if::value, size_t>::type copyArray( - const TSource& src, T (&dst)[N]) { - return copyArray(src, dst, N); -} - -// Copy a JsonArray to a 1D array -template -inline size_t copyArray(const TSource& src, T* dst, size_t len) { - ArrayCopier1D copier(dst, len); - - return src.accept(copier); -} - -// Copy a JsonArray to a 2D array -template -inline void copyArray(const TSource& src, T (&dst)[N1][N2]) { - ArrayCopier2D copier(&dst); - src.accept(copier); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp deleted file mode 100644 index d2bca45..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp +++ /dev/null @@ -1,88 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -#include // size_t - -namespace ARDUINOJSON_NAMESPACE { - -class MemoryPool; -class VariantData; -class VariantSlot; - -class CollectionData { - VariantSlot *_head; - VariantSlot *_tail; - - public: - // Must be a POD! - // - no constructor - // - no destructor - // - no virtual - // - no inheritance - - // Array only - - VariantData *addElement(MemoryPool *pool); - - VariantData *getElement(size_t index) const; - - VariantData *getOrAddElement(size_t index, MemoryPool *pool); - - void removeElement(size_t index); - - bool equalsArray(const CollectionData &other) const; - - // Object only - - template - VariantData *addMember(TAdaptedString key, MemoryPool *pool); - - template - VariantData *getMember(TAdaptedString key) const; - - template - VariantData *getOrAddMember(TAdaptedString key, MemoryPool *pool); - - template - void removeMember(TAdaptedString key) { - removeSlot(getSlot(key)); - } - - template - bool containsKey(const TAdaptedString &key) const; - - bool equalsObject(const CollectionData &other) const; - - // Generic - - void clear(); - size_t memoryUsage() const; - size_t nesting() const; - size_t size() const; - - VariantSlot *addSlot(MemoryPool *); - void removeSlot(VariantSlot *slot); - - bool copyFrom(const CollectionData &src, MemoryPool *pool); - - VariantSlot *head() const { - return _head; - } - - void movePointers(ptrdiff_t stringDistance, ptrdiff_t variantDistance); - - private: - VariantSlot *getSlot(size_t index) const; - - template - VariantSlot *getSlot(TAdaptedString key) const; - - VariantSlot *getPreviousSlot(VariantSlot *) const; -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp deleted file mode 100644 index 49a24be..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp +++ /dev/null @@ -1,234 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -inline bool variantEquals(const VariantData* a, const VariantData* b) { - return variantCompare(a, b) == COMPARE_RESULT_EQUAL; -} - -inline VariantSlot* CollectionData::addSlot(MemoryPool* pool) { - VariantSlot* slot = pool->allocVariant(); - if (!slot) - return 0; - - if (_tail) { - _tail->setNextNotNull(slot); - _tail = slot; - } else { - _head = slot; - _tail = slot; - } - - slot->clear(); - return slot; -} - -inline VariantData* CollectionData::addElement(MemoryPool* pool) { - return slotData(addSlot(pool)); -} - -template -inline VariantData* CollectionData::addMember(TAdaptedString key, - MemoryPool* pool) { - VariantSlot* slot = addSlot(pool); - if (!slotSetKey(slot, key, pool)) { - removeSlot(slot); - return 0; - } - return slot->data(); -} - -inline void CollectionData::clear() { - _head = 0; - _tail = 0; -} - -template -inline bool CollectionData::containsKey(const TAdaptedString& key) const { - return getSlot(key) != 0; -} - -inline bool CollectionData::copyFrom(const CollectionData& src, - MemoryPool* pool) { - clear(); - for (VariantSlot* s = src._head; s; s = s->next()) { - VariantData* var; - if (s->key() != 0) { - if (s->ownsKey()) - var = addMember(RamStringAdapter(s->key()), pool); - else - var = addMember(ConstRamStringAdapter(s->key()), pool); - } else { - var = addElement(pool); - } - if (!var) - return false; - if (!var->copyFrom(*s->data(), pool)) - return false; - } - return true; -} - -inline bool CollectionData::equalsObject(const CollectionData& other) const { - size_t count = 0; - for (VariantSlot* slot = _head; slot; slot = slot->next()) { - VariantData* v1 = slot->data(); - VariantData* v2 = other.getMember(adaptString(slot->key())); - if (!variantEquals(v1, v2)) - return false; - count++; - } - return count == other.size(); -} - -inline bool CollectionData::equalsArray(const CollectionData& other) const { - VariantSlot* s1 = _head; - VariantSlot* s2 = other._head; - for (;;) { - if (s1 == s2) - return true; - if (!s1 || !s2) - return false; - if (!variantEquals(s1->data(), s2->data())) - return false; - s1 = s1->next(); - s2 = s2->next(); - } -} - -template -inline VariantSlot* CollectionData::getSlot(TAdaptedString key) const { - VariantSlot* slot = _head; - while (slot) { - if (key.equals(slot->key())) - break; - slot = slot->next(); - } - return slot; -} - -inline VariantSlot* CollectionData::getSlot(size_t index) const { - if (!_head) - return 0; - return _head->next(index); -} - -inline VariantSlot* CollectionData::getPreviousSlot(VariantSlot* target) const { - VariantSlot* current = _head; - while (current) { - VariantSlot* next = current->next(); - if (next == target) - return current; - current = next; - } - return 0; -} - -template -inline VariantData* CollectionData::getMember(TAdaptedString key) const { - VariantSlot* slot = getSlot(key); - return slot ? slot->data() : 0; -} - -template -inline VariantData* CollectionData::getOrAddMember(TAdaptedString key, - MemoryPool* pool) { - // ignore null key - if (key.isNull()) - return 0; - - // search a matching key - VariantSlot* slot = getSlot(key); - if (slot) - return slot->data(); - - return addMember(key, pool); -} - -inline VariantData* CollectionData::getElement(size_t index) const { - VariantSlot* slot = getSlot(index); - return slot ? slot->data() : 0; -} - -inline VariantData* CollectionData::getOrAddElement(size_t index, - MemoryPool* pool) { - VariantSlot* slot = _head; - while (slot && index > 0) { - slot = slot->next(); - index--; - } - if (!slot) - index++; - while (index > 0) { - slot = addSlot(pool); - index--; - } - return slotData(slot); -} - -inline void CollectionData::removeSlot(VariantSlot* slot) { - if (!slot) - return; - VariantSlot* prev = getPreviousSlot(slot); - VariantSlot* next = slot->next(); - if (prev) - prev->setNext(next); - else - _head = next; - if (!next) - _tail = prev; -} - -inline void CollectionData::removeElement(size_t index) { - removeSlot(getSlot(index)); -} - -inline size_t CollectionData::memoryUsage() const { - size_t total = 0; - for (VariantSlot* s = _head; s; s = s->next()) { - total += sizeof(VariantSlot) + s->data()->memoryUsage(); - if (s->ownsKey()) - total += strlen(s->key()) + 1; - } - return total; -} - -inline size_t CollectionData::nesting() const { - size_t maxChildNesting = 0; - for (VariantSlot* s = _head; s; s = s->next()) { - size_t childNesting = s->data()->nesting(); - if (childNesting > maxChildNesting) - maxChildNesting = childNesting; - } - return maxChildNesting + 1; -} - -inline size_t CollectionData::size() const { - return slotSize(_head); -} - -template -inline void movePointer(T*& p, ptrdiff_t offset) { - if (!p) - return; - p = reinterpret_cast( - reinterpret_cast(reinterpret_cast(p) + offset)); - ARDUINOJSON_ASSERT(isAligned(p)); -} - -inline void CollectionData::movePointers(ptrdiff_t stringDistance, - ptrdiff_t variantDistance) { - movePointer(_head, variantDistance); - movePointer(_tail, variantDistance); - for (VariantSlot* slot = _head; slot; slot = slot->next()) - slot->movePointers(stringDistance, variantDistance); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp b/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp deleted file mode 100644 index 0c0d4c4..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp +++ /dev/null @@ -1,255 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#if __cplusplus >= 201103L -#define ARDUINOJSON_HAS_LONG_LONG 1 -#define ARDUINOJSON_HAS_NULLPTR 1 -#define ARDUINOJSON_HAS_RVALUE_REFERENCES 1 -#else -#define ARDUINOJSON_HAS_LONG_LONG 0 -#define ARDUINOJSON_HAS_NULLPTR 0 -#define ARDUINOJSON_HAS_RVALUE_REFERENCES 0 -#endif - -#if defined(_MSC_VER) && !ARDUINOJSON_HAS_LONG_LONG -#define ARDUINOJSON_HAS_INT64 1 -#else -#define ARDUINOJSON_HAS_INT64 0 -#endif - -// Small or big machine? -#ifndef ARDUINOJSON_EMBEDDED_MODE -#if defined(ARDUINO) /* Arduino*/ \ - || defined(__IAR_SYSTEMS_ICC__) /* IAR Embedded Workbench */ \ - || defined(__XC) /* MPLAB XC compiler */ \ - || defined(__ARMCC_VERSION) /* Keil ARM Compiler */ \ - || defined(__AVR) /* Atmel AVR8/GNU C Compiler */ -#define ARDUINOJSON_EMBEDDED_MODE 1 -#else -#define ARDUINOJSON_EMBEDDED_MODE 0 -#endif -#endif - -// Auto enable std::stream if the right headers are here and no conflicting -// macro is defined -#if !defined(ARDUINOJSON_ENABLE_STD_STREAM) && defined(__has_include) -#if __has_include() && \ - __has_include() && \ - !defined(min) && \ - !defined(max) -#define ARDUINOJSON_ENABLE_STD_STREAM 1 -#else -#define ARDUINOJSON_ENABLE_STD_STREAM 0 -#endif -#endif - -// Auto enable std::string if the right header is here and no conflicting -// macro is defined -#if !defined(ARDUINOJSON_ENABLE_STD_STRING) && defined(__has_include) -#if __has_include() && !defined(min) && !defined(max) -#define ARDUINOJSON_ENABLE_STD_STRING 1 -#else -#define ARDUINOJSON_ENABLE_STD_STRING 0 -#endif -#endif - -#if ARDUINOJSON_EMBEDDED_MODE - -// Store floats by default to reduce the memory usage (issue #134) -#ifndef ARDUINOJSON_USE_DOUBLE -#define ARDUINOJSON_USE_DOUBLE 0 -#endif - -// Store longs by default, because they usually match the size of a float. -#ifndef ARDUINOJSON_USE_LONG_LONG -#define ARDUINOJSON_USE_LONG_LONG 0 -#endif - -// Embedded systems usually don't have std::string -#ifndef ARDUINOJSON_ENABLE_STD_STRING -#define ARDUINOJSON_ENABLE_STD_STRING 0 -#endif - -// Embedded systems usually don't have std::stream -#ifndef ARDUINOJSON_ENABLE_STD_STREAM -#define ARDUINOJSON_ENABLE_STD_STREAM 0 -#endif - -// Limit nesting as the stack is likely to be small -#ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT -#define ARDUINOJSON_DEFAULT_NESTING_LIMIT 10 -#endif - -// Number of bits to store the pointer to next node -// (saves RAM but limits the number of values in a document) -#ifndef ARDUINOJSON_SLOT_OFFSET_SIZE -#if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 2 -// Address space == 16-bit => max 127 values -#define ARDUINOJSON_SLOT_OFFSET_SIZE 1 -#else -// Address space > 16-bit => max 32767 values -#define ARDUINOJSON_SLOT_OFFSET_SIZE 2 -#endif -#endif - -#else // ARDUINOJSON_EMBEDDED_MODE - -// On a computer we have plenty of memory so we can use doubles -#ifndef ARDUINOJSON_USE_DOUBLE -#define ARDUINOJSON_USE_DOUBLE 1 -#endif - -// Use long long when available -#ifndef ARDUINOJSON_USE_LONG_LONG -#if ARDUINOJSON_HAS_LONG_LONG || ARDUINOJSON_HAS_INT64 -#define ARDUINOJSON_USE_LONG_LONG 1 -#else -#define ARDUINOJSON_USE_LONG_LONG 0 -#endif -#endif - -// On a computer, we can use std::string -#ifndef ARDUINOJSON_ENABLE_STD_STRING -#define ARDUINOJSON_ENABLE_STD_STRING 1 -#endif - -// On a computer, we can assume std::stream -#ifndef ARDUINOJSON_ENABLE_STD_STREAM -#define ARDUINOJSON_ENABLE_STD_STREAM 1 -#endif - -// On a computer, the stack is large so we can increase nesting limit -#ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT -#define ARDUINOJSON_DEFAULT_NESTING_LIMIT 50 -#endif - -// Number of bits to store the pointer to next node -#ifndef ARDUINOJSON_SLOT_OFFSET_SIZE -#define ARDUINOJSON_SLOT_OFFSET_SIZE 4 -#endif - -#endif // ARDUINOJSON_EMBEDDED_MODE - -#ifdef ARDUINO - -#include - -// Enable support for Arduino's String class -#ifndef ARDUINOJSON_ENABLE_ARDUINO_STRING -#define ARDUINOJSON_ENABLE_ARDUINO_STRING 1 -#endif - -// Enable support for Arduino's Stream class -#ifndef ARDUINOJSON_ENABLE_ARDUINO_STREAM -#define ARDUINOJSON_ENABLE_ARDUINO_STREAM 1 -#endif - -// Enable support for Arduino's Print class -#ifndef ARDUINOJSON_ENABLE_ARDUINO_PRINT -#define ARDUINOJSON_ENABLE_ARDUINO_PRINT 1 -#endif - -#else // ARDUINO - -// Disable support for Arduino's String class -#ifndef ARDUINOJSON_ENABLE_ARDUINO_STRING -#define ARDUINOJSON_ENABLE_ARDUINO_STRING 0 -#endif - -// Disable support for Arduino's Stream class -#ifndef ARDUINOJSON_ENABLE_ARDUINO_STREAM -#define ARDUINOJSON_ENABLE_ARDUINO_STREAM 0 -#endif - -// Disable support for Arduino's Print class -#ifndef ARDUINOJSON_ENABLE_ARDUINO_PRINT -#define ARDUINOJSON_ENABLE_ARDUINO_PRINT 0 -#endif - -#endif // ARDUINO - -#ifndef ARDUINOJSON_ENABLE_PROGMEM -#if defined(PROGMEM) && defined(pgm_read_byte) && defined(pgm_read_dword) && \ - defined(pgm_read_ptr) && defined(pgm_read_float) -#define ARDUINOJSON_ENABLE_PROGMEM 1 -#else -#define ARDUINOJSON_ENABLE_PROGMEM 0 -#endif -#endif - -// Convert unicode escape sequence (\u0123) to UTF-8 -#ifndef ARDUINOJSON_DECODE_UNICODE -#define ARDUINOJSON_DECODE_UNICODE 1 -#endif - -// Ignore comments in input -#ifndef ARDUINOJSON_ENABLE_COMMENTS -#define ARDUINOJSON_ENABLE_COMMENTS 0 -#endif - -// Support NaN in JSON -#ifndef ARDUINOJSON_ENABLE_NAN -#define ARDUINOJSON_ENABLE_NAN 0 -#endif - -// Support Infinity in JSON -#ifndef ARDUINOJSON_ENABLE_INFINITY -#define ARDUINOJSON_ENABLE_INFINITY 0 -#endif - -// Control the exponentiation threshold for big numbers -// CAUTION: cannot be more that 1e9 !!!! -#ifndef ARDUINOJSON_POSITIVE_EXPONENTIATION_THRESHOLD -#define ARDUINOJSON_POSITIVE_EXPONENTIATION_THRESHOLD 1e7 -#endif - -// Control the exponentiation threshold for small numbers -#ifndef ARDUINOJSON_NEGATIVE_EXPONENTIATION_THRESHOLD -#define ARDUINOJSON_NEGATIVE_EXPONENTIATION_THRESHOLD 1e-5 -#endif - -#ifndef ARDUINOJSON_LITTLE_ENDIAN -#if defined(_MSC_VER) || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \ - defined(__LITTLE_ENDIAN__) || defined(__i386) || defined(__x86_64) -#define ARDUINOJSON_LITTLE_ENDIAN 1 -#else -#define ARDUINOJSON_LITTLE_ENDIAN 0 -#endif -#endif - -#ifndef ARDUINOJSON_ENABLE_ALIGNMENT -#if defined(__AVR) -#define ARDUINOJSON_ENABLE_ALIGNMENT 0 -#else -#define ARDUINOJSON_ENABLE_ALIGNMENT 1 -#endif -#endif - -#ifndef ARDUINOJSON_TAB -#define ARDUINOJSON_TAB " " -#endif - -#ifndef ARDUINOJSON_ENABLE_STRING_DEDUPLICATION -#define ARDUINOJSON_ENABLE_STRING_DEDUPLICATION 1 -#endif - -#ifndef ARDUINOJSON_STRING_BUFFER_SIZE -#define ARDUINOJSON_STRING_BUFFER_SIZE 32 -#endif - -#ifndef ARDUINOJSON_DEBUG -#ifdef __PLATFORMIO_BUILD_DEBUG__ -#define ARDUINOJSON_DEBUG 1 -#else -#define ARDUINOJSON_DEBUG 0 -#endif -#endif - -#if ARDUINOJSON_HAS_NULLPTR && defined(nullptr) -#error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr -// See https://github.com/bblanchon/ArduinoJson/issues/1355 -#endif diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp deleted file mode 100644 index 7b61711..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp +++ /dev/null @@ -1,122 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -#if ARDUINOJSON_ENABLE_STD_STREAM -#include -#endif - -namespace ARDUINOJSON_NAMESPACE { - -class DeserializationError { - // safe bool idiom - typedef void (DeserializationError::*bool_type)() const; - void safeBoolHelper() const {} - - public: - enum Code { - Ok, - EmptyInput, - IncompleteInput, - InvalidInput, - NoMemory, - TooDeep - }; - - DeserializationError() {} - DeserializationError(Code c) : _code(c) {} - - // Compare with DeserializationError - friend bool operator==(const DeserializationError& lhs, - const DeserializationError& rhs) { - return lhs._code == rhs._code; - } - friend bool operator!=(const DeserializationError& lhs, - const DeserializationError& rhs) { - return lhs._code != rhs._code; - } - - // Compare with Code - friend bool operator==(const DeserializationError& lhs, Code rhs) { - return lhs._code == rhs; - } - friend bool operator==(Code lhs, const DeserializationError& rhs) { - return lhs == rhs._code; - } - friend bool operator!=(const DeserializationError& lhs, Code rhs) { - return lhs._code != rhs; - } - friend bool operator!=(Code lhs, const DeserializationError& rhs) { - return lhs != rhs._code; - } - - // Behaves like a bool - operator bool_type() const { - return _code != Ok ? &DeserializationError::safeBoolHelper : 0; - } - friend bool operator==(bool value, const DeserializationError& err) { - return static_cast(err) == value; - } - friend bool operator==(const DeserializationError& err, bool value) { - return static_cast(err) == value; - } - friend bool operator!=(bool value, const DeserializationError& err) { - return static_cast(err) != value; - } - friend bool operator!=(const DeserializationError& err, bool value) { - return static_cast(err) != value; - } - - // Returns internal enum, useful for switch statement - Code code() const { - return _code; - } - - const char* c_str() const { - static const char* messages[] = { - "Ok", "EmptyInput", "IncompleteInput", - "InvalidInput", "NoMemory", "TooDeep"}; - ARDUINOJSON_ASSERT(static_cast(_code) < - sizeof(messages) / sizeof(messages[0])); - return messages[_code]; - } - -#if ARDUINOJSON_ENABLE_PROGMEM - const __FlashStringHelper* f_str() const { - ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s0, "Ok"); - ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s1, "EmptyInput"); - ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s2, "IncompleteInput"); - ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s3, "InvalidInput"); - ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s4, "NoMemory"); - ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s5, "TooDeep"); - ARDUINOJSON_DEFINE_STATIC_ARRAY( - const char*, messages, ARDUINOJSON_EXPAND6({s0, s1, s2, s3, s4, s5})); - return ARDUINOJSON_READ_STATIC_ARRAY(const __FlashStringHelper*, messages, - _code); - } -#endif - - private: - Code _code; -}; - -#if ARDUINOJSON_ENABLE_STD_STREAM -inline std::ostream& operator<<(std::ostream& s, - const DeserializationError& e) { - s << e.c_str(); - return s; -} - -inline std::ostream& operator<<(std::ostream& s, DeserializationError::Code c) { - s << DeserializationError(c).c_str(); - return s; -} -#endif - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp deleted file mode 100644 index 7ea3078..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -namespace ARDUINOJSON_NAMESPACE { - -class Filter { - public: - explicit Filter(VariantConstRef v) : _variant(v) {} - - bool allow() const { - return _variant; - } - - bool allowArray() const { - return _variant == true || _variant.is(); - } - - bool allowObject() const { - return _variant == true || _variant.is(); - } - - bool allowValue() const { - return _variant == true; - } - - template - Filter operator[](const TKey& key) const { - if (_variant == true) // "true" means "allow recursively" - return *this; - else - return Filter(_variant[key] | _variant["*"]); - } - - private: - VariantConstRef _variant; -}; - -struct AllowAllFilter { - bool allow() const { - return true; - } - - bool allowArray() const { - return true; - } - - bool allowObject() const { - return true; - } - - bool allowValue() const { - return true; - } - - template - AllowAllFilter operator[](const TKey&) const { - return AllowAllFilter(); - } -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp deleted file mode 100644 index 06964b4..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -class NestingLimit { - public: - NestingLimit() : _value(ARDUINOJSON_DEFAULT_NESTING_LIMIT) {} - explicit NestingLimit(uint8_t n) : _value(n) {} - - NestingLimit decrement() const { - ARDUINOJSON_ASSERT(_value > 0); - return NestingLimit(static_cast(_value - 1)); - } - - bool reached() const { - return _value == 0; - } - - private: - uint8_t _value; -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp deleted file mode 100644 index e965c82..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -#include // for size_t - -namespace ARDUINOJSON_NAMESPACE { - -// The default reader is a simple wrapper for Readers that are not copiable -template -struct Reader { - public: - Reader(TSource& source) : _source(&source) {} - - int read() { - return _source->read(); - } - - size_t readBytes(char* buffer, size_t length) { - return _source->readBytes(buffer, length); - } - - private: - TSource* _source; -}; - -template -struct BoundedReader { - // no default implementation because we need to pass the size to the - // constructor -}; -} // namespace ARDUINOJSON_NAMESPACE - -#include -#include -#include - -#if ARDUINOJSON_ENABLE_ARDUINO_STREAM -#include -#endif - -#if ARDUINOJSON_ENABLE_ARDUINO_STRING -#include -#endif - -#if ARDUINOJSON_ENABLE_PROGMEM -#include -#endif - -#if ARDUINOJSON_ENABLE_STD_STREAM -#include -#endif diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp deleted file mode 100644 index 724638f..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -struct Reader::value>::type> { - public: - explicit Reader(Stream& stream) : _stream(&stream) {} - - int read() { - // don't use _stream.read() as it ignores the timeout - char c; - return _stream->readBytes(&c, 1) ? static_cast(c) : -1; - } - - size_t readBytes(char* buffer, size_t length) { - return _stream->readBytes(buffer, length); - } - - private: - Stream* _stream; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp deleted file mode 100644 index 71571d4..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp +++ /dev/null @@ -1,17 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -namespace ARDUINOJSON_NAMESPACE { - -template -struct Reader::value>::type> - : BoundedReader { - explicit Reader(const ::String& s) - : BoundedReader(s.c_str(), s.length()) {} -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp deleted file mode 100644 index 7eca134..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -namespace ARDUINOJSON_NAMESPACE { - -template <> -struct Reader { - const char* _ptr; - - public: - explicit Reader(const __FlashStringHelper* ptr) - : _ptr(reinterpret_cast(ptr)) {} - - int read() { - return pgm_read_byte(_ptr++); - } - - size_t readBytes(char* buffer, size_t length) { - memcpy_P(buffer, _ptr, length); - _ptr += length; - return length; - } -}; - -template <> -struct BoundedReader { - const char* _ptr; - const char* _end; - - public: - explicit BoundedReader(const __FlashStringHelper* ptr, size_t size) - : _ptr(reinterpret_cast(ptr)), _end(_ptr + size) {} - - int read() { - if (_ptr < _end) - return pgm_read_byte(_ptr++); - else - return -1; - } - - size_t readBytes(char* buffer, size_t length) { - size_t available = static_cast(_end - _ptr); - if (available < length) - length = available; - memcpy_P(buffer, _ptr, length); - _ptr += length; - return length; - } -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp deleted file mode 100644 index 37c3c31..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -namespace ARDUINOJSON_NAMESPACE { - -template -class IteratorReader { - TIterator _ptr, _end; - - public: - explicit IteratorReader(TIterator begin, TIterator end) - : _ptr(begin), _end(end) {} - - int read() { - if (_ptr < _end) - return static_cast(*_ptr++); - else - return -1; - } - - size_t readBytes(char* buffer, size_t length) { - size_t i = 0; - while (i < length && _ptr < _end) buffer[i++] = *_ptr++; - return i; - } -}; - -template -struct void_ { - typedef void type; -}; - -template -struct Reader::type> - : IteratorReader { - explicit Reader(const TSource& source) - : IteratorReader(source.begin(), - source.end()) {} -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp deleted file mode 100644 index 67cf682..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -struct IsCharOrVoid { - static const bool value = - is_same::value || is_same::value || - is_same::value || is_same::value; -}; - -template -struct IsCharOrVoid : IsCharOrVoid {}; - -template -struct Reader::value>::type> { - const char* _ptr; - - public: - explicit Reader(const void* ptr) - : _ptr(ptr ? reinterpret_cast(ptr) : "") {} - - int read() { - return static_cast(*_ptr++); - } - - size_t readBytes(char* buffer, size_t length) { - for (size_t i = 0; i < length; i++) buffer[i] = *_ptr++; - return length; - } -}; - -template -struct BoundedReader::value>::type> - : public IteratorReader { - public: - explicit BoundedReader(const void* ptr, size_t len) - : IteratorReader(reinterpret_cast(ptr), - reinterpret_cast(ptr) + len) {} -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp deleted file mode 100644 index eebaa2c..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -struct Reader::value>::type> { - public: - explicit Reader(std::istream& stream) : _stream(&stream) {} - - int read() { - return _stream->get(); - } - - size_t readBytes(char* buffer, size_t length) { - _stream->read(buffer, static_cast(length)); - return static_cast(_stream->gcount()); - } - - private: - std::istream* _stream; -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp deleted file mode 100644 index e56e262..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -struct Reader, void> : Reader { - explicit Reader(const ElementProxy& x) - : Reader(x.template as()) {} -}; - -template -struct Reader, void> : Reader { - explicit Reader(const MemberProxy& x) - : Reader(x.template as()) {} -}; - -template <> -struct Reader : Reader { - explicit Reader(VariantRef x) : Reader(x.as()) {} -}; - -template <> -struct Reader : Reader { - explicit Reader(VariantConstRef x) - : Reader(x.as()) {} -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp deleted file mode 100644 index 2329542..0000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp +++ /dev/null @@ -1,71 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template