From 20063d48ed05e0cea3faa2f7497cf4b4cd5e6e22 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 26 May 2024 16:06:18 +0200 Subject: [PATCH 01/53] update modules --- pio_local.ini_example | 28 ++++++++++++++++-------- platformio.ini | 13 +++++------ scripts/refresh_module_library_native.py | 11 ++++++++++ scripts/run_native.py | 11 ++++++++++ src/console.cpp | 18 +++++++-------- src/emsesp.cpp | 3 +++ src/emsesp.h | 5 +++++ src/version.h | 2 +- 8 files changed, 65 insertions(+), 26 deletions(-) create mode 100644 scripts/refresh_module_library_native.py create mode 100644 scripts/run_native.py diff --git a/pio_local.ini_example b/pio_local.ini_example index 7b41a7bc8..f38c988f1 100644 --- a/pio_local.ini_example +++ b/pio_local.ini_example @@ -16,33 +16,43 @@ ; my_build_flags = -DEMSESP_DEBUG -DEMSESP_TEST -DEMSESP_PINGTEST [platformio] -; default_envs = esp32_4M +default_envs = esp32_4M ; default_envs = esp32_16M -default_envs = lolin_s3 -; default_envs = standalone +; default_envs = lolin_s3 +; default_envs = native ; default_envs = debug ; default_envs = custom [env] ; upload settings -upload_protocol = custom +; for USB +upload_protocol = esptool +upload_port = /dev/ttyUSB* +; for OTA +; upload_protocol = custom custom_emsesp_ip = 10.10.10.173 ; custom_emsesp_ip = ems-esp.local custom_username = admin custom_password = admin -upload_port = /dev/ttyUSB* +; uncomment this next line if using the github repo +lib_deps = file://../../modules/EMS-ESP-Modules + +[env:native] +extra_scripts = +; pre:scripts/refresh_module_library_native.py +; post:scripts/run_native.py [env:esp32_4M] extra_scripts = - pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time +; pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time scripts/rename_fw.py -; scripts/upload.py + scripts/upload.py [env:lolin_s3] extra_scripts = pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time scripts/rename_fw.py -; scripts/upload.py + scripts/upload.py [env:custom] ; use for basic ESP boards with 4MB flash @@ -60,7 +70,7 @@ board_upload.use_1200bps_touch = false board_upload.wait_for_upload_port = true upload_port = /dev/ttyUSB0 extra_scripts = - ; pre:scripts/build_interface.py + pre:scripts/build_interface.py scripts/rename_fw.py build_unflags = ${common.unbuild_flags} build_flags = diff --git a/platformio.ini b/platformio.ini index 2610727fe..7a5084f3c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,7 +12,7 @@ extra_configs = pio_local.ini [common] -core_build_flags = -std=gnu++2a +core_build_flags = -std=gnu++2a -Isrc core_unbuild_flags = -std=gnu++11 ; my_build_flags is set in pio_local.ini @@ -64,10 +64,11 @@ extra_scripts = [env] monitor_speed = 115200 -monitor_filters = direct, esp32_exception_decoder +monitor_filters = direct upload_speed = 921600 build_type = release lib_ldf_mode = chain+ +lib_deps = https://github.com/emsesp/EMS-ESP-Modules.git check_tool = cppcheck, clangtidy check_severity = high, medium check_flags = @@ -205,15 +206,13 @@ build_flags = -D CONFIG_UART_ISR_IN_IRAM -D CONFIG_ASYNC_TCP_STACK_SIZE=5120 -; to build and run: pio run -e standalone -t exec -[env:standalone] +; to build and run: pio run -e native -t exec +[env:native] platform = native build_flags = -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.0-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" - -lpthread - -D__linux__ -std=gnu++14 -Og -ggdb build_src_flags = -Wall -Wextra -Werror @@ -228,7 +227,7 @@ build_src_flags = -I./lib/espMqttClient/src -I./lib/espMqttClient/src/Transport build_src_filter = - +<*> + +<*> -<.git/> +<../lib_standalone> +<../lib/uuid-common> diff --git a/scripts/refresh_module_library_native.py b/scripts/refresh_module_library_native.py new file mode 100644 index 000000000..bb647ebf6 --- /dev/null +++ b/scripts/refresh_module_library_native.py @@ -0,0 +1,11 @@ +import os + +Import("env") + +def refresh_module(): + print("Fetching latest module for Native target...") + os.system("pio pkg install -f -s -e native -l file://../../modules/EMS-ESP-Modules") + +if not (env.IsCleanTarget()): + refresh_module() + diff --git a/scripts/run_native.py b/scripts/run_native.py new file mode 100644 index 000000000..dc786953d --- /dev/null +++ b/scripts/run_native.py @@ -0,0 +1,11 @@ +import os + +Import("env") + +def run_native(): + print("Running native...") + os.system("pio run -e native") + +if not (env.IsCleanTarget()): + run_native() + diff --git a/src/console.cpp b/src/console.cpp index 20271ccc1..df9b898e1 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -636,15 +636,15 @@ void EMSESPShell::stopped() { // show welcome banner void EMSESPShell::display_banner() { println(); - printfln("┌──────────────────────────────────────────┐"); - printfln("│ %sEMS-ESP version %-12s%s │", COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF); - printfln("│ │"); - printfln("│ %shelp%s to show available commands │", COLOR_UNDERLINE, COLOR_RESET); - printfln("│ %ssu%s to access admin commands │", COLOR_UNDERLINE, COLOR_RESET); - printfln("│ │"); - printfln("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │", COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET); - printfln("│ │"); - printfln("└──────────────────────────────────────────┘"); + printfln("┌───────────────────────────────────────┐"); + printfln("│ %sEMS-ESP version %-20s%s │", COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF); + printfln("│ │"); + printfln("│ %shelp%s to show available commands │", COLOR_UNDERLINE, COLOR_RESET); + printfln("│ %ssu%s to access admin commands │", COLOR_UNDERLINE, COLOR_RESET); + printfln("│ │"); + printfln("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │", COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET); + printfln("│ │"); + printfln("└───────────────────────────────────────┘"); println(); // set console name diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 0265ec0fa..c5c6488fb 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -75,6 +75,7 @@ TemperatureSensor EMSESP::temperaturesensor_; // Temperature sensors AnalogSensor EMSESP::analogsensor_; // Analog sensors Shower EMSESP::shower_; // Shower logic Preferences EMSESP::nvs_; // NV Storage +ModuleLibrary EMSESP::module_; // Module Library // static/common variables uint16_t EMSESP::watch_id_ = WATCH_ID_NONE; // for when log is TRACE. 0 means no trace set @@ -1645,6 +1646,8 @@ void EMSESP::start() { #endif webServer.begin(); // start the web server + + module_.setup(this); // setup the external library modules } // main loop calling all services diff --git a/src/emsesp.h b/src/emsesp.h index c283873d8..71a1c87e6 100644 --- a/src/emsesp.h +++ b/src/emsesp.h @@ -65,6 +65,10 @@ #include "command.h" #include "version.h" +// Load external modules +class Module {}; // forward declaration +#include + #define WATCH_ID_NONE 0 // no watch id set // helpers for callback functions @@ -218,6 +222,7 @@ class EMSESP { static RxService rxservice_; static TxService txservice_; static Preferences nvs_; + static ModuleLibrary module_; // web controllers static ESP8266React esp8266React; diff --git a/src/version.h b/src/version.h index b969f3758..e0c1fdd1e 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.0-dev.11" +#define EMSESP_APP_VERSION "3.7.0-dev.11m" From 29da1b646aceae2af89b630149bfc317ad13474a Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 27 May 2024 22:14:53 +0200 Subject: [PATCH 02/53] use online version of ArduinoJson --- lib/ArduinoJson/ArduinoJson.h | 5 - lib/ArduinoJson/CHANGELOG.md | 130 ---- lib/ArduinoJson/LICENSE.txt | 10 - lib/ArduinoJson/README.md | 155 ---- lib/ArduinoJson/SUPPORT.md | 27 - lib/ArduinoJson/src/ArduinoJson.h | 17 - lib/ArduinoJson/src/ArduinoJson.hpp | 53 -- .../src/ArduinoJson/Array/ArrayData.hpp | 57 -- .../src/ArduinoJson/Array/ArrayImpl.hpp | 50 -- .../src/ArduinoJson/Array/ElementProxy.hpp | 65 -- .../src/ArduinoJson/Array/JsonArray.hpp | 196 ----- .../src/ArduinoJson/Array/JsonArrayConst.hpp | 119 --- .../ArduinoJson/Array/JsonArrayIterator.hpp | 96 --- .../src/ArduinoJson/Array/Utilities.hpp | 114 --- .../ArduinoJson/Collection/CollectionData.hpp | 133 ---- .../ArduinoJson/Collection/CollectionImpl.hpp | 133 ---- .../src/ArduinoJson/Configuration.hpp | 253 ------- .../Deserialization/DeserializationError.hpp | 106 --- .../DeserializationOptions.hpp | 35 - .../ArduinoJson/Deserialization/Filter.hpp | 77 -- .../Deserialization/NestingLimit.hpp | 32 - .../ArduinoJson/Deserialization/Reader.hpp | 75 -- .../Readers/ArduinoStreamReader.hpp | 31 - .../Readers/ArduinoStringReader.hpp | 19 - .../Deserialization/Readers/FlashReader.hpp | 56 -- .../Readers/IteratorReader.hpp | 45 -- .../Deserialization/Readers/RamReader.hpp | 51 -- .../Readers/StdStreamReader.hpp | 30 - .../Deserialization/Readers/VariantReader.hpp | 19 - .../Deserialization/deserialize.hpp | 83 --- .../src/ArduinoJson/Document/JsonDocument.hpp | 375 ---------- .../src/ArduinoJson/Json/EscapeSequence.hpp | 40 - .../src/ArduinoJson/Json/JsonDeserializer.hpp | 695 ------------------ .../src/ArduinoJson/Json/JsonSerializer.hpp | 161 ---- .../src/ArduinoJson/Json/Latch.hpp | 56 -- .../ArduinoJson/Json/PrettyJsonSerializer.hpp | 104 --- .../src/ArduinoJson/Json/TextFormatter.hpp | 173 ----- .../src/ArduinoJson/Json/Utf16.hpp | 67 -- lib/ArduinoJson/src/ArduinoJson/Json/Utf8.hpp | 46 -- .../src/ArduinoJson/Memory/Alignment.hpp | 60 -- .../src/ArduinoJson/Memory/Allocator.hpp | 49 -- .../ArduinoJson/Memory/ResourceManager.hpp | 127 ---- .../src/ArduinoJson/Memory/StringBuilder.hpp | 80 -- .../src/ArduinoJson/Memory/StringNode.hpp | 73 -- .../src/ArduinoJson/Memory/StringPool.hpp | 105 --- .../src/ArduinoJson/Memory/VariantPool.hpp | 63 -- .../ArduinoJson/Memory/VariantPoolImpl.hpp | 81 -- .../ArduinoJson/Memory/VariantPoolList.hpp | 189 ----- .../src/ArduinoJson/Misc/SerializedValue.hpp | 71 -- .../MsgPack/MsgPackDeserializer.hpp | 586 --------------- .../ArduinoJson/MsgPack/MsgPackSerializer.hpp | 244 ------ .../src/ArduinoJson/MsgPack/endianess.hpp | 46 -- .../src/ArduinoJson/MsgPack/ieee754.hpp | 18 - lib/ArduinoJson/src/ArduinoJson/Namespace.hpp | 42 -- .../src/ArduinoJson/Numbers/FloatParts.hpp | 88 --- .../src/ArduinoJson/Numbers/FloatTraits.hpp | 212 ------ .../src/ArduinoJson/Numbers/JsonFloat.hpp | 18 - .../src/ArduinoJson/Numbers/JsonInteger.hpp | 28 - .../ArduinoJson/Numbers/arithmeticCompare.hpp | 120 --- .../src/ArduinoJson/Numbers/convertNumber.hpp | 135 ---- .../src/ArduinoJson/Numbers/parseNumber.hpp | 152 ---- .../src/ArduinoJson/Object/JsonObject.hpp | 215 ------ .../ArduinoJson/Object/JsonObjectConst.hpp | 143 ---- .../ArduinoJson/Object/JsonObjectIterator.hpp | 81 -- .../src/ArduinoJson/Object/JsonPair.hpp | 70 -- .../src/ArduinoJson/Object/MemberProxy.hpp | 67 -- .../src/ArduinoJson/Object/ObjectData.hpp | 73 -- .../src/ArduinoJson/Object/ObjectImpl.hpp | 45 -- .../src/ArduinoJson/Polyfills/alias_cast.hpp | 30 - .../src/ArduinoJson/Polyfills/assert.hpp | 14 - .../src/ArduinoJson/Polyfills/attributes.hpp | 45 -- .../src/ArduinoJson/Polyfills/ctype.hpp | 21 - .../src/ArduinoJson/Polyfills/integer.hpp | 31 - .../src/ArduinoJson/Polyfills/limits.hpp | 45 -- .../src/ArduinoJson/Polyfills/math.hpp | 27 - .../src/ArduinoJson/Polyfills/mpl/max.hpp | 27 - .../src/ArduinoJson/Polyfills/pgmspace.hpp | 144 ---- .../Polyfills/pgmspace_generic.hpp | 67 -- .../ArduinoJson/Polyfills/preprocessor.hpp | 29 - .../src/ArduinoJson/Polyfills/type_traits.hpp | 25 - .../Polyfills/type_traits/conditional.hpp | 21 - .../Polyfills/type_traits/declval.hpp | 14 - .../Polyfills/type_traits/enable_if.hpp | 20 - .../type_traits/integral_constant.hpp | 19 - .../Polyfills/type_traits/is_array.hpp | 22 - .../Polyfills/type_traits/is_base_of.hpp | 27 - .../Polyfills/type_traits/is_class.hpp | 23 - .../Polyfills/type_traits/is_const.hpp | 18 - .../Polyfills/type_traits/is_convertible.hpp | 46 -- .../Polyfills/type_traits/is_enum.hpp | 22 - .../type_traits/is_floating_point.hpp | 20 - .../Polyfills/type_traits/is_integral.hpp | 32 - .../Polyfills/type_traits/is_pointer.hpp | 17 - .../Polyfills/type_traits/is_same.hpp | 18 - .../Polyfills/type_traits/is_signed.hpp | 26 - .../Polyfills/type_traits/is_unsigned.hpp | 24 - .../Polyfills/type_traits/make_unsigned.hpp | 41 -- .../Polyfills/type_traits/make_void.hpp | 14 - .../Polyfills/type_traits/remove_const.hpp | 21 - .../Polyfills/type_traits/remove_cv.hpp | 28 - .../type_traits/remove_reference.hpp | 21 - .../Polyfills/type_traits/type_identity.hpp | 16 - .../src/ArduinoJson/Polyfills/utility.hpp | 33 - .../Serialization/CountingDecorator.hpp | 33 - .../src/ArduinoJson/Serialization/Writer.hpp | 47 -- .../Writers/ArduinoStringWriter.hpp | 55 -- .../Serialization/Writers/DummyWriter.hpp | 22 - .../Serialization/Writers/PrintWriter.hpp | 30 - .../Writers/StaticStringWriter.hpp | 36 - .../Serialization/Writers/StdStreamWriter.hpp | 33 - .../Serialization/Writers/StdStringWriter.hpp | 43 -- .../src/ArduinoJson/Serialization/measure.hpp | 19 - .../ArduinoJson/Serialization/serialize.hpp | 51 -- .../Strings/Adapters/FlashString.hpp | 93 --- .../Strings/Adapters/JsonString.hpp | 35 - .../Strings/Adapters/RamString.hpp | 143 ---- .../Strings/Adapters/StringObject.hpp | 51 -- .../src/ArduinoJson/Strings/IsString.hpp | 20 - .../src/ArduinoJson/Strings/JsonString.hpp | 84 --- .../src/ArduinoJson/Strings/StringAdapter.hpp | 31 - .../ArduinoJson/Strings/StringAdapters.hpp | 77 -- .../src/ArduinoJson/Strings/StringTraits.hpp | 79 -- .../src/ArduinoJson/Variant/Converter.hpp | 26 - .../src/ArduinoJson/Variant/ConverterImpl.hpp | 419 ----------- .../src/ArduinoJson/Variant/JsonVariant.hpp | 85 --- .../ArduinoJson/Variant/JsonVariantConst.hpp | 156 ---- .../ArduinoJson/Variant/JsonVariantCopier.hpp | 34 - .../Variant/JsonVariantVisitor.hpp | 61 -- .../ArduinoJson/Variant/VariantAttorney.hpp | 35 - .../ArduinoJson/Variant/VariantCompare.hpp | 216 ------ .../ArduinoJson/Variant/VariantContent.hpp | 55 -- .../src/ArduinoJson/Variant/VariantData.hpp | 496 ------------- .../Variant/VariantDataVisitor.hpp | 24 - .../ArduinoJson/Variant/VariantOperators.hpp | 195 ----- .../ArduinoJson/Variant/VariantRefBase.hpp | 276 ------- .../Variant/VariantRefBaseImpl.hpp | 177 ----- .../src/ArduinoJson/Variant/VariantSlot.hpp | 86 --- .../src/ArduinoJson/Variant/VariantTag.hpp | 16 - .../src/ArduinoJson/Variant/VariantTo.hpp | 34 - .../src/ArduinoJson/compatibility.hpp | 144 ---- lib/ArduinoJson/src/ArduinoJson/version.hpp | 11 - 141 files changed, 11846 deletions(-) delete mode 100755 lib/ArduinoJson/ArduinoJson.h delete mode 100755 lib/ArduinoJson/CHANGELOG.md delete mode 100755 lib/ArduinoJson/LICENSE.txt delete mode 100755 lib/ArduinoJson/README.md delete mode 100755 lib/ArduinoJson/SUPPORT.md delete mode 100755 lib/ArduinoJson/src/ArduinoJson.h delete mode 100755 lib/ArduinoJson/src/ArduinoJson.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Array/ArrayData.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Configuration.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/EscapeSequence.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/JsonDeserializer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/JsonSerializer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/Latch.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/PrettyJsonSerializer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/TextFormatter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/Utf16.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Json/Utf8.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/Alignment.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/Allocator.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/ResourceManager.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/StringBuilder.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/StringNode.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/StringPool.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/VariantPool.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/VariantPoolImpl.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Memory/VariantPoolList.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Misc/SerializedValue.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackDeserializer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/MsgPack/endianess.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/MsgPack/ieee754.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Namespace.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Numbers/FloatParts.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Numbers/FloatTraits.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Numbers/JsonFloat.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Numbers/JsonInteger.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Numbers/arithmeticCompare.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Numbers/convertNumber.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Numbers/parseNumber.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Object/JsonObject.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Object/JsonObjectConst.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Object/JsonObjectIterator.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Object/JsonPair.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Object/MemberProxy.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Object/ObjectData.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Object/ObjectImpl.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/alias_cast.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/assert.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/attributes.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/ctype.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/integer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/limits.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/math.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/mpl/max.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/pgmspace.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/pgmspace_generic.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/preprocessor.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/conditional.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/declval.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/enable_if.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/integral_constant.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_array.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_base_of.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_class.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_const.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_convertible.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_enum.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_floating_point.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_integral.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_pointer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_same.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/make_unsigned.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/make_void.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_const.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_cv.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_reference.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/type_identity.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/CountingDecorator.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/Writer.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/ArduinoStringWriter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/DummyWriter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/PrintWriter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/StaticStringWriter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/StdStreamWriter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/StdStringWriter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/measure.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Serialization/serialize.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/FlashString.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/JsonString.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/RamString.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringObject.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/IsString.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/JsonString.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/StringAdapter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/StringAdapters.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Strings/StringTraits.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/Converter.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/ConverterImpl.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/JsonVariant.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/JsonVariantConst.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/JsonVariantCopier.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/JsonVariantVisitor.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantAttorney.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantCompare.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantContent.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantDataVisitor.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantRefBase.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantRefBaseImpl.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantSlot.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantTag.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/Variant/VariantTo.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/compatibility.hpp delete mode 100755 lib/ArduinoJson/src/ArduinoJson/version.hpp diff --git a/lib/ArduinoJson/ArduinoJson.h b/lib/ArduinoJson/ArduinoJson.h deleted file mode 100755 index 993959949..000000000 --- a/lib/ArduinoJson/ArduinoJson.h +++ /dev/null @@ -1,5 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#include "src/ArduinoJson.h" diff --git a/lib/ArduinoJson/CHANGELOG.md b/lib/ArduinoJson/CHANGELOG.md deleted file mode 100755 index fa4cfe6f0..000000000 --- a/lib/ArduinoJson/CHANGELOG.md +++ /dev/null @@ -1,130 +0,0 @@ -ArduinoJson: change log -======================= - -v7.0.3 (2024-02-05) ------- - -* Improve error messages when using `char` or `char*` (issue #2043) -* Reduce stack consumption (issue #2046) -* Fix compatibility with GCC 4.8 (issue #2045) - -v7.0.2 (2024-01-19) ------- - -* Fix assertion `poolIndex < count_` after `JsonDocument::clear()` (issue #2034) - -v7.0.1 (2024-01-10) ------- - -* Fix "no matching function" with `JsonObjectConst::operator[]` (issue #2019) -* Remove unused files in the PlatformIO package -* Fix `volatile bool` serialized as `1` or `0` instead of `true` or `false` (issue #2029) - -v7.0.0 (2024-01-03) ------- - -* Remove `BasicJsonDocument` -* Remove `StaticJsonDocument` -* Add abstract `Allocator` class -* Merge `DynamicJsonDocument` with `JsonDocument` -* Remove `JSON_ARRAY_SIZE()`, `JSON_OBJECT_SIZE()`, and `JSON_STRING_SIZE()` -* Remove `ARDUINOJSON_ENABLE_STRING_DEDUPLICATION` (string deduplication cannot be disabled anymore) -* Remove `JsonDocument::capacity()` -* Store the strings in the heap -* Reference-count shared strings -* Always store `serialized("string")` by copy (#1915) -* Remove the zero-copy mode of `deserializeJson()` and `deserializeMsgPack()` -* Fix double lookup in `to()` -* Fix double call to `size()` in `serializeMsgPack()` -* Include `ARDUINOJSON_SLOT_OFFSET_SIZE` in the namespace name -* Remove `JsonVariant::shallowCopy()` -* `JsonDocument`'s capacity grows as needed, no need to pass it to the constructor anymore -* `JsonDocument`'s allocator is not monotonic anymore, removed values get recycled -* Show a link to the documentation when user passes an unsupported input type -* Remove `JsonDocument::memoryUsage()` -* Remove `JsonDocument::garbageCollect()` -* Add `deserializeJson(JsonVariant, ...)` and `deserializeMsgPack(JsonVariant, ...)` (#1226) -* Call `shrinkToFit()` in `deserializeJson()` and `deserializeMsgPack()` -* `serializeJson()` and `serializeMsgPack()` replace the content of `std::string` and `String` instead of appending to it -* Replace `add()` with `add()` (`add(T)` is still supported) -* Remove `createNestedArray()` and `createNestedObject()` (use `to()` and `to()` instead) - -> ### BREAKING CHANGES -> -> As every major release, ArduinoJson 7 introduces several breaking changes. -> I added some stubs so that most existing programs should compile, but I highty recommend you upgrade your code. -> -> #### `JsonDocument` -> -> In ArduinoJson 6, you could allocate the memory pool on the stack (with `StaticJsonDocument`) or in the heap (with `DynamicJsonDocument`). -> In ArduinoJson 7, the memory pool is always allocated in the heap, so `StaticJsonDocument` and `DynamicJsonDocument` have been merged into `JsonDocument`. -> -> In ArduinoJson 6, `JsonDocument` had a fixed capacity; in ArduinoJson 7, it has an elastic capacity that grows as needed. -> Therefore, you don't need to specify the capacity anymore, so the macros `JSON_ARRAY_SIZE()`, `JSON_OBJECT_SIZE()`, and `JSON_STRING_SIZE()` have been removed. -> -> ```c++ -> // ArduinoJson 6 -> StaticJsonDocument<256> doc; -> // or -> DynamicJsonDocument doc(256); -> -> // ArduinoJson 7 -> JsonDocument doc; -> ``` -> -> In ArduinoJson 7, `JsonDocument` reuses released memory, so `garbageCollect()` has been removed. -> `shrinkToFit()` is still available and releases the over-allocated memory. -> -> Due to a change in the implementation, it's not possible to store a pointer to a variant from another `JsonDocument`, so `shallowCopy()` has been removed. -> -> In ArduinoJson 6, the meaning of `memoryUsage()` was clear: it returned the number of bytes used in the memory pool. -> In ArduinoJson 7, the meaning of `memoryUsage()` would be ambiguous, so it has been removed. -> -> #### Custom allocators -> -> In ArduinoJson 6, you could specify a custom allocator class as a template parameter of `BasicJsonDocument`. -> In ArduinoJson 7, you must inherit from `ArduinoJson::Allocator` and pass a pointer to an instance of your class to the constructor of `JsonDocument`. -> -> ```c++ -> // ArduinoJson 6 -> class MyAllocator { -> // ... -> }; -> BasicJsonDocument doc(256); -> -> // ArduinoJson 7 -> class MyAllocator : public ArduinoJson::Allocator { -> // ... -> }; -> MyAllocator myAllocator; -> JsonDocument doc(&myAllocator); -> ``` -> -> #### `createNestedArray()` and `createNestedObject()` -> -> In ArduinoJson 6, you could create a nested array or object with `createNestedArray()` and `createNestedObject()`. -> In ArduinoJson 7, you must use `add()` or `to()` instead. -> -> For example, to create `[[],{}]`, you would write: -> -> ```c++ -> // ArduinoJson 6 -> arr.createNestedArray(); -> arr.createNestedObject(); -> -> // ArduinoJson 7 -> arr.add(); -> arr.add(); -> ``` -> -> And to create `{"array":[],"object":{}}`, you would write: -> -> ```c++ -> // ArduinoJson 6 -> obj.createNestedArray("array"); -> obj.createNestedObject("object"); -> -> // ArduinoJson 7 -> obj["array"].to(); -> obj["object"].to(); -> ``` diff --git a/lib/ArduinoJson/LICENSE.txt b/lib/ArduinoJson/LICENSE.txt deleted file mode 100755 index 56bb92b7f..000000000 --- a/lib/ArduinoJson/LICENSE.txt +++ /dev/null @@ -1,10 +0,0 @@ -The MIT License (MIT) ---------------------- - -Copyright © 2014-2024, 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 100755 index 2900240e5..000000000 --- a/lib/ArduinoJson/README.md +++ /dev/null @@ -1,155 +0,0 @@ -

- ArduinoJson -

- ---- - -[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bblanchon/ArduinoJson/ci.yml?branch=7.x&logo=github)](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A7.x) -[![Continuous Integration](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/7.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/7.x) -[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) -[![Coveralls branch](https://img.shields.io/coveralls/github/bblanchon/ArduinoJson/7.x?logo=coveralls)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=7.x) -[![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat&logo=github&color=orange)](https://github.com/bblanchon/ArduinoJson/stargazers) -[![GitHub Sponsors](https://img.shields.io/github/sponsors/bblanchon?logo=github&color=orange)](https://github.com/sponsors/bblanchon) - -ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). - -## Features - -* [JSON deserialization](https://arduinojson.org/v7/api/json/deserializejson/) - * [Optionally decodes UTF-16 escape sequences to UTF-8](https://arduinojson.org/v7/api/config/decode_unicode/) - * [Optionally supports comments in the input](https://arduinojson.org/v7/api/config/enable_comments/) - * [Optionally filters the input to keep only desired values](https://arduinojson.org/v7/api/json/deserializejson/#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/v7/api/json/serializejson/) - * [Can write to a buffer or a stream](https://arduinojson.org/v7/api/json/serializejson/) - * [Optionally indents the document (prettified JSON)](https://arduinojson.org/v7/api/json/serializejsonpretty/) -* [MessagePack serialization](https://arduinojson.org/v7/api/msgpack/serializemsgpack/) -* [MessagePack deserialization](https://arduinojson.org/v7/api/msgpack/deserializemsgpack/) -* Efficient - * [Twice smaller than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/) - * [Almost 10% faster than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/) - * [Consumes roughly 10% less RAM than the "official" Arduino_JSON library](https://arduinojson.org/2019/11/19/arduinojson-vs-arduino_json/) - * [Deduplicates strings](https://arduinojson.org/news/2020/08/01/version-6-16-0/) -* Versatile - * Supports [custom allocators (to use external RAM chip, for example)](https://arduinojson.org/v7/how-to/use-external-ram-on-esp32/) - * Supports [`String`](https://arduinojson.org/v7/api/config/enable_arduino_string/), [`std::string`](https://arduinojson.org/v7/api/config/enable_std_string/), and [`std::string_view`](https://arduinojson.org/v7/api/config/enable_string_view/) - * Supports [`Stream`](https://arduinojson.org/v7/api/config/enable_arduino_stream/) and [`std::istream`/`std::ostream`](https://arduinojson.org/v7/api/config/enable_std_stream/) - * Supports [Flash strings](https://arduinojson.org/v7/api/config/enable_progmem/) - * Supports [custom readers](https://arduinojson.org/v7/api/json/deserializejson/#custom-reader) and [custom writers](https://arduinojson.org/v7/api/json/serializejson/#custom-writer) - * Supports [custom converters](https://arduinojson.org/news/2021/05/04/version-6-18-0/) -* Portable - * Usable on any C++ project (not limited to Arduino) - * Compatible with C++11, C++14 and C++17 - * Support for C++98/C++03 available on [ArduinoJson 6.20.x](https://github.com/bblanchon/ArduinoJson/tree/6.20.x) - * 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)... - * Soft cores: [Nios II](https://en.wikipedia.org/wiki/Nios_II)... - * 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/v7/how-to/use-arduinojson-with-cmake/) -* Well designed - * [Elegant API](http://arduinojson.org/v7/example/) - * [Thread-safe](https://en.wikipedia.org/wiki/Thread_safety) - * Self-contained (no external dependency) - * `const` friendly - * [`for` friendly](https://arduinojson.org/v7/api/jsonobject/begin_end/) - * [TMP friendly](https://en.wikipedia.org/wiki/Template_metaprogramming) - * Handles [integer overflows](https://arduinojson.org/v7/api/jsonvariant/as/#integer-overflows) -* Well tested - * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=7.x) - * Continuously tested on - * [Visual Studio 2017, 2019, 2022](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/7.x) - * [GCC 4.8, 5, 6, 7, 8, 9, 10, 11, 12](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) - * [Clang 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10, 11, 12, 13, 14, 15](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) - * Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/) -* Well documented - * [Tutorials](https://arduinojson.org/v7/doc/deserialization/) - * [Examples](https://arduinojson.org/v7/example/) - * [How-tos](https://arduinojson.org/v7/example/) - * [FAQ](https://arduinojson.org/v7/faq/) - * [Troubleshooter](https://arduinojson.org/v7/troubleshooter/) - * [Book](https://arduinojson.org/book/) - * [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) - * [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++ -const char* json = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; - -JsonDocument doc; -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/v7/doc/deserialization/) - -### Serialization - -Here is a program that generates a JSON document with ArduinoJson: - -```c++ -JsonDocument doc; - -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/v7/doc/serialization/) - -## Sponsors - -ArduinoJson is thankful to its sponsors. Please give them a visit; they deserve it! - -

- - Programming Electronics Academy - -

-

- - 1technophile - -

- -If you run a commercial project that embeds ArduinoJson, think about [sponsoring the library's development](https://github.com/sponsors/bblanchon): it ensures the code that your products rely on stays actively maintained. It can also give your project some exposure to the makers' community. - -If you are an individual user and want to support the development (or give a sign of appreciation), consider purchasing the book [Mastering ArduinoJson](https://arduinojson.org/book/) ❤, or simply [cast a star](https://github.com/bblanchon/ArduinoJson/stargazers) ⭐. diff --git a/lib/ArduinoJson/SUPPORT.md b/lib/ArduinoJson/SUPPORT.md deleted file mode 100755 index c47e1b1ba..000000000 --- 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/src/ArduinoJson.h b/lib/ArduinoJson/src/ArduinoJson.h deleted file mode 100755 index fec64c3d1..000000000 --- a/lib/ArduinoJson/src/ArduinoJson.h +++ /dev/null @@ -1,17 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// 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 100755 index c210ed266..000000000 --- a/lib/ArduinoJson/src/ArduinoJson.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#if __cplusplus < 201103L && (!defined(_MSC_VER) || _MSC_VER < 1910) -# error ArduinoJson requires C++11 or newer. Configure your compiler for C++11 or downgrade ArduinoJson to 6.20. -#endif - -#include "ArduinoJson/Configuration.hpp" - -// Include Arduino.h before stdlib.h to avoid conflict with atexit() -// https://github.com/bblanchon/ArduinoJson/pull/1693#issuecomment-1001060240 -#if ARDUINOJSON_ENABLE_ARDUINO_STRING || ARDUINOJSON_ENABLE_ARDUINO_STREAM || \ - ARDUINOJSON_ENABLE_ARDUINO_PRINT || \ - (ARDUINOJSON_ENABLE_PROGMEM && defined(ARDUINO)) -# include -#endif - -#if !ARDUINOJSON_DEBUG -# ifdef __clang__ -# pragma clang system_header -# elif defined __GNUC__ -# pragma GCC system_header -# endif -#endif - -#include "ArduinoJson/Array/JsonArray.hpp" -#include "ArduinoJson/Object/JsonObject.hpp" -#include "ArduinoJson/Variant/JsonVariantConst.hpp" - -#include "ArduinoJson/Document/JsonDocument.hpp" - -#include "ArduinoJson/Array/ArrayImpl.hpp" -#include "ArduinoJson/Array/ElementProxy.hpp" -#include "ArduinoJson/Array/Utilities.hpp" -#include "ArduinoJson/Collection/CollectionImpl.hpp" -#include "ArduinoJson/Memory/VariantPoolImpl.hpp" -#include "ArduinoJson/Object/MemberProxy.hpp" -#include "ArduinoJson/Object/ObjectImpl.hpp" -#include "ArduinoJson/Variant/ConverterImpl.hpp" -#include "ArduinoJson/Variant/JsonVariantCopier.hpp" -#include "ArduinoJson/Variant/VariantCompare.hpp" -#include "ArduinoJson/Variant/VariantRefBaseImpl.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" diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayData.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayData.hpp deleted file mode 100755 index 93a65d543..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayData.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -class ArrayData : public CollectionData { - public: - VariantData* addElement(ResourceManager* resources) { - return addSlot(resources).data(); - } - - static VariantData* addElement(ArrayData* array, ResourceManager* resources) { - if (!array) - return nullptr; - return array->addElement(resources); - } - - VariantData* getOrAddElement(size_t index, ResourceManager* resources); - - VariantData* getElement(size_t index, const ResourceManager* resources) const; - - static VariantData* getElement(const ArrayData* array, size_t index, - const ResourceManager* resources) { - if (!array) - return nullptr; - return array->getElement(index, resources); - } - - void removeElement(size_t index, ResourceManager* resources); - - static void removeElement(ArrayData* array, size_t index, - ResourceManager* resources) { - if (!array) - return; - array->removeElement(index, resources); - } - - bool copyFrom(const ArrayData& src, ResourceManager* resources); - - static bool copy(ArrayData* dst, const ArrayData* src, - ResourceManager* resources) { - if (!dst || !src) - return false; - - return dst->copyFrom(*src, resources); - } - - private: - iterator at(size_t index, const ResourceManager* resources) const; -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp deleted file mode 100755 index 595e847b3..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -inline ArrayData::iterator ArrayData::at( - size_t index, const ResourceManager* resources) const { - auto it = createIterator(resources); - while (!it.done() && index) { - it.next(resources); - --index; - } - return it; -} - -inline VariantData* ArrayData::getOrAddElement(size_t index, - ResourceManager* resources) { - auto it = createIterator(resources); - while (!it.done() && index > 0) { - it.next(resources); - index--; - } - if (it.done()) - index++; - VariantData* element = it.data(); - while (index > 0) { - element = addElement(resources); - if (!element) - return nullptr; - index--; - } - return element; -} - -inline VariantData* ArrayData::getElement( - size_t index, const ResourceManager* resources) const { - return at(index, resources).data(); -} - -inline void ArrayData::removeElement(size_t index, ResourceManager* resources) { - remove(at(index, resources), resources); -} - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp deleted file mode 100755 index f36b68ea3..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp +++ /dev/null @@ -1,65 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -// A proxy class to get or set an element of an array. -// https://arduinojson.org/v7/api/jsonarray/subscript/ -template -class ElementProxy : public VariantRefBase>, - public VariantOperators> { - friend class VariantAttorney; - - public: - ElementProxy(TUpstream upstream, size_t index) - : upstream_(upstream), index_(index) {} - - ElementProxy(const ElementProxy& src) - : upstream_(src.upstream_), index_(src.index_) {} - - ElementProxy& operator=(const ElementProxy& src) { - this->set(src); - return *this; - } - - template - ElementProxy& operator=(const T& src) { - this->set(src); - return *this; - } - - template - ElementProxy& operator=(T* src) { - this->set(src); - return *this; - } - - private: - ResourceManager* getResourceManager() const { - return VariantAttorney::getResourceManager(upstream_); - } - - FORCE_INLINE VariantData* getData() const { - return VariantData::getElement( - VariantAttorney::getData(upstream_), index_, - VariantAttorney::getResourceManager(upstream_)); - } - - VariantData* getOrCreateData() const { - auto data = VariantAttorney::getOrCreateData(upstream_); - if (!data) - return nullptr; - return data->getOrAddElement( - index_, VariantAttorney::getResourceManager(upstream_)); - } - - TUpstream upstream_; - size_t index_; -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp deleted file mode 100755 index 292336308..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArray.hpp +++ /dev/null @@ -1,196 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE - -class JsonObject; - -// A reference to an array in a JsonDocument -// https://arduinojson.org/v7/api/jsonarray/ -class JsonArray : public detail::VariantOperators { - friend class detail::VariantAttorney; - - public: - typedef JsonArrayIterator iterator; - - // Constructs an unbound reference. - JsonArray() : data_(0), resources_(0) {} - - // INTERNAL USE ONLY - JsonArray(detail::ArrayData* data, detail::ResourceManager* resources) - : data_(data), resources_(resources) {} - - // Returns a JsonVariant pointing to the array. - // https://arduinojson.org/v7/api/jsonvariant/ - operator JsonVariant() { - void* data = data_; // prevent warning cast-align - return JsonVariant(reinterpret_cast(data), - resources_); - } - - // Returns a read-only reference to the array. - // https://arduinojson.org/v7/api/jsonarrayconst/ - operator JsonArrayConst() const { - return JsonArrayConst(data_, resources_); - } - - // Appends a new (empty) element to the array. - // Returns a reference to the new element. - // https://arduinojson.org/v7/api/jsonarray/add/ - template - typename detail::enable_if::value, T>::type - add() const { - return add().to(); - } - - // Appends a new (null) element to the array. - // Returns a reference to the new element. - // https://arduinojson.org/v7/api/jsonarray/add/ - template - typename detail::enable_if::value, T>::type - add() const { - return JsonVariant(detail::ArrayData::addElement(data_, resources_), - resources_); - } - - // Appends a value to the array. - // https://arduinojson.org/v7/api/jsonarray/add/ - template - bool add(const T& value) const { - return add().set(value); - } - - // Appends a value to the array. - // https://arduinojson.org/v7/api/jsonarray/add/ - template - bool add(T* value) const { - return add().set(value); - } - - // Returns an iterator to the first element of the array. - // https://arduinojson.org/v7/api/jsonarray/begin/ - iterator begin() const { - if (!data_) - return iterator(); - return iterator(data_->createIterator(resources_), resources_); - } - - // Returns an iterator following the last element of the array. - // https://arduinojson.org/v7/api/jsonarray/end/ - iterator end() const { - return iterator(); - } - - // Copies an array. - // https://arduinojson.org/v7/api/jsonarray/set/ - bool set(JsonArrayConst src) const { - if (!data_) - return false; - - clear(); - for (auto element : src) { - if (!add(element)) - return false; - } - - return true; - } - - // Removes the element at the specified iterator. - // https://arduinojson.org/v7/api/jsonarray/remove/ - void remove(iterator it) const { - detail::ArrayData::remove(data_, it.iterator_, resources_); - } - - // Removes the element at the specified index. - // https://arduinojson.org/v7/api/jsonarray/remove/ - void remove(size_t index) const { - detail::ArrayData::removeElement(data_, index, resources_); - } - - // Removes all the elements of the array. - // https://arduinojson.org/v7/api/jsonarray/clear/ - void clear() const { - detail::ArrayData::clear(data_, resources_); - } - - // Gets or sets the element at the specified index. - // https://arduinojson.org/v7/api/jsonarray/subscript/ - detail::ElementProxy operator[](size_t index) const { - return {*this, index}; - } - - operator JsonVariantConst() const { - return JsonVariantConst(collectionToVariant(data_), resources_); - } - - // Returns true if the reference is unbound. - // https://arduinojson.org/v7/api/jsonarray/isnull/ - bool isNull() const { - return data_ == 0; - } - - // Returns true if the reference is bound. - // https://arduinojson.org/v7/api/jsonarray/isnull/ - operator bool() const { - return data_ != 0; - } - - // Returns the depth (nesting level) of the array. - // https://arduinojson.org/v7/api/jsonarray/nesting/ - size_t nesting() const { - return detail::VariantData::nesting(collectionToVariant(data_), resources_); - } - - // Returns the number of elements in the array. - // https://arduinojson.org/v7/api/jsonarray/size/ - size_t size() const { - return data_ ? data_->size(resources_) : 0; - } - - // DEPRECATED: use add() instead - ARDUINOJSON_DEPRECATED("use add() instead") - JsonVariant add() const { - return add(); - } - - // DEPRECATED: use add() instead - ARDUINOJSON_DEPRECATED("use add() instead") - JsonArray createNestedArray() const { - return add(); - } - - // DEPRECATED: use add() instead - ARDUINOJSON_DEPRECATED("use add() instead") - JsonObject createNestedObject() const; - - // DEPRECATED: always returns zero - ARDUINOJSON_DEPRECATED("always returns zero") - size_t memoryUsage() const { - return 0; - } - - private: - detail::ResourceManager* getResourceManager() const { - return resources_; - } - - detail::VariantData* getData() const { - return collectionToVariant(data_); - } - - detail::VariantData* getOrCreateData() const { - return collectionToVariant(data_); - } - - detail::ArrayData* data_; - detail::ResourceManager* resources_; -}; - -ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp deleted file mode 100755 index 6c0d7db2f..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayConst.hpp +++ /dev/null @@ -1,119 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include -#include - -ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE - -class JsonObject; - -// A read-only reference to an array in a JsonDocument -// https://arduinojson.org/v7/api/jsonarrayconst/ -class JsonArrayConst : public detail::VariantOperators { - friend class JsonArray; - friend class detail::VariantAttorney; - - public: - typedef JsonArrayConstIterator iterator; - - // Returns an iterator to the first element of the array. - // https://arduinojson.org/v7/api/jsonarrayconst/begin/ - iterator begin() const { - if (!data_) - return iterator(); - return iterator(data_->createIterator(resources_), resources_); - } - - // Returns an iterator to the element following the last element of the array. - // https://arduinojson.org/v7/api/jsonarrayconst/end/ - iterator end() const { - return iterator(); - } - - // Creates an unbound reference. - JsonArrayConst() : data_(0) {} - - // INTERNAL USE ONLY - JsonArrayConst(const detail::ArrayData* data, - const detail::ResourceManager* resources) - : data_(data), resources_(resources) {} - - // Returns the element at the specified index. - // https://arduinojson.org/v7/api/jsonarrayconst/subscript/ - JsonVariantConst operator[](size_t index) const { - return JsonVariantConst( - detail::ArrayData::getElement(data_, index, resources_), resources_); - } - - operator JsonVariantConst() const { - return JsonVariantConst(getData(), resources_); - } - - // Returns true if the reference is unbound. - // https://arduinojson.org/v7/api/jsonarrayconst/isnull/ - bool isNull() const { - return data_ == 0; - } - - // Returns true if the reference is bound. - // https://arduinojson.org/v7/api/jsonarrayconst/isnull/ - operator bool() const { - return data_ != 0; - } - - // Returns the depth (nesting level) of the array. - // https://arduinojson.org/v7/api/jsonarrayconst/nesting/ - size_t nesting() const { - return detail::VariantData::nesting(getData(), resources_); - } - - // Returns the number of elements in the array. - // https://arduinojson.org/v7/api/jsonarrayconst/size/ - size_t size() const { - return data_ ? data_->size(resources_) : 0; - } - - // DEPRECATED: always returns zero - ARDUINOJSON_DEPRECATED("always returns zero") - size_t memoryUsage() const { - return 0; - } - - private: - const detail::VariantData* getData() const { - return collectionToVariant(data_); - } - - const detail::ArrayData* data_; - const detail::ResourceManager* resources_; -}; - -// Compares the content of two arrays. -// Returns true if the two arrays are equal. -inline bool operator==(JsonArrayConst lhs, JsonArrayConst rhs) { - if (!lhs && !rhs) - return true; - if (!lhs || !rhs) - return false; - - auto a = lhs.begin(); - auto b = rhs.begin(); - - for (;;) { - if (a == b) // same pointer or both null - return true; - if (a == lhs.end() || b == rhs.end()) - return false; - if (*a != *b) - return false; - ++a; - ++b; - } -} - -ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp deleted file mode 100755 index 70bb28f4a..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayIterator.hpp +++ /dev/null @@ -1,96 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE - -template -class Ptr { - public: - Ptr(T value) : value_(value) {} - - T* operator->() { - return &value_; - } - - T& operator*() { - return value_; - } - - private: - T value_; -}; - -class JsonArrayIterator { - friend class JsonArray; - - public: - JsonArrayIterator() {} - explicit JsonArrayIterator(detail::ArrayData::iterator iterator, - detail::ResourceManager* resources) - : iterator_(iterator), resources_(resources) {} - - JsonVariant operator*() { - return JsonVariant(iterator_.data(), resources_); - } - Ptr operator->() { - return operator*(); - } - - bool operator==(const JsonArrayIterator& other) const { - return iterator_ == other.iterator_; - } - - bool operator!=(const JsonArrayIterator& other) const { - return iterator_ != other.iterator_; - } - - JsonArrayIterator& operator++() { - iterator_.next(resources_); - return *this; - } - - private: - detail::ArrayData::iterator iterator_; - detail::ResourceManager* resources_; -}; - -class JsonArrayConstIterator { - friend class JsonArray; - - public: - JsonArrayConstIterator() {} - explicit JsonArrayConstIterator(detail::ArrayData::iterator iterator, - const detail::ResourceManager* resources) - : iterator_(iterator), resources_(resources) {} - - JsonVariantConst operator*() const { - return JsonVariantConst(iterator_.data(), resources_); - } - Ptr operator->() { - return operator*(); - } - - bool operator==(const JsonArrayConstIterator& other) const { - return iterator_ == other.iterator_; - } - - bool operator!=(const JsonArrayConstIterator& other) const { - return iterator_ != other.iterator_; - } - - JsonArrayConstIterator& operator++() { - iterator_.next(resources_); - return *this; - } - - private: - detail::ArrayData::iterator iterator_; - const detail::ResourceManager* resources_; -}; - -ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp deleted file mode 100755 index ff589cea8..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Array/Utilities.hpp +++ /dev/null @@ -1,114 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE - -// Copies a value to a JsonVariant. -// This is a degenerated form of copyArray() to stop the recursion. -template -inline typename detail::enable_if::value, bool>::type -copyArray(const T& src, JsonVariant dst) { - return dst.set(src); -} - -// Copies values from an array to a JsonArray or a JsonVariant. -// https://arduinojson.org/v7/api/misc/copyarray/ -template -inline typename detail::enable_if< - !detail::is_base_of::value, bool>::type -copyArray(T (&src)[N], const TDestination& dst) { - return copyArray(src, N, dst); -} - -// Copies values from an array to a JsonArray or a JsonVariant. -// https://arduinojson.org/v7/api/misc/copyarray/ -template -inline typename detail::enable_if< - !detail::is_base_of::value, bool>::type -copyArray(const T* src, size_t len, const TDestination& dst) { - bool ok = true; - for (size_t i = 0; i < len; i++) { - ok &= copyArray(src[i], dst.template add()); - } - return ok; -} - -// Copies a string to a JsonVariant. -// This is a degenerated form of copyArray() to handle strings. -template -inline bool copyArray(const char* src, size_t, const TDestination& dst) { - return dst.set(src); -} - -// Copies values from an array to a JsonDocument. -// https://arduinojson.org/v7/api/misc/copyarray/ -template -inline bool copyArray(const T& src, JsonDocument& dst) { - return copyArray(src, dst.to()); -} - -// Copies an array to a JsonDocument. -// https://arduinojson.org/v7/api/misc/copyarray/ -template -inline bool copyArray(const T* src, size_t len, JsonDocument& dst) { - return copyArray(src, len, dst.to()); -} - -// Copies a value from a JsonVariant. -// This is a degenerated form of copyArray() to stop the recursion. -template -inline typename detail::enable_if::value, size_t>::type -copyArray(JsonVariantConst src, T& dst) { - dst = src.as(); - return 1; -} - -// Copies values from a JsonArray or JsonVariant to an array. -// https://arduinojson.org/v7/api/misc/copyarray/ -template -inline size_t copyArray(JsonArrayConst src, T (&dst)[N]) { - return copyArray(src, dst, N); -} - -// Copies values from a JsonArray or JsonVariant to an array. -// https://arduinojson.org/v7/api/misc/copyarray/ -template -inline size_t copyArray(JsonArrayConst src, T* dst, size_t len) { - size_t i = 0; - for (JsonArrayConst::iterator it = src.begin(); it != src.end() && i < len; - ++it) - copyArray(*it, dst[i++]); - return i; -} - -// Copies a string from a JsonVariant. -// This is a degenerated form of copyArray() to handle strings. -template -inline size_t copyArray(JsonVariantConst src, char (&dst)[N]) { - JsonString s = src; - size_t len = N - 1; - if (len > s.size()) - len = s.size(); - memcpy(dst, s.c_str(), len); - dst[len] = 0; - return 1; -} - -// Copies values from a JsonDocument to an array. -// https://arduinojson.org/v7/api/misc/copyarray/ -template -inline typename detail::enable_if< - detail::is_array::value && - detail::is_base_of::value, - size_t>::type -copyArray(const TSource& src, T& dst) { - return copyArray(src.template as(), dst); -} - -ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp deleted file mode 100755 index 07fe7e043..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionData.hpp +++ /dev/null @@ -1,133 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -#include // size_t - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -class VariantData; -class VariantSlot; - -class CollectionIterator { - friend class CollectionData; - - public: - CollectionIterator() : slot_(nullptr), currentId_(NULL_SLOT) {} - - void next(const ResourceManager* resources); - - bool done() const { - return slot_ == nullptr; - } - - bool operator==(const CollectionIterator& other) const { - return slot_ == other.slot_; - } - - bool operator!=(const CollectionIterator& other) const { - return slot_ != other.slot_; - } - - VariantData* operator->() { - ARDUINOJSON_ASSERT(slot_ != nullptr); - return data(); - } - - VariantData& operator*() { - ARDUINOJSON_ASSERT(slot_ != nullptr); - return *data(); - } - - const VariantData& operator*() const { - ARDUINOJSON_ASSERT(slot_ != nullptr); - return *data(); - } - - const char* key() const; - bool ownsKey() const; - - void setKey(StringNode*); - void setKey(const char*); - - VariantData* data() { - return reinterpret_cast(slot_); - } - - const VariantData* data() const { - return reinterpret_cast(slot_); - } - - private: - CollectionIterator(VariantSlot* slot, SlotId slotId); - - VariantSlot* slot_; - SlotId currentId_, nextId_; -}; - -class CollectionData { - SlotId head_ = NULL_SLOT; - SlotId tail_ = NULL_SLOT; - - public: - // Placement new - static void* operator new(size_t, void* p) noexcept { - return p; - } - - static void operator delete(void*, void*) noexcept {} - - using iterator = CollectionIterator; - - iterator createIterator(const ResourceManager* resources) const { - return iterator(resources->getSlot(head_), head_); - } - - size_t size(const ResourceManager*) const; - size_t nesting(const ResourceManager*) const; - - void clear(ResourceManager* resources); - - static void clear(CollectionData* collection, ResourceManager* resources) { - if (!collection) - return; - collection->clear(resources); - } - - void remove(iterator it, ResourceManager* resources); - - static void remove(CollectionData* collection, iterator it, - ResourceManager* resources) { - if (collection) - return collection->remove(it, resources); - } - - SlotId head() const { - return head_; - } - - protected: - iterator addSlot(ResourceManager*); - - private: - SlotWithId getPreviousSlot(VariantSlot*, const ResourceManager*) const; - void releaseSlot(SlotWithId, ResourceManager*); -}; - -inline const VariantData* collectionToVariant( - const CollectionData* collection) { - const void* data = collection; // prevent warning cast-align - return reinterpret_cast(data); -} - -inline VariantData* collectionToVariant(CollectionData* collection) { - void* data = collection; // prevent warning cast-align - return reinterpret_cast(data); -} - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp deleted file mode 100755 index 79d9ac72b..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp +++ /dev/null @@ -1,133 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include -#include -#include -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -inline CollectionIterator::CollectionIterator(VariantSlot* slot, SlotId slotId) - : slot_(slot), currentId_(slotId) { - nextId_ = slot_ ? slot_->next() : NULL_SLOT; -} - -inline const char* CollectionIterator::key() const { - ARDUINOJSON_ASSERT(slot_ != nullptr); - return slot_->key(); -} - -inline void CollectionIterator::setKey(const char* s) { - ARDUINOJSON_ASSERT(slot_ != nullptr); - ARDUINOJSON_ASSERT(s != nullptr); - return slot_->setKey(s); -} - -inline void CollectionIterator::setKey(StringNode* s) { - ARDUINOJSON_ASSERT(slot_ != nullptr); - ARDUINOJSON_ASSERT(s != nullptr); - return slot_->setKey(s); -} - -inline bool CollectionIterator::ownsKey() const { - ARDUINOJSON_ASSERT(slot_ != nullptr); - return slot_->ownsKey(); -} - -inline void CollectionIterator::next(const ResourceManager* resources) { - ARDUINOJSON_ASSERT(currentId_ != NULL_SLOT); - slot_ = resources->getSlot(nextId_); - currentId_ = nextId_; - if (slot_) - nextId_ = slot_->next(); -} - -inline CollectionData::iterator CollectionData::addSlot( - ResourceManager* resources) { - auto slot = resources->allocSlot(); - if (!slot) - return {}; - if (tail_ != NULL_SLOT) { - auto tail = resources->getSlot(tail_); - tail->setNext(slot.id()); - tail_ = slot.id(); - } else { - head_ = slot.id(); - tail_ = slot.id(); - } - return iterator(slot, slot.id()); -} - -inline void CollectionData::clear(ResourceManager* resources) { - auto next = head_; - while (next != NULL_SLOT) { - auto currId = next; - auto slot = resources->getSlot(next); - next = slot->next(); - releaseSlot(SlotWithId(slot, currId), resources); - } - - head_ = NULL_SLOT; - tail_ = NULL_SLOT; -} - -inline SlotWithId CollectionData::getPreviousSlot( - VariantSlot* target, const ResourceManager* resources) const { - auto prev = SlotWithId(); - auto currentId = head_; - while (currentId != NULL_SLOT) { - auto currentSlot = resources->getSlot(currentId); - if (currentSlot == target) - return prev; - prev = SlotWithId(currentSlot, currentId); - currentId = currentSlot->next(); - } - return SlotWithId(); -} - -inline void CollectionData::remove(iterator it, ResourceManager* resources) { - if (it.done()) - return; - auto curr = it.slot_; - auto prev = getPreviousSlot(curr, resources); - auto next = curr->next(); - if (prev) - prev->setNext(next); - else - head_ = next; - if (next == NULL_SLOT) - tail_ = prev.id(); - releaseSlot({it.slot_, it.currentId_}, resources); -} - -inline size_t CollectionData::nesting(const ResourceManager* resources) const { - size_t maxChildNesting = 0; - for (auto it = createIterator(resources); !it.done(); it.next(resources)) { - size_t childNesting = it->nesting(resources); - if (childNesting > maxChildNesting) - maxChildNesting = childNesting; - } - return maxChildNesting + 1; -} - -inline size_t CollectionData::size(const ResourceManager* resources) const { - size_t count = 0; - for (auto it = createIterator(resources); !it.done(); it.next(resources)) - count++; - return count; -} - -inline void CollectionData::releaseSlot(SlotWithId slot, - ResourceManager* resources) { - if (slot->ownsKey()) - resources->dereferenceString(slot->key()); - slot->data()->setNull(resources); - resources->freeSlot(slot); -} - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp b/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp deleted file mode 100755 index 12d60688a..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp +++ /dev/null @@ -1,253 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -// Support std::istream and std::ostream -#ifndef ARDUINOJSON_ENABLE_STD_STREAM -# ifdef __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 -# else -# ifdef ARDUINO -# define ARDUINOJSON_ENABLE_STD_STREAM 0 -# else -# define ARDUINOJSON_ENABLE_STD_STREAM 1 -# endif -# endif -#endif - -// Support std::string -#ifndef ARDUINOJSON_ENABLE_STD_STRING -# ifdef __has_include -# if __has_include() && !defined(min) && !defined(max) -# define ARDUINOJSON_ENABLE_STD_STRING 1 -# else -# define ARDUINOJSON_ENABLE_STD_STRING 0 -# endif -# else -# ifdef ARDUINO -# define ARDUINOJSON_ENABLE_STD_STRING 0 -# else -# define ARDUINOJSON_ENABLE_STD_STRING 1 -# endif -# endif -#endif - -// Support for std::string_view -#ifndef ARDUINOJSON_ENABLE_STRING_VIEW -# ifdef __has_include -# if __has_include() && __cplusplus >= 201703L -# define ARDUINOJSON_ENABLE_STRING_VIEW 1 -# else -# define ARDUINOJSON_ENABLE_STRING_VIEW 0 -# endif -# else -# define ARDUINOJSON_ENABLE_STRING_VIEW 0 -# endif -#endif - -// Store floating-point values with float (0) or double (1) -#ifndef ARDUINOJSON_USE_DOUBLE -# define ARDUINOJSON_USE_DOUBLE 1 -#endif - -// Pointer size: a heuristic to set sensible defaults -#ifndef ARDUINOJSON_SIZEOF_POINTER -# if defined(__SIZEOF_POINTER__) -# define ARDUINOJSON_SIZEOF_POINTER __SIZEOF_POINTER__ -# elif defined(_WIN64) && _WIN64 -# define ARDUINOJSON_SIZEOF_POINTER 8 // 64 bits -# else -# define ARDUINOJSON_SIZEOF_POINTER 4 // assume 32 bits otherwise -# endif -#endif - -// Store integral values with long (0) or long long (1) -#ifndef ARDUINOJSON_USE_LONG_LONG -# if ARDUINOJSON_SIZEOF_POINTER >= 4 // 32 & 64 bits systems -# define ARDUINOJSON_USE_LONG_LONG 1 -# else -# define ARDUINOJSON_USE_LONG_LONG 0 -# endif -#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 bytes to store the variant identifier -#ifndef ARDUINOJSON_SLOT_ID_SIZE -# if ARDUINOJSON_SIZEOF_POINTER <= 2 -# define ARDUINOJSON_SLOT_ID_SIZE 1 // up to 255 slots -# elif ARDUINOJSON_SIZEOF_POINTER == 4 -# define ARDUINOJSON_SLOT_ID_SIZE 2 // up to 65535 slots -# else -# define ARDUINOJSON_SLOT_ID_SIZE 4 // up to 4294967295 slots -# endif -#endif - -// Capacity of each variant pool (in slots) -#ifndef ARDUINOJSON_POOL_CAPACITY -# if ARDUINOJSON_SIZEOF_POINTER <= 2 -# define ARDUINOJSON_POOL_CAPACITY 16 // 128 bytes -# elif ARDUINOJSON_SIZEOF_POINTER == 4 -# define ARDUINOJSON_POOL_CAPACITY 64 // 1024 bytes -# else -# define ARDUINOJSON_POOL_CAPACITY 128 // 3072 bytes -# endif -#endif - -// Initial capacity of the pool list -#ifndef ARDUINOJSON_INITIAL_POOL_COUNT -# define ARDUINOJSON_INITIAL_POOL_COUNT 4 -#endif - -// Automatically call shrinkToFit() from deserializeXxx() -// Disabled by default on 8-bit platforms because it's not worth the increase in -// code size -#ifndef ARDUINOJSON_AUTO_SHRINK -# if ARDUINOJSON_SIZEOF_POINTER <= 2 -# define ARDUINOJSON_AUTO_SHRINK 0 -# else -# define ARDUINOJSON_AUTO_SHRINK 1 -# endif -#endif - -// Number of bytes to store the length of a string -#ifndef ARDUINOJSON_STRING_LENGTH_SIZE -# if ARDUINOJSON_SIZEOF_POINTER <= 2 -# define ARDUINOJSON_STRING_LENGTH_SIZE 1 // up to 255 characters -# else -# define ARDUINOJSON_STRING_LENGTH_SIZE 2 // up to 65535 characters -# endif -#endif - -#ifdef ARDUINO - -// 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 - -// Enable support for PROGMEM -# ifndef ARDUINOJSON_ENABLE_PROGMEM -# define ARDUINOJSON_ENABLE_PROGMEM 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 - -// Enable PROGMEM support on AVR only -# ifndef ARDUINOJSON_ENABLE_PROGMEM -# ifdef __AVR__ -# define ARDUINOJSON_ENABLE_PROGMEM 1 -# else -# define ARDUINOJSON_ENABLE_PROGMEM 0 -# endif -# endif - -#endif // ARDUINO - -// 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_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 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 100755 index fd32a55e9..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp +++ /dev/null @@ -1,106 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include -#include - -#if ARDUINOJSON_ENABLE_STD_STREAM -# include -#endif - -ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE - -class DeserializationError { - 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_; - } - - // Returns true if there is an error - explicit operator bool() const { - return code_ != Ok; - } - - // 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_PROGMEM_ARRAY(char, s0, "Ok"); - ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s1, "EmptyInput"); - ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s2, "IncompleteInput"); - ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s3, "InvalidInput"); - ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s4, "NoMemory"); - ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s5, "TooDeep"); - ARDUINOJSON_DEFINE_PROGMEM_ARRAY(const char*, messages, - {s0, s1, s2, s3, s4, s5}); - return reinterpret_cast( - detail::pgm_read(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 - -ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp deleted file mode 100755 index 4c73934fc..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -template -struct DeserializationOptions { - TFilter filter; - DeserializationOption::NestingLimit nestingLimit; -}; - -template -inline DeserializationOptions makeDeserializationOptions( - TFilter filter, DeserializationOption::NestingLimit nestingLimit = {}) { - return {filter, nestingLimit}; -} - -template -inline DeserializationOptions makeDeserializationOptions( - DeserializationOption::NestingLimit nestingLimit, TFilter filter) { - return {filter, nestingLimit}; -} - -inline DeserializationOptions makeDeserializationOptions( - DeserializationOption::NestingLimit nestingLimit = {}) { - return {{}, nestingLimit}; -} - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp deleted file mode 100755 index 76705560b..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Filter.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE - -namespace DeserializationOption { -class Filter { - public: -#if ARDUINOJSON_AUTO_SHRINK - explicit Filter(JsonDocument& doc) : variant_(doc) { - doc.shrinkToFit(); - } -#endif - - explicit Filter(JsonVariantConst variant) : variant_(variant) {} - - 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; - JsonVariantConst member = variant_[key]; - return Filter(member.isNull() ? variant_["*"] : member); - } - - private: - JsonVariantConst variant_; -}; -} // namespace DeserializationOption - -namespace detail { -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 detail - -ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp deleted file mode 100755 index d30402b4b..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE - -namespace DeserializationOption { -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 DeserializationOption - -ARDUINOJSON_END_PUBLIC_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp deleted file mode 100755 index c4b5edb74..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -#include // for size_t - -ARDUINOJSON_BEGIN_PRIVATE_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() { - // clang-format off - return source_->read(); // Error here? See https://arduinojson.org/v7/invalid-input/ - // clang-format on - } - - 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 -}; - -ARDUINOJSON_END_PRIVATE_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 - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -template -Reader::type> makeReader(TInput&& input) { - return Reader::type>{ - detail::forward(input)}; -} - -template -BoundedReader makeReader(TChar* input, size_t inputSize) { - return BoundedReader{input, inputSize}; -} - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp deleted file mode 100755 index 43c5a432b..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PRIVATE_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_; -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp deleted file mode 100755 index 4730be016..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -template -struct Reader::value>::type> - : BoundedReader { - explicit Reader(const ::String& s) - : BoundedReader(s.c_str(), s.length()) {} -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp deleted file mode 100755 index fa8ff23d7..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/FlashReader.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PRIVATE_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; - } -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp deleted file mode 100755 index 1ca46c852..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/IteratorReader.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -ARDUINOJSON_BEGIN_PRIVATE_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()) {} -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp deleted file mode 100755 index 8603bb138..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/RamReader.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PRIVATE_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) {} -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp deleted file mode 100755 index 25ba63645..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include - -ARDUINOJSON_BEGIN_PRIVATE_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_; -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp deleted file mode 100755 index ddb07b8b2..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -template -struct Reader::value>::type> - : Reader { - explicit Reader(const TVariant& x) - : Reader(x.template as()) {} -}; - -ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp deleted file mode 100755 index 21d187640..000000000 --- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/deserialize.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright © 2014-2024, Benoit BLANCHON -// MIT License - -#pragma once - -#include -#include -#include -#include - -ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE - -// A meta-function that returns the first type of the parameter pack -// or void if empty -template -struct first_or_void { - using type = void; -}; -template -struct first_or_void { - using type = T; -}; - -// A meta-function that returns true if T is a valid destination type for -// deserialize() -template -struct is_deserialize_destination : false_type {}; - -template -struct is_deserialize_destination< - T, typename enable_if())), - ResourceManager*>::value>::type> : true_type { -}; - -template -inline void shrinkJsonDocument(TDestination&) { - // no-op by default -} - -#if ARDUINOJSON_AUTO_SHRINK -inline void shrinkJsonDocument(JsonDocument& doc) { - doc.shrinkToFit(); -} -#endif - -template