├── .gitattributes ├── GEVCU-7c_Schematic.pdf ├── LICENSE ├── README.md ├── docs ├── ExampleDevice.cpp ├── ExampleDevice.h ├── GEVCU_PinCrossChart.pdf └── GEVCU_Pins.png ├── include └── README ├── lib ├── ArduinoJson │ ├── .clang-format │ ├── .devcontainer │ │ ├── Dockerfile │ │ ├── clang10 │ │ │ └── devcontainer.json │ │ ├── clang5 │ │ │ └── devcontainer.json │ │ ├── clang6 │ │ │ └── devcontainer.json │ │ ├── clang7 │ │ │ └── devcontainer.json │ │ ├── clang8 │ │ │ └── devcontainer.json │ │ ├── clang9 │ │ │ └── devcontainer.json │ │ ├── devcontainer.json │ │ ├── gcc10 │ │ │ └── devcontainer.json │ │ ├── gcc11 │ │ │ └── devcontainer.json │ │ ├── gcc5 │ │ │ └── devcontainer.json │ │ ├── gcc6 │ │ │ └── devcontainer.json │ │ ├── gcc7 │ │ │ └── devcontainer.json │ │ ├── gcc8 │ │ │ └── devcontainer.json │ │ └── gcc9 │ │ │ └── devcontainer.json │ ├── .gitattributes │ ├── .gitignore │ ├── .mbedignore │ ├── .prettierignore │ ├── .vscode │ │ └── settings.json │ ├── ArduinoJson.h │ ├── CHANGELOG.md │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── LICENSE.md │ ├── LICENSE.txt │ ├── README.md │ ├── SUPPORT.md │ ├── appveyor.yml │ ├── banner.svg │ ├── component.mk │ ├── examples │ │ ├── JsonConfigFile │ │ │ └── JsonConfigFile.ino │ │ ├── JsonFilterExample │ │ │ └── JsonFilterExample.ino │ │ ├── JsonGeneratorExample │ │ │ └── JsonGeneratorExample.ino │ │ ├── JsonHttpClient │ │ │ └── JsonHttpClient.ino │ │ ├── JsonParserExample │ │ │ └── JsonParserExample.ino │ │ ├── JsonServer │ │ │ └── JsonServer.ino │ │ ├── JsonUdpBeacon │ │ │ └── JsonUdpBeacon.ino │ │ ├── MsgPackParser │ │ │ └── MsgPackParser.ino │ │ ├── ProgmemExample │ │ │ └── ProgmemExample.ino │ │ └── StringExample │ │ │ └── StringExample.ino │ ├── extras │ │ ├── ArduinoJsonConfig.cmake.in │ │ ├── CompileOptions.cmake │ │ ├── ci │ │ │ ├── arduino.sh │ │ │ ├── espidf │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── main │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── component.mk │ │ │ │ │ └── main.cpp │ │ │ └── particle.sh │ │ ├── conf_test │ │ │ ├── avr.cpp │ │ │ ├── esp8266.cpp │ │ │ ├── x64.cpp │ │ │ └── x86.cpp │ │ ├── fuzzing │ │ │ ├── CMakeLists.txt │ │ │ ├── Makefile │ │ │ ├── json_corpus │ │ │ │ └── .gitignore │ │ │ ├── json_fuzzer.cpp │ │ │ ├── json_seed_corpus │ │ │ │ ├── Comments.json │ │ │ │ ├── EmptyArray.json │ │ │ │ ├── EmptyObject.json │ │ │ │ ├── ExcessiveNesting.json │ │ │ │ ├── IntegerOverflow.json │ │ │ │ ├── Numbers.json │ │ │ │ ├── OpenWeatherMap.json │ │ │ │ ├── Strings.json │ │ │ │ └── WeatherUnderground.json │ │ │ ├── msgpack_corpus │ │ │ │ └── .gitignore │ │ │ ├── msgpack_fuzzer.cpp │ │ │ ├── msgpack_seed_corpus │ │ │ │ ├── array16 │ │ │ │ ├── array32 │ │ │ │ ├── false │ │ │ │ ├── fixarray │ │ │ │ ├── fixint_negative │ │ │ │ ├── fixint_positive │ │ │ │ ├── fixmap │ │ │ │ ├── fixstr │ │ │ │ ├── float32 │ │ │ │ ├── float64 │ │ │ │ ├── int16 │ │ │ │ ├── int32 │ │ │ │ ├── int64 │ │ │ │ ├── int8 │ │ │ │ ├── map16 │ │ │ │ ├── map32 │ │ │ │ ├── nil │ │ │ │ ├── str16 │ │ │ │ ├── str32 │ │ │ │ ├── str8 │ │ │ │ ├── true │ │ │ │ ├── uint16 │ │ │ │ ├── uint32 │ │ │ │ ├── uint64 │ │ │ │ └── uint8 │ │ │ └── reproducer.cpp │ │ ├── particle │ │ │ ├── project.properties │ │ │ └── src │ │ │ │ └── smocktest.ino │ │ ├── scripts │ │ │ ├── build-arduino-package.sh │ │ │ ├── build-single-header.sh │ │ │ ├── get-release-body.sh │ │ │ ├── get-release-page.sh │ │ │ ├── publish-particle-library.sh │ │ │ ├── publish.sh │ │ │ └── wandbox │ │ │ │ ├── JsonGeneratorExample.cpp │ │ │ │ ├── JsonParserExample.cpp │ │ │ │ ├── MsgPackParserExample.cpp │ │ │ │ └── publish.sh │ │ └── tests │ │ │ ├── .clang-tidy │ │ │ ├── CMakeLists.txt │ │ │ ├── Cpp11 │ │ │ ├── CMakeLists.txt │ │ │ ├── issue1120.cpp │ │ │ ├── nullptr.cpp │ │ │ ├── use_long_long_0.cpp │ │ │ └── use_long_long_1.cpp │ │ │ ├── Cpp17 │ │ │ ├── CMakeLists.txt │ │ │ └── string_view.cpp │ │ │ ├── Cpp20 │ │ │ ├── CMakeLists.txt │ │ │ └── smoke_test.cpp │ │ │ ├── FailingBuilds │ │ │ ├── CMakeLists.txt │ │ │ ├── Issue1189.cpp │ │ │ ├── Issue978.cpp │ │ │ ├── assign_char.cpp │ │ │ ├── delete_jsondocument.cpp │ │ │ ├── read_long_long.cpp │ │ │ ├── variant_as_char.cpp │ │ │ └── write_long_long.cpp │ │ │ ├── Helpers │ │ │ ├── Arduino.h │ │ │ ├── CustomReader.hpp │ │ │ ├── api │ │ │ │ ├── Print.h │ │ │ │ ├── Stream.h │ │ │ │ └── String.h │ │ │ ├── avr │ │ │ │ └── pgmspace.h │ │ │ └── progmem_emulation.hpp │ │ │ ├── IntegrationTests │ │ │ ├── CMakeLists.txt │ │ │ ├── gbathree.cpp │ │ │ ├── issue772.cpp │ │ │ ├── openweathermap.cpp │ │ │ └── round_trip.cpp │ │ │ ├── JsonArray │ │ │ ├── CMakeLists.txt │ │ │ ├── add.cpp │ │ │ ├── clear.cpp │ │ │ ├── compare.cpp │ │ │ ├── copyArray.cpp │ │ │ ├── createNested.cpp │ │ │ ├── equals.cpp │ │ │ ├── get.cpp │ │ │ ├── isNull.cpp │ │ │ ├── iterator.cpp │ │ │ ├── memoryUsage.cpp │ │ │ ├── nesting.cpp │ │ │ ├── remove.cpp │ │ │ ├── size.cpp │ │ │ ├── std_string.cpp │ │ │ ├── subscript.cpp │ │ │ ├── unbound.cpp │ │ │ └── undefined.cpp │ │ │ ├── JsonDeserializer │ │ │ ├── CMakeLists.txt │ │ │ ├── DeserializationError.cpp │ │ │ ├── array.cpp │ │ │ ├── array_static.cpp │ │ │ ├── filter.cpp │ │ │ ├── incomplete_input.cpp │ │ │ ├── input_types.cpp │ │ │ ├── invalid_input.cpp │ │ │ ├── misc.cpp │ │ │ ├── nestingLimit.cpp │ │ │ ├── number.cpp │ │ │ ├── object.cpp │ │ │ ├── object_static.cpp │ │ │ └── string.cpp │ │ │ ├── JsonDocument │ │ │ ├── BasicJsonDocument.cpp │ │ │ ├── CMakeLists.txt │ │ │ ├── DynamicJsonDocument.cpp │ │ │ ├── ElementProxy.cpp │ │ │ ├── MemberProxy.cpp │ │ │ ├── StaticJsonDocument.cpp │ │ │ ├── add.cpp │ │ │ ├── cast.cpp │ │ │ ├── compare.cpp │ │ │ ├── containsKey.cpp │ │ │ ├── createNested.cpp │ │ │ ├── isNull.cpp │ │ │ ├── issue1120.cpp │ │ │ ├── nesting.cpp │ │ │ ├── overflowed.cpp │ │ │ ├── remove.cpp │ │ │ ├── shrinkToFit.cpp │ │ │ ├── size.cpp │ │ │ ├── subscript.cpp │ │ │ └── swap.cpp │ │ │ ├── JsonObject │ │ │ ├── CMakeLists.txt │ │ │ ├── clear.cpp │ │ │ ├── compare.cpp │ │ │ ├── containsKey.cpp │ │ │ ├── copy.cpp │ │ │ ├── createNestedArray.cpp │ │ │ ├── createNestedObject.cpp │ │ │ ├── equals.cpp │ │ │ ├── invalid.cpp │ │ │ ├── isNull.cpp │ │ │ ├── iterator.cpp │ │ │ ├── memoryUsage.cpp │ │ │ ├── nesting.cpp │ │ │ ├── remove.cpp │ │ │ ├── size.cpp │ │ │ ├── std_string.cpp │ │ │ └── subscript.cpp │ │ │ ├── JsonSerializer │ │ │ ├── CMakeLists.txt │ │ │ ├── CustomWriter.cpp │ │ │ ├── JsonArray.cpp │ │ │ ├── JsonArrayPretty.cpp │ │ │ ├── JsonObject.cpp │ │ │ ├── JsonObjectPretty.cpp │ │ │ ├── JsonVariant.cpp │ │ │ ├── misc.cpp │ │ │ ├── std_stream.cpp │ │ │ └── std_string.cpp │ │ │ ├── JsonVariant │ │ │ ├── CMakeLists.txt │ │ │ ├── add.cpp │ │ │ ├── as.cpp │ │ │ ├── clear.cpp │ │ │ ├── compare.cpp │ │ │ ├── containsKey.cpp │ │ │ ├── converters.cpp │ │ │ ├── copy.cpp │ │ │ ├── createNested.cpp │ │ │ ├── is.cpp │ │ │ ├── isnull.cpp │ │ │ ├── memoryUsage.cpp │ │ │ ├── misc.cpp │ │ │ ├── nesting.cpp │ │ │ ├── nullptr.cpp │ │ │ ├── or.cpp │ │ │ ├── overflow.cpp │ │ │ ├── remove.cpp │ │ │ ├── set.cpp │ │ │ ├── shallowCopy.cpp │ │ │ ├── size.cpp │ │ │ ├── stl_containers.cpp │ │ │ ├── subscript.cpp │ │ │ ├── types.cpp │ │ │ ├── unbound.cpp │ │ │ └── undefined.cpp │ │ │ ├── MemoryPool │ │ │ ├── CMakeLists.txt │ │ │ ├── StringCopier.cpp │ │ │ ├── allocVariant.cpp │ │ │ ├── clear.cpp │ │ │ ├── saveString.cpp │ │ │ └── size.cpp │ │ │ ├── Misc │ │ │ ├── CMakeLists.txt │ │ │ ├── FloatParts.cpp │ │ │ ├── JsonString.cpp │ │ │ ├── NoArduinoHeader.cpp │ │ │ ├── Readers.cpp │ │ │ ├── StringAdapters.cpp │ │ │ ├── StringWriter.cpp │ │ │ ├── TypeTraits.cpp │ │ │ ├── Utf16.cpp │ │ │ ├── Utf8.cpp │ │ │ ├── arithmeticCompare.cpp │ │ │ ├── conflicts.cpp │ │ │ ├── custom_string.hpp │ │ │ ├── deprecated.cpp │ │ │ ├── issue1967.cpp │ │ │ ├── printable.cpp │ │ │ ├── unsigned_char.cpp │ │ │ ├── version.cpp │ │ │ └── weird_strcmp.hpp │ │ │ ├── MixedConfiguration │ │ │ ├── CMakeLists.txt │ │ │ ├── decode_unicode_0.cpp │ │ │ ├── decode_unicode_1.cpp │ │ │ ├── enable_alignment_0.cpp │ │ │ ├── enable_alignment_1.cpp │ │ │ ├── enable_comments_0.cpp │ │ │ ├── enable_comments_1.cpp │ │ │ ├── enable_infinity_0.cpp │ │ │ ├── enable_infinity_1.cpp │ │ │ ├── enable_nan_0.cpp │ │ │ ├── enable_nan_1.cpp │ │ │ ├── enable_progmem_1.cpp │ │ │ ├── enable_string_deduplication_0.cpp │ │ │ ├── enable_string_deduplication_1.cpp │ │ │ ├── issue1707.cpp │ │ │ ├── use_double_0.cpp │ │ │ ├── use_double_1.cpp │ │ │ ├── use_long_long_0.cpp │ │ │ └── use_long_long_1.cpp │ │ │ ├── MsgPackDeserializer │ │ │ ├── CMakeLists.txt │ │ │ ├── deserializeArray.cpp │ │ │ ├── deserializeObject.cpp │ │ │ ├── deserializeStaticVariant.cpp │ │ │ ├── deserializeVariant.cpp │ │ │ ├── doubleToFloat.cpp │ │ │ ├── filter.cpp │ │ │ ├── incompleteInput.cpp │ │ │ ├── input_types.cpp │ │ │ ├── misc.cpp │ │ │ ├── nestingLimit.cpp │ │ │ └── notSupported.cpp │ │ │ ├── MsgPackSerializer │ │ │ ├── CMakeLists.txt │ │ │ ├── destination_types.cpp │ │ │ ├── measure.cpp │ │ │ ├── misc.cpp │ │ │ ├── serializeArray.cpp │ │ │ ├── serializeObject.cpp │ │ │ └── serializeVariant.cpp │ │ │ ├── Numbers │ │ │ ├── CMakeLists.txt │ │ │ ├── convertNumber.cpp │ │ │ ├── parseDouble.cpp │ │ │ ├── parseFloat.cpp │ │ │ ├── parseInteger.cpp │ │ │ └── parseNumber.cpp │ │ │ ├── TextFormatter │ │ │ ├── CMakeLists.txt │ │ │ ├── writeFloat.cpp │ │ │ ├── writeInteger.cpp │ │ │ └── writeString.cpp │ │ │ └── catch │ │ │ ├── .clang-format │ │ │ ├── CMakeLists.txt │ │ │ ├── catch.cpp │ │ │ └── catch.hpp │ ├── idf_component.yml │ ├── keywords.txt │ ├── library.json │ ├── library.properties │ └── src │ │ ├── ArduinoJson.h │ │ ├── ArduinoJson.hpp │ │ ├── ArduinoJson │ │ ├── Array │ │ │ ├── ArrayFunctions.hpp │ │ │ ├── ArrayImpl.hpp │ │ │ ├── ArrayIterator.hpp │ │ │ ├── ArrayRef.hpp │ │ │ ├── ArrayShortcuts.hpp │ │ │ ├── ElementProxy.hpp │ │ │ ├── JsonArray.hpp │ │ │ ├── JsonArrayConst.hpp │ │ │ ├── JsonArrayImpl.hpp │ │ │ ├── JsonArrayIterator.hpp │ │ │ └── Utilities.hpp │ │ ├── Collection │ │ │ ├── CollectionData.hpp │ │ │ └── CollectionImpl.hpp │ │ ├── Configuration.hpp │ │ ├── Deserialization │ │ │ ├── DeserializationError.hpp │ │ │ ├── DeserializationOptions.hpp │ │ │ ├── Filter.hpp │ │ │ ├── NestingLimit.hpp │ │ │ ├── Reader.hpp │ │ │ ├── Readers │ │ │ │ ├── ArduinoStreamReader.hpp │ │ │ │ ├── ArduinoStringReader.hpp │ │ │ │ ├── FlashReader.hpp │ │ │ │ ├── IteratorReader.hpp │ │ │ │ ├── RamReader.hpp │ │ │ │ ├── StdStreamReader.hpp │ │ │ │ └── VariantReader.hpp │ │ │ └── deserialize.hpp │ │ ├── Document │ │ │ ├── BasicJsonDocument.hpp │ │ │ ├── DynamicJsonDocument.hpp │ │ │ ├── JsonDocument.hpp │ │ │ └── StaticJsonDocument.hpp │ │ ├── Json │ │ │ ├── EscapeSequence.hpp │ │ │ ├── JsonDeserializer.hpp │ │ │ ├── JsonSerializer.hpp │ │ │ ├── Latch.hpp │ │ │ ├── PrettyJsonSerializer.hpp │ │ │ ├── TextFormatter.hpp │ │ │ ├── Utf16.hpp │ │ │ └── Utf8.hpp │ │ ├── Memory │ │ │ ├── Alignment.hpp │ │ │ └── MemoryPool.hpp │ │ ├── Misc │ │ │ ├── SerializedValue.hpp │ │ │ └── Visitable.hpp │ │ ├── MsgPack │ │ │ ├── MsgPackDeserializer.hpp │ │ │ ├── MsgPackSerializer.hpp │ │ │ ├── endianess.hpp │ │ │ └── ieee754.hpp │ │ ├── Namespace.hpp │ │ ├── Numbers │ │ │ ├── Float.hpp │ │ │ ├── FloatParts.hpp │ │ │ ├── FloatTraits.hpp │ │ │ ├── Integer.hpp │ │ │ ├── JsonFloat.hpp │ │ │ ├── JsonInteger.hpp │ │ │ ├── arithmeticCompare.hpp │ │ │ ├── convertNumber.hpp │ │ │ └── parseNumber.hpp │ │ ├── Object │ │ │ ├── JsonObject.hpp │ │ │ ├── JsonObjectConst.hpp │ │ │ ├── JsonObjectImpl.hpp │ │ │ ├── JsonObjectIterator.hpp │ │ │ ├── JsonPair.hpp │ │ │ ├── MemberProxy.hpp │ │ │ ├── ObjectFunctions.hpp │ │ │ ├── ObjectImpl.hpp │ │ │ ├── ObjectIterator.hpp │ │ │ ├── ObjectRef.hpp │ │ │ ├── ObjectShortcuts.hpp │ │ │ └── Pair.hpp │ │ ├── Polyfills │ │ │ ├── alias_cast.hpp │ │ │ ├── assert.hpp │ │ │ ├── attributes.hpp │ │ │ ├── ctype.hpp │ │ │ ├── integer.hpp │ │ │ ├── limits.hpp │ │ │ ├── math.hpp │ │ │ ├── mpl │ │ │ │ └── max.hpp │ │ │ ├── pgmspace.hpp │ │ │ ├── pgmspace_generic.hpp │ │ │ ├── preprocessor.hpp │ │ │ ├── safe_strcmp.hpp │ │ │ ├── static_array.hpp │ │ │ ├── type_traits.hpp │ │ │ ├── type_traits │ │ │ │ ├── conditional.hpp │ │ │ │ ├── declval.hpp │ │ │ │ ├── enable_if.hpp │ │ │ │ ├── integral_constant.hpp │ │ │ │ ├── is_array.hpp │ │ │ │ ├── is_base_of.hpp │ │ │ │ ├── is_class.hpp │ │ │ │ ├── is_const.hpp │ │ │ │ ├── is_convertible.hpp │ │ │ │ ├── is_enum.hpp │ │ │ │ ├── is_floating_point.hpp │ │ │ │ ├── is_integral.hpp │ │ │ │ ├── is_pointer.hpp │ │ │ │ ├── is_same.hpp │ │ │ │ ├── is_signed.hpp │ │ │ │ ├── is_unsigned.hpp │ │ │ │ ├── make_unsigned.hpp │ │ │ │ ├── make_void.hpp │ │ │ │ ├── remove_const.hpp │ │ │ │ ├── remove_cv.hpp │ │ │ │ ├── remove_reference.hpp │ │ │ │ └── type_identity.hpp │ │ │ └── utility.hpp │ │ ├── Serialization │ │ │ ├── CountingDecorator.hpp │ │ │ ├── Writer.hpp │ │ │ ├── Writers │ │ │ │ ├── ArduinoStringWriter.hpp │ │ │ │ ├── DummyWriter.hpp │ │ │ │ ├── PrintWriter.hpp │ │ │ │ ├── StaticStringWriter.hpp │ │ │ │ ├── StdStreamWriter.hpp │ │ │ │ └── StdStringWriter.hpp │ │ │ ├── measure.hpp │ │ │ └── serialize.hpp │ │ ├── StringStorage │ │ │ ├── StringCopier.hpp │ │ │ ├── StringMover.hpp │ │ │ └── StringStorage.hpp │ │ ├── Strings │ │ │ ├── Adapters │ │ │ │ ├── FlashString.hpp │ │ │ │ ├── JsonString.hpp │ │ │ │ ├── RamString.hpp │ │ │ │ └── StringObject.hpp │ │ │ ├── ArduinoStringAdapter.hpp │ │ │ ├── ConstRamStringAdapter.hpp │ │ │ ├── FlashStringAdapter.hpp │ │ │ ├── IsString.hpp │ │ │ ├── IsWriteableString.hpp │ │ │ ├── JsonString.hpp │ │ │ ├── RamStringAdapter.hpp │ │ │ ├── SizedFlashStringAdapter.hpp │ │ │ ├── SizedRamStringAdapter.hpp │ │ │ ├── StdStringAdapter.hpp │ │ │ ├── StoragePolicy.hpp │ │ │ ├── String.hpp │ │ │ ├── StringAdapter.hpp │ │ │ ├── StringAdapters.hpp │ │ │ ├── StringTraits.hpp │ │ │ └── StringViewAdapter.hpp │ │ ├── Variant │ │ │ ├── Converter.hpp │ │ │ ├── ConverterImpl.hpp │ │ │ ├── JsonVariant.hpp │ │ │ ├── JsonVariantConst.hpp │ │ │ ├── SlotFunctions.hpp │ │ │ ├── VariantAttorney.hpp │ │ │ ├── VariantCompare.hpp │ │ │ ├── VariantContent.hpp │ │ │ ├── VariantData.hpp │ │ │ ├── VariantFunctions.hpp │ │ │ ├── VariantImpl.hpp │ │ │ ├── VariantOperators.hpp │ │ │ ├── VariantRef.hpp │ │ │ ├── VariantRefBase.hpp │ │ │ ├── VariantShortcuts.hpp │ │ │ ├── VariantSlot.hpp │ │ │ ├── VariantTag.hpp │ │ │ ├── VariantTo.hpp │ │ │ └── Visitor.hpp │ │ ├── compatibility.hpp │ │ └── version.hpp │ │ └── CMakeLists.txt ├── FlexCAN_T4 │ ├── .vscode │ │ └── settings.json │ ├── FlexCAN_T4.h │ ├── FlexCAN_T4.tpp │ ├── FlexCAN_T4Beta1BoardArchive.zip │ ├── FlexCAN_T4FD.tpp │ ├── FlexCAN_T4FDTimings.tpp │ ├── LICENSE │ ├── README.md │ ├── circular_buffer.h │ ├── examples │ │ ├── BiDirectionalForward │ │ │ └── BiDirectionalForward.ino │ │ ├── CAN2.0_example_FIFO_with_interrupts.ino │ │ ├── CAN2.0_example_FIFO_with_interrupts │ │ │ └── CAN2.0_example_FIFO_with_interrupts.ino │ │ ├── T32CAN_LINSLAVE_WAKE_ON_CAN │ │ │ └── T32CAN_LINSLAVE_WAKE_ON_CAN.ino │ │ ├── beta_sample │ │ │ └── beta_sample.ino │ │ ├── isotp_example_send_receive │ │ │ └── isotp_example_send_receive.ino │ │ ├── isotp_server_example │ │ │ └── isotp_server_example.ino │ │ ├── isotp_server_multiple_buffers_to_individual_busses_example │ │ │ └── isotp_server_multiple_buffers_to_individual_busses_example.ino │ │ ├── mailbox_filtering_example_with_interrupts │ │ │ └── mailbox_filtering_example_with_interrupts.ino │ │ └── read_two_channels │ │ │ └── read_two_channels.ino │ ├── imxrt_flexcan.h │ ├── isotp.h │ ├── isotp.tpp │ ├── isotp_server.h │ ├── isotp_server.tpp │ ├── keywords.txt │ └── kinetis_flexcan.h ├── README ├── TeensyTimerTool │ ├── LICENSE │ ├── README.md │ ├── assets │ │ └── FTM0_8CH.jpg │ ├── examples │ │ ├── 01_Basic │ │ │ ├── ArrayOfTimers │ │ │ │ ├── ArrayOfTimers.ino │ │ │ │ └── README.md │ │ │ ├── HelloOneShot │ │ │ │ └── HelloOneShot.ino │ │ │ ├── HelloPeriodic │ │ │ │ └── HelloPeriodic.ino │ │ │ ├── MoreTimers │ │ │ │ └── MoreTimers.ino │ │ │ ├── RTC │ │ │ │ └── RTC.ino │ │ │ ├── RTC_TCK_Timer │ │ │ │ └── RTC_TCK_Timer.ino │ │ │ ├── UsingChronoDurations1 │ │ │ │ └── UsingChronoDurations1.ino │ │ │ └── UsingChronoDurations2 │ │ │ │ └── UsingChronoDurations2.ino │ │ ├── 02_Advanced │ │ │ ├── CallbackWithParams │ │ │ │ └── CallbackWithParams.ino │ │ │ ├── CapturingLambdas │ │ │ │ └── CapturingLambdas.ino │ │ │ └── UsingLambdas │ │ │ │ └── UsingLambdas.ino │ │ ├── 03_Applications │ │ │ └── DoubleExposure │ │ │ │ ├── DoubleExposure.ino │ │ │ │ ├── LaserController.h │ │ │ │ ├── PulseGenerator.h │ │ │ │ ├── README.md │ │ │ │ └── SystemController.h │ │ └── 99_Misc │ │ │ └── PinInformation │ │ │ ├── GPIO_Info.h │ │ │ ├── PWM_TimerInfo.c │ │ │ ├── PWM_TimerInfo.h │ │ │ ├── PinInfo.h │ │ │ ├── PinInformation.ino │ │ │ └── boards.txt │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── API │ │ │ ├── Timer.cpp │ │ │ ├── baseTimer.cpp │ │ │ ├── baseTimer.h │ │ │ ├── oneShotTimer.h │ │ │ ├── periodicTimer.h │ │ │ └── timer.h │ │ ├── ErrorHandling │ │ │ ├── error_codes.h │ │ │ ├── error_handler.cpp │ │ │ └── error_handler.h │ │ ├── ITimerChannel.h │ │ ├── TeensyTimerTool.h │ │ ├── TimerModules │ │ │ ├── FTM │ │ │ │ ├── FTM.h │ │ │ │ ├── FTM_Channel.h │ │ │ │ ├── FTM_ChannelInfo.h │ │ │ │ └── FTM_Info.h │ │ │ ├── GPT │ │ │ │ ├── GPT.h │ │ │ │ ├── GPTChannel.cpp │ │ │ │ ├── GPTChannel.h │ │ │ │ └── GPTmap.h │ │ │ ├── PIT4 │ │ │ │ ├── PIT.cpp │ │ │ │ ├── PIT.h │ │ │ │ └── PITChannel.h │ │ │ ├── RTC │ │ │ │ ├── RTC.cpp │ │ │ │ ├── RTC.h │ │ │ │ └── RtcChannel.h │ │ │ ├── TCK │ │ │ │ ├── TCK.cpp │ │ │ │ ├── TCK.h │ │ │ │ ├── TckChannel.h │ │ │ │ ├── TckChannelBase.cpp │ │ │ │ ├── TckChannelBase.h │ │ │ │ ├── tickCounters.cpp │ │ │ │ └── tickCounters.h │ │ │ └── TMR │ │ │ │ ├── TMR.h │ │ │ │ └── TMRChannel.h │ │ ├── boardDef.h │ │ ├── config.cpp │ │ ├── config.h │ │ ├── defaultConfig.h │ │ ├── frequency.h.deactivated │ │ ├── helpers.h │ │ ├── inplace_function.h │ │ └── types.h │ └── test │ │ ├── onBoard_tests_TBD │ │ └── cfgRunUnitTests.ini │ │ ├── runCompileTests.py │ │ └── runUnitTests.py └── WDT_T4 │ ├── LICENSE │ ├── README.md │ ├── Watchdog_t4.h │ ├── Watchdog_t4.tpp │ └── examples │ ├── ewm_demo │ └── ewm_demo.ino │ ├── watchdog1_demo │ └── watchdog1_demo.ino │ ├── watchdog2_demo │ └── watchdog2_demo.ino │ └── watchdog3_demo │ └── watchdog3_demo.ino ├── platformio.ini ├── src ├── CanHandler.cpp ├── CanHandler.h ├── CrashHandler.cpp ├── CrashHandler.h ├── DeviceManager.cpp ├── DeviceManager.h ├── FaultHandler.cpp ├── FaultHandler.h ├── FlashTxx.cpp ├── FlashTxx.h ├── FlasherX.cpp ├── FlasherX.h ├── GEVCU.h ├── GEVCU7.cpp ├── Heartbeat.cpp ├── Heartbeat.h ├── Logger.cpp ├── Logger.h ├── MemCache.cpp ├── MemCache.h ├── PID_v1.cpp ├── PID_v1.h ├── PrefHandler.cpp ├── PrefHandler.h ├── SerialConsole.cpp ├── SerialConsole.h ├── Sys_Messages.h ├── TickHandler.cpp ├── TickHandler.h ├── config.h ├── constants.cpp ├── constants.h ├── devices │ ├── Device.cpp │ ├── Device.h │ ├── DeviceTypes.h │ ├── bms │ │ ├── BatteryManager.cpp │ │ ├── BatteryManager.h │ │ ├── OrionBatteryManager.cpp │ │ ├── OrionBatteryManager.h │ │ ├── SimpleBatteryManager.cpp │ │ ├── SimpleBatteryManager.h │ │ ├── ThinkBatteryManager.cpp │ │ └── ThinkBatteryManager.h │ ├── charger │ │ ├── ChargeController.cpp │ │ ├── ChargeController.h │ │ ├── TCCHCharger.cpp │ │ └── TCCHCharger.h │ ├── dcdc │ │ ├── DCDCController.cpp │ │ ├── DCDCController.h │ │ ├── DelphiDCDC.cpp │ │ ├── DelphiDCDC.h │ │ ├── OvarDCDC.cpp │ │ ├── OvarDCDC.h │ │ ├── TeslaSDCDC.cpp │ │ └── TeslaSDCDC.h │ ├── display │ │ ├── AxiomaticWOC.cpp │ │ ├── AxiomaticWOC.h │ │ ├── BLE_Characteristics.txt │ │ ├── EVIC.cpp │ │ ├── EVIC.h │ │ ├── StatusCSV.cpp │ │ ├── StatusCSV.h │ │ ├── UDSController.cpp │ │ └── UDSController.h │ ├── esp32 │ │ ├── ESP32Driver.cpp │ │ ├── ESP32Driver.h │ │ ├── SerialFileSender.cpp │ │ ├── SerialFileSender.h │ │ ├── esp_loader.cpp │ │ ├── esp_loader.h │ │ ├── esp_targets.cpp │ │ ├── esp_targets.h │ │ ├── gevcu_port.cpp │ │ ├── gevcu_port.h │ │ ├── md5_hash.cpp │ │ ├── md5_hash.h │ │ ├── serial_comm.cpp │ │ ├── serial_comm.h │ │ ├── serial_comm_prv.h │ │ └── serial_io.h │ ├── hvac │ │ ├── HVACDevice.cpp │ │ ├── HVACDevice.h │ │ ├── TeslaAC_Gen2.cpp │ │ └── TeslaAC_Gen2.h │ ├── io │ │ ├── CANIODevice.cpp │ │ ├── CANIODevice.h │ │ ├── CanBrake.cpp │ │ ├── CanBrake.h │ │ ├── CanThrottle.cpp │ │ ├── CanThrottle.h │ │ ├── ExtIODevice.cpp │ │ ├── ExtIODevice.h │ │ ├── FourAnalogM2.cpp │ │ ├── FourAnalogM2.h │ │ ├── PotBrake.cpp │ │ ├── PotBrake.h │ │ ├── PotGearSelector.cpp │ │ ├── PotGearSelector.h │ │ ├── PotThrottle.cpp │ │ ├── PotThrottle.h │ │ ├── PowerKeypad.cpp │ │ ├── Powerkeypad.h │ │ ├── TestThrottle.cpp │ │ ├── TestThrottle.h │ │ ├── Throttle.cpp │ │ ├── Throttle.h │ │ ├── ThrottleDetector.cpp │ │ └── ThrottleDetector.h │ ├── misc │ │ ├── HeatCoolController.cpp │ │ ├── HeatCoolController.h │ │ ├── LightController.cpp │ │ ├── LightController.h │ │ ├── Precharger.cpp │ │ ├── Precharger.h │ │ ├── SystemDevice.cpp │ │ ├── SystemDevice.h │ │ ├── VehicleSpecific.cpp │ │ └── VehicleSpecific.h │ └── motorctrl │ │ ├── BrusaMotorController.cpp │ │ ├── BrusaMotorController.h │ │ ├── C300MotorController.cpp │ │ ├── C300MotorController.h │ │ ├── CKMotorController.cpp │ │ ├── CKMotorController.h │ │ ├── CodaMotorController.cpp │ │ ├── CodaMotorController.h │ │ ├── DMOC.txt │ │ ├── DmocMotorController.cpp │ │ ├── DmocMotorController.h │ │ ├── LeafMotorController.cpp │ │ ├── LeafMotorController.h │ │ ├── MotorController.cpp │ │ ├── MotorController.h │ │ ├── RMSMotorController.cpp │ │ ├── RMSMotorController.h │ │ ├── TestMotorController.cpp │ │ ├── TestMotorController.h │ │ └── gearsandopstates.txt ├── eeprom_layout.h ├── i2c_device.h ├── i2c_driver.h ├── i2c_driver_wire.cpp ├── i2c_driver_wire.h ├── i2c_register_slave.cpp ├── i2c_register_slave.h ├── imx_rt1060.h ├── imx_rt1060_i2c_driver.cpp ├── imx_rt1060_i2c_driver.h ├── localconfig.h ├── sys_io.cpp └── sys_io.h └── test └── README /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files we want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.c text 7 | *.h text 8 | *.cpp text 9 | *.ino text 10 | *.txt text 11 | *.brd text 12 | *.sch text 13 | 14 | # Declare files that will always have CRLF line endings on checkout. 15 | *.sln text eol=crlf 16 | *.vcxproj eol=crlf 17 | 18 | # Denote all files that are truly binary and should not be modified. 19 | *.png binary 20 | *.jpg binary -------------------------------------------------------------------------------- /GEVCU-7c_Schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/GEVCU-7c_Schematic.pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Collin Kidder, Michael Neuweiler, Charles Galpin, Jack Rickard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/GEVCU_PinCrossChart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/docs/GEVCU_PinCrossChart.pdf -------------------------------------------------------------------------------- /docs/GEVCU_Pins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/docs/GEVCU_Pins.png -------------------------------------------------------------------------------- /lib/ArduinoJson/.clang-format: -------------------------------------------------------------------------------- 1 | # http://clang.llvm.org/docs/ClangFormatStyleOptions.html 2 | 3 | BasedOnStyle: Google 4 | Standard: c++11 5 | AllowShortFunctionsOnASingleLine: Empty 6 | IncludeBlocks: Preserve 7 | IndentPPDirectives: AfterHash 8 | DerivePointerAlignment: false 9 | 10 | # Always break after if to get accurate coverage 11 | AllowShortIfStatementsOnASingleLine: false 12 | AllowShortLoopsOnASingleLine: false 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/clang10/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Clang 10", 3 | "image": "conanio/clang10", 4 | "runArgs": [ 5 | "--name=ArduinoJson-clang10" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/clang5/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Clang 5", 3 | "image": "conanio/clang50", 4 | "runArgs": [ 5 | "--name=ArduinoJson-clang5" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/clang6/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Clang 6", 3 | "image": "conanio/clang60", 4 | "runArgs": [ 5 | "--name=ArduinoJson-clang6" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/clang7/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Clang 7", 3 | "image": "conanio/clang7", 4 | "runArgs": [ 5 | "--name=ArduinoJson-clang7" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/clang8/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Clang 8", 3 | "image": "conanio/clang8", 4 | "runArgs": [ 5 | "--name=ArduinoJson-clang8" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/clang9/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Clang 9", 3 | "image": "conanio/clang9", 4 | "runArgs": [ 5 | "--name=ArduinoJson-clang9" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/ubuntu 3 | { 4 | "name": "Ubuntu", 5 | "build": { 6 | "dockerfile": "Dockerfile" 7 | }, 8 | 9 | // Set *default* container specific settings.json values on container create. 10 | "settings": {}, 11 | 12 | // Add the IDs of extensions you want installed when the container is created. 13 | "extensions": [ 14 | "ms-vscode.cmake-tools", 15 | "ms-vscode.cpptools" 16 | ], 17 | 18 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 19 | // "forwardPorts": [], 20 | 21 | // Use 'postCreateCommand' to run commands after the container is created. 22 | // "postCreateCommand": "uname -a", 23 | } 24 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/gcc10/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GCC 10", 3 | "image": "conanio/gcc10", 4 | "runArgs": [ 5 | "--name=ArduinoJson-gcc10" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/gcc11/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GCC 11", 3 | "image": "conanio/gcc11", 4 | "runArgs": [ 5 | "--name=ArduinoJson-gcc11" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/gcc5/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GCC 5", 3 | "image": "conanio/gcc5", 4 | "runArgs": [ 5 | "--name=ArduinoJson-gcc5" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/gcc6/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GCC 6", 3 | "image": "conanio/gcc6", 4 | "runArgs": [ 5 | "--name=ArduinoJson-gcc6" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/gcc7/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GCC 7", 3 | "image": "conanio/gcc7", 4 | "runArgs": [ 5 | "--name=ArduinoJson-gcc7" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/gcc8/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GCC 8", 3 | "image": "conanio/gcc8", 4 | "runArgs": [ 5 | "--name=ArduinoJson-gcc8" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.devcontainer/gcc9/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GCC 9", 3 | "image": "conanio/gcc9", 4 | "runArgs": [ 5 | "--name=ArduinoJson-gcc9" 6 | ], 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-vscode.cmake-tools" 11 | ], 12 | "settings": { 13 | "cmake.generator": "Unix Makefiles", 14 | "cmake.buildDirectory": "/tmp/build" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.sh text eol=lf 3 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.idea 3 | /build 4 | /bin 5 | /lib 6 | /sftp-config.json 7 | .tags 8 | .tags_sorted_by_file 9 | /extras/fuzzing/*_fuzzer 10 | /extras/fuzzing/*_fuzzer.options 11 | /extras/fuzzing/*_fuzzer_seed_corpus.zip 12 | .vs/ 13 | /out/ 14 | 15 | # Used by CI for Particle 16 | /src/*.ino 17 | /project.properties 18 | 19 | # Used by IDF 20 | /dist/ 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.mbedignore: -------------------------------------------------------------------------------- 1 | .devcontainer/ 2 | .github/ 3 | examples/ 4 | extras/ 5 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.prettierignore: -------------------------------------------------------------------------------- 1 | *.md 2 | -------------------------------------------------------------------------------- /lib/ArduinoJson/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", 3 | "git.inputValidationLength": 80, 4 | "git.inputValidationSubjectLength": 72, 5 | "files.insertFinalNewline": true, 6 | "files.trimFinalNewlines": true, 7 | "search.exclude": { 8 | "/extras/tests/catch/*": true 9 | }, 10 | "C_Cpp.default.includePath": [ 11 | "/src" 12 | ], 13 | "[cmake]": { 14 | "editor.detectIndentation": false, 15 | "editor.insertSpaces": false, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include "src/ArduinoJson.h" 6 | -------------------------------------------------------------------------------- /lib/ArduinoJson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | cmake_minimum_required(VERSION 3.15) 6 | 7 | if(ESP_PLATFORM) 8 | # Build ArduinoJson as an ESP-IDF component 9 | idf_component_register(INCLUDE_DIRS src) 10 | return() 11 | endif() 12 | 13 | project(ArduinoJson VERSION 6.21.4) 14 | 15 | if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) 16 | include(CTest) 17 | endif() 18 | 19 | add_subdirectory(src) 20 | 21 | if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) 22 | include(extras/CompileOptions.cmake) 23 | add_subdirectory(extras/tests) 24 | add_subdirectory(extras/fuzzing) 25 | endif() 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution to ArduinoJson 2 | 3 | First, thank you for taking the time to contribute to this project. 4 | 5 | You can submit changes via GitHub Pull Requests. 6 | 7 | Please: 8 | 9 | 1. Update the test suite for any change of behavior 10 | 2. Use clang-format in "file" mode to format the code 11 | -------------------------------------------------------------------------------- /lib/ArduinoJson/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | --------------------- 3 | 4 | Copyright © 2014-2021 Benoit BLANCHON 5 | 6 | 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: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | 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. 11 | -------------------------------------------------------------------------------- /lib/ArduinoJson/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | --------------------- 3 | 4 | Copyright © 2014-2023, Benoit BLANCHON 5 | 6 | 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: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | 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. 11 | -------------------------------------------------------------------------------- /lib/ArduinoJson/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # ArduinoJson Support 2 | 3 | First off, thank you very much for using ArduinoJson. 4 | 5 | We'll be very happy to help you, but first please read the following. 6 | 7 | ## Before asking for help 8 | 9 | 1. Read the [FAQ](https://arduinojson.org/faq/?utm_source=github&utm_medium=support) 10 | 2. Search in the [API Reference](https://arduinojson.org/api/?utm_source=github&utm_medium=support) 11 | 12 | If you did not find the answer, please create a [new issue on GitHub](https://github.com/bblanchon/ArduinoJson/issues/new). 13 | 14 | It is OK to add a comment to a currently opened issue, but please avoid adding comments to a closed issue. 15 | 16 | ## Before hitting the Submit button 17 | 18 | Please provide all the relevant information: 19 | 20 | * Good title 21 | * Short description of the problem 22 | * Target platform 23 | * Compiler model and version 24 | * [MVCE](https://stackoverflow.com/help/mcve) 25 | * Compiler output 26 | 27 | Good questions get fast answers! 28 | -------------------------------------------------------------------------------- /lib/ArduinoJson/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := src 2 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/ArduinoJsonConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 4 | check_required_components("@PROJECT_NAME@") 5 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/ci/arduino.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 4 | sleep 3 5 | export DISPLAY=:1.0 6 | 7 | mkdir -p /tmp/arduino 8 | curl -sS http://downloads.arduino.cc/arduino-$VERSION-linux64.tar.xz | tar xJ -C /tmp/arduino --strip 1 || 9 | curl -sS http://downloads.arduino.cc/arduino-$VERSION-linux64.tgz | tar xz -C /tmp/arduino --strip 1 10 | export PATH=$PATH:/tmp/arduino/ 11 | 12 | if [[ "$BOARD" =~ "arduino:samd:" ]]; then 13 | arduino --install-boards arduino:samd 14 | fi 15 | 16 | ln -s $PWD /tmp/arduino/libraries/ArduinoJson 17 | 18 | for EXAMPLE in $PWD/examples/*/*.ino; do 19 | arduino --verify --board $BOARD $EXAMPLE 20 | done 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/ci/espidf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | cmake_minimum_required(VERSION 3.5) 6 | 7 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 8 | project(example) 9 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/ci/espidf/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | idf_component_register( 6 | SRCS "main.cpp" 7 | INCLUDE_DIRS "" 8 | ) 9 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/ci/espidf/main/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # "main" pseudo-component makefile. 3 | # 4 | # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) 5 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/ci/espidf/main/main.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | 7 | extern "C" void app_main() { 8 | char buffer[256]; 9 | StaticJsonDocument<200> doc; 10 | 11 | doc["hello"] = "world"; 12 | serializeJson(doc, buffer); 13 | deserializeJson(doc, buffer); 14 | serializeMsgPack(doc, buffer); 15 | deserializeMsgPack(doc, buffer); 16 | } 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/ci/particle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | BOARD=$1 4 | 5 | cd "$(dirname "$0")/../../" 6 | 7 | cp extras/particle/src/smocktest.ino src/ 8 | cp extras/particle/project.properties ./ 9 | 10 | particle compile "$BOARD" 11 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/conf_test/avr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static_assert(ARDUINOJSON_ENABLE_PROGMEM == 1, "ARDUINOJSON_ENABLE_PROGMEM"); 4 | 5 | static_assert(ARDUINOJSON_USE_LONG_LONG == 0, "ARDUINOJSON_USE_LONG_LONG"); 6 | 7 | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 1, 8 | "ARDUINOJSON_SLOT_OFFSET_SIZE"); 9 | 10 | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); 11 | 12 | static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); 13 | 14 | static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 8, 15 | "sizeof(VariantSlot)"); 16 | 17 | void setup() {} 18 | void loop() {} 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/conf_test/esp8266.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static_assert(ARDUINOJSON_USE_LONG_LONG == 1, "ARDUINOJSON_USE_LONG_LONG"); 4 | 5 | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 2, 6 | "ARDUINOJSON_SLOT_OFFSET_SIZE"); 7 | 8 | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); 9 | 10 | static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); 11 | 12 | static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 16, 13 | "sizeof(VariantSlot)"); 14 | 15 | void setup() {} 16 | void loop() {} 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/conf_test/x64.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static_assert(ARDUINOJSON_USE_LONG_LONG == 1, "ARDUINOJSON_USE_LONG_LONG"); 4 | 5 | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 4, 6 | "ARDUINOJSON_SLOT_OFFSET_SIZE"); 7 | 8 | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); 9 | 10 | static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); 11 | 12 | static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 32, 13 | "sizeof(VariantSlot)"); 14 | 15 | int main() {} 16 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/conf_test/x86.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static_assert(ARDUINOJSON_USE_LONG_LONG == 1, "ARDUINOJSON_USE_LONG_LONG"); 4 | 5 | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 2, 6 | "ARDUINOJSON_SLOT_OFFSET_SIZE"); 7 | 8 | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); 9 | 10 | static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); 11 | 12 | static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 16, 13 | "sizeof(VariantSlot)"); 14 | 15 | int main() {} 16 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/Makefile: -------------------------------------------------------------------------------- 1 | # CAUTION: this file is invoked by https://github.com/google/oss-fuzz 2 | 3 | CXXFLAGS += -I../../src -DARDUINOJSON_DEBUG=1 -std=c++11 4 | 5 | all: \ 6 | $(OUT)/json_fuzzer \ 7 | $(OUT)/json_fuzzer_seed_corpus.zip \ 8 | $(OUT)/json_fuzzer.options \ 9 | $(OUT)/msgpack_fuzzer \ 10 | $(OUT)/msgpack_fuzzer_seed_corpus.zip \ 11 | $(OUT)/msgpack_fuzzer.options 12 | 13 | $(OUT)/%_fuzzer: %_fuzzer.cpp $(shell find ../../src -type f) 14 | $(CXX) $(CXXFLAGS) $< -o$@ $(LIB_FUZZING_ENGINE) 15 | 16 | $(OUT)/%_fuzzer_seed_corpus.zip: %_seed_corpus/* 17 | zip -j $@ $? 18 | 19 | $(OUT)/%_fuzzer.options: 20 | @echo "[libfuzzer]" > $@ 21 | @echo "max_len = 256" >> $@ 22 | @echo "timeout = 10" >> $@ 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_corpus/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_fuzzer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 4 | DynamicJsonDocument doc(4096); 5 | DeserializationError error = deserializeJson(doc, data, size); 6 | if (!error) { 7 | std::string json; 8 | serializeJson(doc, json); 9 | } 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/Comments.json: -------------------------------------------------------------------------------- 1 | //comment 2 | /*comment*/ 3 | [ //comment 4 | /*comment*/"comment"/*comment*/,//comment 5 | /*comment*/{//comment 6 | /* comment*/"key"//comment 7 | : //comment 8 | "value"//comment 9 | }/*comment*/ 10 | ]//comment -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/EmptyArray.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/EmptyObject.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/ExcessiveNesting.json: -------------------------------------------------------------------------------- 1 | [1,[2,[3,[4,[5,[6,[7,[8,[9,[10,[11,[12,[13,[14,[15,[16,[17,[18,[19,[20,[21,[22,[23,[24,[25,[26,[27,[28,[29,[30,[31,[32,[33,[34,[35,[36,[37,[38,[39,[40,[41,[42,[43,[44,[45,[46,[47,[48,[49,[50,[51,[52,[53,[54,[55,[56,[57,[58,[59,[60,[61,[62,[63,[64,[65,[66,[67,[68,[69,[70,[71,[72,[73,[74,[75,[76,[77,[78,[79,[80,[81,[82,[83,[84,[85,[86,[87,[88,[89,[90,[91,[92,[93,[94,[95,[96,[97,[98,[99,[100,[101,[102,[103,[104,[105,[106,[107,[108,[109,[110,[111,[112,[113,[114,[115,[116,[117,[118,[119,[120]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/IntegerOverflow.json: -------------------------------------------------------------------------------- 1 | 9720730739393920739 2 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/Numbers.json: -------------------------------------------------------------------------------- 1 | [ 2 | 123, 3 | -123, 4 | 123.456, 5 | -123.456, 6 | 12e34, 7 | 12e-34, 8 | 12e+34, 9 | 12E34, 10 | 12E-34, 11 | 12E+34, 12 | 12.34e56, 13 | 12.34e-56, 14 | 12.34e+56, 15 | 12.34E56, 16 | 12.34E-56, 17 | 12.34E+56, 18 | NaN, 19 | -NaN, 20 | +NaN, 21 | Infinity, 22 | +Infinity, 23 | -Infinity 24 | ] -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/OpenWeatherMap.json: -------------------------------------------------------------------------------- 1 | { 2 | "coord": { 3 | "lon": -0.13, 4 | "lat": 51.51 5 | }, 6 | "weather": [ 7 | { 8 | "id": 301, 9 | "main": "Drizzle", 10 | "description": "drizzle", 11 | "icon": "09n" 12 | }, 13 | { 14 | "id": 701, 15 | "main": "Mist", 16 | "description": "mist", 17 | "icon": "50n" 18 | }, 19 | { 20 | "id": 741, 21 | "main": "Fog", 22 | "description": "fog", 23 | "icon": "50n" 24 | } 25 | ], 26 | "base": "stations", 27 | "main": { 28 | "temp": 281.87, 29 | "pressure": 1032, 30 | "humidity": 100, 31 | "temp_min": 281.15, 32 | "temp_max": 283.15 33 | }, 34 | "visibility": 2900, 35 | "wind": { 36 | "speed": 1.5 37 | }, 38 | "clouds": { 39 | "all": 90 40 | }, 41 | "dt": 1483820400, 42 | "sys": { 43 | "type": 1, 44 | "id": 5091, 45 | "message": 0.0226, 46 | "country": "GB", 47 | "sunrise": 1483776245, 48 | "sunset": 1483805443 49 | }, 50 | "id": 2643743, 51 | "name": "London", 52 | "cod": 200 53 | } 54 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/json_seed_corpus/Strings.json: -------------------------------------------------------------------------------- 1 | [ 2 | "hello", 3 | 'hello', 4 | hello, 5 | {"hello":"world"}, 6 | {'hello':'world'}, 7 | {hello:world} 8 | ] -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_corpus/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_fuzzer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 4 | DynamicJsonDocument doc(4096); 5 | DeserializationError error = deserializeMsgPack(doc, data, size); 6 | if (!error) { 7 | std::string json; 8 | serializeMsgPack(doc, json); 9 | } 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/array16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/array16 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/array32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/array32 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/false: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixarray -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixint_negative: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixint_positive: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixmap -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixstr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/fixstr -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/float32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/float32 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/float64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/float64 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int16 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int32 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int64 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/int8 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/map16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/map16 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/map32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/map32 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/nil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/nil -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/str16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/str16 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/str32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/str32 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/str8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/str8 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/true: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint16 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint32 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint64 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/collin80/GEVCU7/45495cae82c180dfca45300a0a8b82187c82bb63/lib/ArduinoJson/extras/fuzzing/msgpack_seed_corpus/uint8 -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/particle/project.properties: -------------------------------------------------------------------------------- 1 | name=ArduinoJsonCI 2 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/particle/src/smocktest.ino: -------------------------------------------------------------------------------- 1 | #include "ArduinoJson.h" 2 | 3 | void setup() {} 4 | 5 | void loop() {} 6 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/scripts/build-arduino-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | INPUT=$1 6 | OUTPUT=$2 7 | 8 | cd "$INPUT" 9 | 10 | # remove existing file 11 | rm -f "$OUTPUT" 12 | 13 | # create zip 14 | 7z a "$OUTPUT" \ 15 | -xr!.vs \ 16 | CHANGELOG.md \ 17 | examples \ 18 | src \ 19 | keywords.txt \ 20 | library.properties \ 21 | LICENSE.txt \ 22 | README.md \ 23 | ArduinoJson.h 24 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/scripts/get-release-body.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | TAG="$1" 6 | CHANGELOG="$2" 7 | 8 | cat << END 9 | ## Changes 10 | 11 | $(awk '/\* /{ FOUND=1 } /^[[:space:]]*$/ { if(FOUND) exit } { if(FOUND) print }' "$CHANGELOG") 12 | 13 | [View version history](https://github.com/bblanchon/ArduinoJson/blob/$TAG/CHANGELOG.md) 14 | END 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/scripts/get-release-page.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | VERSION="$1" 6 | CHANGELOG="$2" 7 | ARDUINOJSON_H="$3" 8 | 9 | cat << END 10 | --- 11 | branch: v6 12 | version: $VERSION 13 | date: '$(date +'%Y-%m-%d')' 14 | $(extras/scripts/wandbox/publish.sh "$ARDUINOJSON_H") 15 | --- 16 | 17 | $(awk '/\* /{ FOUND=1; print; next } { if (FOUND) exit}' "$CHANGELOG") 18 | END 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/scripts/publish-particle-library.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | SOURCE_DIR="$(dirname "$0")/../.." 6 | WORK_DIR=$(mktemp -d) 7 | trap 'rm -rf "$WORK_DIR"' EXIT 8 | 9 | cp "$SOURCE_DIR/README.md" "$WORK_DIR/README.md" 10 | cp "$SOURCE_DIR/CHANGELOG.md" "$WORK_DIR/CHANGELOG.md" 11 | cp "$SOURCE_DIR/library.properties" "$WORK_DIR/library.properties" 12 | cp "$SOURCE_DIR/LICENSE.txt" "$WORK_DIR/LICENSE.txt" 13 | cp -r "$SOURCE_DIR/src" "$WORK_DIR/" 14 | cp -r "$SOURCE_DIR/examples" "$WORK_DIR/" 15 | 16 | cd "$WORK_DIR" 17 | particle library upload -v 18 | particle library publish -v 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/scripts/wandbox/publish.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | ARDUINOJSON_H="$1" 6 | 7 | read_string() { 8 | jq --slurp --raw-input '.' "$1" 9 | } 10 | 11 | compile() { 12 | FILE_PATH="$(dirname $0)/$1.cpp" 13 | cat >parameters.json < 2 | 3 | #include 4 | 5 | #if !ARDUINOJSON_HAS_NULLPTR 6 | # error ARDUINOJSON_HAS_NULLPTR must be set to 1 7 | #endif 8 | 9 | TEST_CASE("nullptr") { 10 | DynamicJsonDocument doc(4096); 11 | JsonVariant variant = doc.to(); 12 | 13 | SECTION("JsonVariant == nullptr") { 14 | REQUIRE((variant == nullptr)); 15 | REQUIRE_FALSE((variant != nullptr)); 16 | } 17 | 18 | SECTION("JsonVariant != nullptr") { 19 | variant.set(42); 20 | 21 | REQUIRE_FALSE((variant == nullptr)); 22 | REQUIRE((variant != nullptr)); 23 | } 24 | 25 | SECTION("JsonVariant.set(nullptr)") { 26 | variant.set(42); 27 | variant.set(nullptr); 28 | 29 | REQUIRE(variant.isNull()); 30 | } 31 | 32 | SECTION("JsonVariant.is()") { 33 | variant.set(42); 34 | REQUIRE(variant.is() == false); 35 | 36 | variant.clear(); 37 | REQUIRE(variant.is() == true); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Cpp11/use_long_long_0.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_USE_LONG_LONG 0 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 0") { 7 | DynamicJsonDocument doc(4096); 8 | 9 | doc["A"] = 42; 10 | doc["B"] = 84; 11 | 12 | std::string json; 13 | serializeJson(doc, json); 14 | 15 | REQUIRE(json == "{\"A\":42,\"B\":84}"); 16 | } 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Cpp11/use_long_long_1.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_USE_LONG_LONG 1 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 1") { 7 | DynamicJsonDocument doc(4096); 8 | JsonObject root = doc.to(); 9 | 10 | root["A"] = 123456789123456789; 11 | root["B"] = 987654321987654321; 12 | 13 | std::string json; 14 | serializeJson(doc, json); 15 | 16 | REQUIRE(json == "{\"A\":123456789123456789,\"B\":987654321987654321}"); 17 | } 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Cpp17/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | if(MSVC_VERSION LESS 1910) 6 | return() 7 | endif() 8 | 9 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) 10 | return() 11 | endif() 12 | 13 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7) 14 | return() 15 | endif() 16 | 17 | set(CMAKE_CXX_STANDARD 17) 18 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 19 | 20 | add_executable(Cpp17Tests 21 | string_view.cpp 22 | ) 23 | 24 | add_test(Cpp17 Cpp17Tests) 25 | 26 | set_tests_properties(Cpp17 27 | PROPERTIES 28 | LABELS "Catch" 29 | ) 30 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Cpp20/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | if(MSVC_VERSION LESS 1910) 6 | return() 7 | endif() 8 | 9 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10) 10 | return() 11 | endif() 12 | 13 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10) 14 | return() 15 | endif() 16 | 17 | set(CMAKE_CXX_STANDARD 20) 18 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 19 | 20 | add_executable(Cpp20Tests 21 | smoke_test.cpp 22 | ) 23 | 24 | add_test(Cpp20 Cpp20Tests) 25 | 26 | set_tests_properties(Cpp20 27 | PROPERTIES 28 | LABELS "Catch" 29 | ) 30 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Cpp20/smoke_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | TEST_CASE("C++20 smoke test") { 7 | StaticJsonDocument<128> doc; 8 | 9 | deserializeJson(doc, "{\"hello\":\"world\"}"); 10 | REQUIRE(doc["hello"] == "world"); 11 | 12 | std::string json; 13 | serializeJson(doc, json); 14 | REQUIRE(json == "{\"hello\":\"world\"}"); 15 | } 16 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/FailingBuilds/Issue1189.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | 7 | // a function should not be able to get a JsonDocument by value 8 | void f(JsonDocument) {} 9 | 10 | int main() { 11 | DynamicJsonDocument doc(1024); 12 | f(doc); 13 | } 14 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/FailingBuilds/Issue978.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | 7 | struct Stream {}; 8 | 9 | int main() { 10 | Stream* stream = 0; 11 | DynamicJsonDocument doc(1024); 12 | deserializeJson(doc, stream); 13 | } 14 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/FailingBuilds/assign_char.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | 7 | // See issue #1498 8 | 9 | int main() { 10 | DynamicJsonDocument doc(1024); 11 | doc["dummy"] = 'A'; 12 | } 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/FailingBuilds/delete_jsondocument.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | 7 | struct Stream {}; 8 | 9 | int main() { 10 | JsonDocument* doc = new DynamicJsonDocument(42); 11 | delete doc; 12 | } 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/FailingBuilds/read_long_long.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #define ARDUINOJSON_USE_LONG_LONG 0 6 | #include 7 | 8 | #if defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ >= 8 9 | # error This test requires sizeof(long) < 8 10 | #endif 11 | 12 | ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(long long) 13 | int main() { 14 | DynamicJsonDocument doc(1024); 15 | doc["dummy"].as(); 16 | } 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/FailingBuilds/variant_as_char.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | 7 | // See issue #1498 8 | 9 | int main() { 10 | DynamicJsonDocument doc(1024); 11 | doc["dummy"].as(); 12 | } 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/FailingBuilds/write_long_long.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #define ARDUINOJSON_USE_LONG_LONG 0 6 | #include 7 | 8 | #if defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ >= 8 9 | # error This test requires sizeof(long) < 8 10 | #endif 11 | 12 | int main() { 13 | DynamicJsonDocument doc(1024); 14 | doc["dummy"] = static_cast(42); 15 | } 16 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Helpers/Arduino.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "api/Print.h" 8 | #include "api/Stream.h" 9 | #include "api/String.h" 10 | #include "avr/pgmspace.h" 11 | 12 | #define ARDUINO 13 | #define ARDUINO_H_INCLUDED 1 14 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Helpers/CustomReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | class CustomReader { 10 | std::stringstream stream_; 11 | 12 | public: 13 | CustomReader(const char* input) : stream_(input) {} 14 | CustomReader(const CustomReader&) = delete; 15 | 16 | int read() { 17 | return stream_.get(); 18 | } 19 | 20 | size_t readBytes(char* buffer, size_t length) { 21 | stream_.read(buffer, static_cast(length)); 22 | return static_cast(stream_.gcount()); 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Helpers/api/Print.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class Print { 12 | public: 13 | virtual ~Print() {} 14 | 15 | virtual size_t write(uint8_t) = 0; 16 | virtual size_t write(const uint8_t *buffer, size_t size) = 0; 17 | 18 | size_t write(const char *str) { 19 | if (!str) 20 | return 0; 21 | return write(reinterpret_cast(str), strlen(str)); 22 | } 23 | 24 | size_t write(const char *buffer, size_t size) { 25 | return write(reinterpret_cast(buffer), size); 26 | } 27 | }; 28 | 29 | class Printable { 30 | public: 31 | virtual ~Printable() {} 32 | virtual size_t printTo(Print &p) const = 0; 33 | }; 34 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Helpers/api/Stream.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | // Reproduces Arduino's Stream class 8 | class Stream // : public Print 9 | { 10 | public: 11 | virtual ~Stream() {} 12 | virtual int read() = 0; 13 | virtual size_t readBytes(char *buffer, size_t length) = 0; 14 | }; 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Helpers/avr/pgmspace.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // uint8_t 8 | 9 | #define PROGMEM 10 | 11 | class __FlashStringHelper; 12 | 13 | inline const void* convertPtrToFlash(const void* s) { 14 | return reinterpret_cast(s) + 42; 15 | } 16 | 17 | inline const void* convertFlashToPtr(const void* s) { 18 | return reinterpret_cast(s) - 42; 19 | } 20 | 21 | #define PSTR(X) reinterpret_cast(convertPtrToFlash(X)) 22 | #define F(X) reinterpret_cast(PSTR(X)) 23 | 24 | inline uint8_t pgm_read_byte(const void* p) { 25 | return *reinterpret_cast(convertFlashToPtr(p)); 26 | } 27 | 28 | #define ARDUINOJSON_DEFINE_PROGMEM_ARRAY(type, name, ...) \ 29 | static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = __VA_ARGS__; \ 30 | static type const* name = reinterpret_cast( \ 31 | convertPtrToFlash(ARDUINOJSON_CONCAT2(name, _progmem))); 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/IntegrationTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(IntegrationTests 6 | gbathree.cpp 7 | issue772.cpp 8 | round_trip.cpp 9 | openweathermap.cpp 10 | ) 11 | 12 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6) 13 | target_compile_options(IntegrationTests 14 | PUBLIC 15 | -fsingle-precision-constant # issue 544 16 | ) 17 | endif() 18 | 19 | add_test(IntegrationTests IntegrationTests) 20 | 21 | set_tests_properties(IntegrationTests 22 | PROPERTIES 23 | LABELS "Catch" 24 | ) 25 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/IntegrationTests/issue772.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | // https://github.com/bblanchon/ArduinoJson/issues/772 9 | 10 | TEST_CASE("Issue772") { 11 | DynamicJsonDocument doc1(4096); 12 | DynamicJsonDocument doc2(4096); 13 | DeserializationError err; 14 | std::string data = 15 | "{\"state\":{\"reported\":{\"timestamp\":\"2018-07-02T09:40:12Z\"," 16 | "\"mac\":\"2C3AE84FC076\",\"firmwareVersion\":\"v0.2.7-5-gf4d4d78\"," 17 | "\"visibleLight\":261,\"infraRed\":255,\"ultraViolet\":0.02," 18 | "\"Temperature\":26.63,\"Pressure\":101145.7,\"Humidity\":54.79883," 19 | "\"Vbat\":4.171261,\"soilMoisture\":0,\"ActB\":0}}}"; 20 | err = deserializeJson(doc1, data); 21 | REQUIRE(err == DeserializationError::Ok); 22 | 23 | data = ""; 24 | serializeMsgPack(doc1, data); 25 | err = deserializeMsgPack(doc2, data); 26 | 27 | REQUIRE(err == DeserializationError::Ok); 28 | } 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(JsonArrayTests 6 | add.cpp 7 | clear.cpp 8 | compare.cpp 9 | copyArray.cpp 10 | createNested.cpp 11 | equals.cpp 12 | isNull.cpp 13 | iterator.cpp 14 | memoryUsage.cpp 15 | nesting.cpp 16 | remove.cpp 17 | size.cpp 18 | std_string.cpp 19 | subscript.cpp 20 | unbound.cpp 21 | ) 22 | 23 | add_test(JsonArray JsonArrayTests) 24 | 25 | set_tests_properties(JsonArray 26 | PROPERTIES 27 | LABELS "Catch" 28 | ) 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/clear.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonArray::clear()") { 9 | SECTION("No-op on null JsonArray") { 10 | JsonArray array; 11 | array.clear(); 12 | REQUIRE(array.isNull() == true); 13 | REQUIRE(array.size() == 0); 14 | } 15 | 16 | SECTION("Removes all elements") { 17 | StaticJsonDocument<64> doc; 18 | JsonArray array = doc.to(); 19 | array.add(1); 20 | array.add(2); 21 | array.clear(); 22 | REQUIRE(array.size() == 0); 23 | REQUIRE(array.isNull() == false); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/createNested.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonArray basics") { 9 | DynamicJsonDocument doc(4096); 10 | JsonArray array = doc.to(); 11 | 12 | SECTION("CreateNestedArray") { 13 | JsonArray arr = array.createNestedArray(); 14 | REQUIRE(arr == array[0].as()); 15 | } 16 | 17 | SECTION("CreateNestedObject") { 18 | JsonObject obj = array.createNestedObject(); 19 | REQUIRE(obj == array[0].as()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/get.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonArray::get()") { 9 | DynamicJsonDocument doc(4096); 10 | deserializeJson(doc, "[1,2,3]"); 11 | JsonArray array = doc.as(); 12 | 13 | SECTION("Overflow") { 14 | REQUIRE(array.getElement(3).isNull()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/nesting.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonArray::nesting()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonArray arr = doc.to(); 11 | 12 | SECTION("return 0 if uninitialized") { 13 | JsonArray unitialized; 14 | REQUIRE(unitialized.nesting() == 0); 15 | } 16 | 17 | SECTION("returns 1 for empty array") { 18 | REQUIRE(arr.nesting() == 1); 19 | } 20 | 21 | SECTION("returns 1 for flat array") { 22 | arr.add("hello"); 23 | REQUIRE(arr.nesting() == 1); 24 | } 25 | 26 | SECTION("returns 2 with nested array") { 27 | arr.createNestedArray(); 28 | REQUIRE(arr.nesting() == 2); 29 | } 30 | 31 | SECTION("returns 2 with nested object") { 32 | arr.createNestedObject(); 33 | REQUIRE(arr.nesting() == 2); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/size.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonArray::size()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonArray array = doc.to(); 11 | 12 | SECTION("returns 0 is empty") { 13 | REQUIRE(0U == array.size()); 14 | } 15 | 16 | SECTION("increases after add()") { 17 | array.add("hello"); 18 | REQUIRE(1U == array.size()); 19 | 20 | array.add("world"); 21 | REQUIRE(2U == array.size()); 22 | } 23 | 24 | SECTION("remains the same after replacing an element") { 25 | array.add("hello"); 26 | REQUIRE(1U == array.size()); 27 | 28 | array[0] = "hello"; 29 | REQUIRE(1U == array.size()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/std_string.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | static void eraseString(std::string& str) { 9 | char* p = const_cast(str.c_str()); 10 | while (*p) 11 | *p++ = '*'; 12 | } 13 | 14 | TEST_CASE("std::string") { 15 | DynamicJsonDocument doc(4096); 16 | JsonArray array = doc.to(); 17 | 18 | SECTION("add()") { 19 | std::string value("hello"); 20 | array.add(value); 21 | eraseString(value); 22 | REQUIRE(std::string("hello") == array[0]); 23 | } 24 | 25 | SECTION("operator[]") { 26 | std::string value("world"); 27 | array.add("hello"); 28 | array[0] = value; 29 | eraseString(value); 30 | REQUIRE(std::string("world") == array[0]); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/unbound.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | using namespace Catch::Matchers; 9 | 10 | TEST_CASE("Unbound JsonArray") { 11 | JsonArray array; 12 | 13 | SECTION("SubscriptFails") { 14 | REQUIRE(array[0].isNull()); 15 | } 16 | 17 | SECTION("AddFails") { 18 | array.add(1); 19 | REQUIRE(0 == array.size()); 20 | } 21 | 22 | SECTION("CreateNestedArrayFails") { 23 | REQUIRE(array.createNestedArray().isNull()); 24 | } 25 | 26 | SECTION("CreateNestedObjectFails") { 27 | REQUIRE(array.createNestedObject().isNull()); 28 | } 29 | 30 | SECTION("PrintToWritesBrackets") { 31 | char buffer[32]; 32 | serializeJson(array, buffer, sizeof(buffer)); 33 | REQUIRE_THAT(buffer, Equals("null")); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonArray/undefined.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | using namespace Catch::Matchers; 9 | 10 | TEST_CASE("Undefined JsonArray") { 11 | JsonArray array; 12 | 13 | SECTION("SubscriptFails") { 14 | REQUIRE(array[0].isNull()); 15 | } 16 | 17 | SECTION("AddFails") { 18 | array.add(1); 19 | REQUIRE(0 == array.size()); 20 | } 21 | 22 | SECTION("CreateNestedArrayFails") { 23 | REQUIRE(array.createNestedArray().isNull()); 24 | } 25 | 26 | SECTION("CreateNestedObjectFails") { 27 | REQUIRE(array.createNestedObject().isNull()); 28 | } 29 | 30 | SECTION("PrintToWritesBrackets") { 31 | char buffer[32]; 32 | serializeJson(array, buffer, sizeof(buffer)); 33 | REQUIRE_THAT(buffer, Equals("null")); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDeserializer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(JsonDeserializerTests 6 | array.cpp 7 | array_static.cpp 8 | DeserializationError.cpp 9 | filter.cpp 10 | incomplete_input.cpp 11 | input_types.cpp 12 | invalid_input.cpp 13 | misc.cpp 14 | nestingLimit.cpp 15 | number.cpp 16 | object.cpp 17 | object_static.cpp 18 | string.cpp 19 | ) 20 | 21 | set_target_properties(JsonDeserializerTests PROPERTIES UNITY_BUILD OFF) 22 | 23 | add_test(JsonDeserializer JsonDeserializerTests) 24 | 25 | set_tests_properties(JsonDeserializer 26 | PROPERTIES 27 | LABELS "Catch" 28 | ) 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDeserializer/incomplete_input.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #define ARDUINOJSON_DECODE_UNICODE 1 6 | #include 7 | #include 8 | 9 | TEST_CASE("Truncated JSON input") { 10 | const char* testCases[] = {"\"hello", "\'hello", "'\\u", "'\\u00", "'\\u000", 11 | // false 12 | "f", "fa", "fal", "fals", 13 | // true 14 | "t", "tr", "tru", 15 | // null 16 | "n", "nu", "nul", 17 | // object 18 | "{", "{a", "{a:", "{a:1", "{a:1,", "{a:1,"}; 19 | const size_t testCount = sizeof(testCases) / sizeof(testCases[0]); 20 | 21 | DynamicJsonDocument doc(4096); 22 | 23 | for (size_t i = 0; i < testCount; i++) { 24 | const char* input = testCases[i]; 25 | CAPTURE(input); 26 | REQUIRE(deserializeJson(doc, input) == 27 | DeserializationError::IncompleteInput); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(JsonDocumentTests 6 | add.cpp 7 | BasicJsonDocument.cpp 8 | cast.cpp 9 | compare.cpp 10 | containsKey.cpp 11 | createNested.cpp 12 | DynamicJsonDocument.cpp 13 | ElementProxy.cpp 14 | isNull.cpp 15 | issue1120.cpp 16 | MemberProxy.cpp 17 | nesting.cpp 18 | overflowed.cpp 19 | remove.cpp 20 | shrinkToFit.cpp 21 | size.cpp 22 | StaticJsonDocument.cpp 23 | subscript.cpp 24 | swap.cpp 25 | ) 26 | 27 | add_test(JsonDocument JsonDocumentTests) 28 | 29 | set_tests_properties(JsonDocument 30 | PROPERTIES 31 | LABELS "Catch" 32 | ) 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/add.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonDocument::add()") { 9 | DynamicJsonDocument doc(4096); 10 | 11 | SECTION("integer") { 12 | doc.add(42); 13 | 14 | REQUIRE(doc.as() == "[42]"); 15 | } 16 | 17 | SECTION("const char*") { 18 | doc.add("hello"); 19 | 20 | REQUIRE(doc.as() == "[\"hello\"]"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/cast.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | TEST_CASE("Implicit cast to JsonVariant") { 11 | StaticJsonDocument<128> doc; 12 | 13 | doc["hello"] = "world"; 14 | 15 | JsonVariant var = doc; 16 | 17 | CHECK(var.as() == "{\"hello\":\"world\"}"); 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/containsKey.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonDocument::containsKey()") { 9 | DynamicJsonDocument doc(4096); 10 | 11 | SECTION("returns true on object") { 12 | doc["hello"] = "world"; 13 | 14 | REQUIRE(doc.containsKey("hello") == true); 15 | } 16 | 17 | SECTION("returns true when value is null") { 18 | doc["hello"] = static_cast(0); 19 | 20 | REQUIRE(doc.containsKey("hello") == true); 21 | } 22 | 23 | SECTION("returns true when key is a std::string") { 24 | doc["hello"] = "world"; 25 | 26 | REQUIRE(doc.containsKey(std::string("hello")) == true); 27 | } 28 | 29 | SECTION("returns false on object") { 30 | doc["world"] = "hello"; 31 | 32 | REQUIRE(doc.containsKey("hello") == false); 33 | } 34 | 35 | SECTION("returns false on array") { 36 | doc.add("hello"); 37 | 38 | REQUIRE(doc.containsKey("hello") == false); 39 | } 40 | 41 | SECTION("returns false on null") { 42 | REQUIRE(doc.containsKey("hello") == false); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/isNull.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonDocument::isNull()") { 9 | DynamicJsonDocument doc(4096); 10 | 11 | SECTION("returns true if uninitialized") { 12 | REQUIRE(doc.isNull() == true); 13 | } 14 | 15 | SECTION("returns false after to()") { 16 | doc.to(); 17 | REQUIRE(doc.isNull() == false); 18 | } 19 | 20 | SECTION("returns false after to()") { 21 | doc.to(); 22 | REQUIRE(doc.isNull() == false); 23 | } 24 | 25 | SECTION("returns true after to()") { 26 | REQUIRE(doc.isNull() == true); 27 | } 28 | 29 | SECTION("returns false after set()") { 30 | doc.to().set(42); 31 | REQUIRE(doc.isNull() == false); 32 | } 33 | 34 | SECTION("returns true after clear()") { 35 | doc.to(); 36 | doc.clear(); 37 | REQUIRE(doc.isNull() == true); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/nesting.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonDocument::nesting()") { 9 | DynamicJsonDocument doc(4096); 10 | 11 | SECTION("return 0 if uninitialized") { 12 | REQUIRE(doc.nesting() == 0); 13 | } 14 | 15 | SECTION("returns 0 for string") { 16 | JsonVariant var = doc.to(); 17 | var.set("hello"); 18 | REQUIRE(doc.nesting() == 0); 19 | } 20 | 21 | SECTION("returns 1 for empty object") { 22 | doc.to(); 23 | REQUIRE(doc.nesting() == 1); 24 | } 25 | 26 | SECTION("returns 1 for empty array") { 27 | doc.to(); 28 | REQUIRE(doc.nesting() == 1); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/remove.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonDocument::remove()") { 9 | DynamicJsonDocument doc(4096); 10 | 11 | SECTION("remove(int)") { 12 | doc.add(1); 13 | doc.add(2); 14 | doc.add(3); 15 | 16 | doc.remove(1); 17 | 18 | REQUIRE(doc.as() == "[1,3]"); 19 | } 20 | 21 | SECTION("remove(const char *)") { 22 | doc["a"] = 1; 23 | doc["b"] = 2; 24 | 25 | doc.remove("a"); 26 | 27 | REQUIRE(doc.as() == "{\"b\":2}"); 28 | } 29 | 30 | SECTION("remove(std::string)") { 31 | doc["a"] = 1; 32 | doc["b"] = 2; 33 | 34 | doc.remove(std::string("b")); 35 | 36 | REQUIRE(doc.as() == "{\"a\":1}"); 37 | } 38 | 39 | #ifdef HAS_VARIABLE_LENGTH_ARRAY 40 | SECTION("remove(vla)") { 41 | doc["a"] = 1; 42 | doc["b"] = 2; 43 | 44 | size_t i = 4; 45 | char vla[i]; 46 | strcpy(vla, "b"); 47 | doc.remove(vla); 48 | 49 | REQUIRE(doc.as() == "{\"a\":1}"); 50 | } 51 | #endif 52 | } 53 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/size.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonDocument::size()") { 9 | DynamicJsonDocument doc(4096); 10 | 11 | SECTION("returns 0") { 12 | REQUIRE(doc.size() == 0); 13 | } 14 | 15 | SECTION("as an array, return 2") { 16 | doc.add(1); 17 | doc.add(2); 18 | 19 | REQUIRE(doc.size() == 2); 20 | } 21 | 22 | SECTION("as an object, return 2") { 23 | doc["a"] = 1; 24 | doc["b"] = 2; 25 | 26 | REQUIRE(doc.size() == 2); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonDocument/swap.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | 9 | TEST_CASE("std::swap") { 10 | SECTION("DynamicJsonDocument*") { 11 | DynamicJsonDocument *p1, *p2; 12 | swap(p1, p2); // issue #1678 13 | } 14 | 15 | SECTION("DynamicJsonDocument") { 16 | DynamicJsonDocument doc1(0x10), doc2(0x20); 17 | doc1.set("hello"); 18 | doc2.set("world"); 19 | 20 | swap(doc1, doc2); 21 | 22 | CHECK(doc1.capacity() == 0x20); 23 | CHECK(doc1.as() == "world"); 24 | CHECK(doc2.capacity() == 0x10); 25 | CHECK(doc2.as() == "hello"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(JsonObjectTests 6 | clear.cpp 7 | compare.cpp 8 | containsKey.cpp 9 | copy.cpp 10 | createNestedArray.cpp 11 | createNestedObject.cpp 12 | equals.cpp 13 | invalid.cpp 14 | isNull.cpp 15 | iterator.cpp 16 | memoryUsage.cpp 17 | nesting.cpp 18 | remove.cpp 19 | size.cpp 20 | std_string.cpp 21 | subscript.cpp 22 | ) 23 | 24 | add_test(JsonObject JsonObjectTests) 25 | 26 | set_tests_properties(JsonObject 27 | PROPERTIES 28 | LABELS "Catch" 29 | ) 30 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/clear.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonObject::clear()") { 9 | SECTION("No-op on null JsonObject") { 10 | JsonObject obj; 11 | obj.clear(); 12 | REQUIRE(obj.isNull() == true); 13 | REQUIRE(obj.size() == 0); 14 | } 15 | 16 | SECTION("Removes all elements") { 17 | StaticJsonDocument<64> doc; 18 | JsonObject obj = doc.to(); 19 | obj["hello"] = 1; 20 | obj["world"] = 2; 21 | obj.clear(); 22 | REQUIRE(obj.size() == 0); 23 | REQUIRE(obj.isNull() == false); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/containsKey.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonObject::containsKey()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonObject obj = doc.to(); 11 | obj["hello"] = 42; 12 | 13 | SECTION("returns true only if key is present") { 14 | REQUIRE(false == obj.containsKey("world")); 15 | REQUIRE(true == obj.containsKey("hello")); 16 | } 17 | 18 | SECTION("works with JsonObjectConst") { 19 | JsonObjectConst cobj = obj; 20 | REQUIRE(false == cobj.containsKey("world")); 21 | REQUIRE(true == cobj.containsKey("hello")); 22 | } 23 | 24 | SECTION("returns false after remove()") { 25 | obj.remove("hello"); 26 | 27 | REQUIRE(false == obj.containsKey("hello")); 28 | } 29 | 30 | #ifdef HAS_VARIABLE_LENGTH_ARRAY 31 | SECTION("key is a VLA") { 32 | size_t i = 16; 33 | char vla[i]; 34 | strcpy(vla, "hello"); 35 | 36 | REQUIRE(true == obj.containsKey(vla)); 37 | } 38 | #endif 39 | } 40 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/createNestedArray.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonObject::createNestedArray()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonObject obj = doc.to(); 11 | 12 | SECTION("key is a const char*") { 13 | JsonArray arr = obj.createNestedArray("hello"); 14 | REQUIRE(arr.isNull() == false); 15 | } 16 | 17 | #ifdef HAS_VARIABLE_LENGTH_ARRAY 18 | SECTION("key is a VLA") { 19 | size_t i = 16; 20 | char vla[i]; 21 | strcpy(vla, "hello"); 22 | 23 | JsonArray arr = obj.createNestedArray(vla); 24 | REQUIRE(arr.isNull() == false); 25 | } 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/createNestedObject.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonObject::createNestedObject()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonObject obj = doc.to(); 11 | 12 | SECTION("key is a const char*") { 13 | obj.createNestedObject("hello"); 14 | } 15 | 16 | #ifdef HAS_VARIABLE_LENGTH_ARRAY 17 | SECTION("key is a VLA") { 18 | size_t i = 16; 19 | char vla[i]; 20 | strcpy(vla, "hello"); 21 | 22 | obj.createNestedObject(vla); 23 | } 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/invalid.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | using namespace Catch::Matchers; 9 | 10 | TEST_CASE("JsonObject::invalid()") { 11 | JsonObject obj; 12 | 13 | SECTION("SubscriptFails") { 14 | REQUIRE(obj["key"].isNull()); 15 | } 16 | 17 | SECTION("AddFails") { 18 | obj["hello"] = "world"; 19 | REQUIRE(0 == obj.size()); 20 | } 21 | 22 | SECTION("CreateNestedArrayFails") { 23 | REQUIRE(obj.createNestedArray("hello").isNull()); 24 | } 25 | 26 | SECTION("CreateNestedObjectFails") { 27 | REQUIRE(obj.createNestedObject("world").isNull()); 28 | } 29 | 30 | SECTION("serialize to 'null'") { 31 | char buffer[32]; 32 | serializeJson(obj, buffer, sizeof(buffer)); 33 | REQUIRE_THAT(buffer, Equals("null")); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/nesting.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonObject::nesting()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonObject obj = doc.to(); 11 | 12 | SECTION("return 0 if uninitialized") { 13 | JsonObject unitialized; 14 | REQUIRE(unitialized.nesting() == 0); 15 | } 16 | 17 | SECTION("returns 1 for empty object") { 18 | REQUIRE(obj.nesting() == 1); 19 | } 20 | 21 | SECTION("returns 1 for flat object") { 22 | obj["hello"] = "world"; 23 | REQUIRE(obj.nesting() == 1); 24 | } 25 | 26 | SECTION("returns 2 with nested array") { 27 | obj.createNestedArray("nested"); 28 | REQUIRE(obj.nesting() == 2); 29 | } 30 | 31 | SECTION("returns 2 with nested object") { 32 | obj.createNestedObject("nested"); 33 | REQUIRE(obj.nesting() == 2); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonObject/size.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | TEST_CASE("JsonObject::size()") { 10 | DynamicJsonDocument doc(4096); 11 | JsonObject obj = doc.to(); 12 | 13 | SECTION("initial size is zero") { 14 | REQUIRE(0 == obj.size()); 15 | } 16 | 17 | SECTION("increases when values are added") { 18 | obj["hello"] = 42; 19 | REQUIRE(1 == obj.size()); 20 | } 21 | 22 | SECTION("decreases when values are removed") { 23 | obj["hello"] = 42; 24 | obj.remove("hello"); 25 | REQUIRE(0 == obj.size()); 26 | } 27 | 28 | SECTION("doesn't increase when the same key is added twice") { 29 | obj["hello"] = 1; 30 | obj["hello"] = 2; 31 | REQUIRE(1 == obj.size()); 32 | } 33 | 34 | SECTION("doesn't decrease when another key is removed") { 35 | obj["hello"] = 1; 36 | obj.remove("world"); 37 | REQUIRE(1 == obj.size()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonSerializer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(JsonSerializerTests 6 | CustomWriter.cpp 7 | JsonArray.cpp 8 | JsonArrayPretty.cpp 9 | JsonObject.cpp 10 | JsonObjectPretty.cpp 11 | JsonVariant.cpp 12 | misc.cpp 13 | std_stream.cpp 14 | std_string.cpp 15 | ) 16 | 17 | add_test(JsonSerializer JsonSerializerTests) 18 | 19 | set_tests_properties(JsonSerializer 20 | PROPERTIES 21 | LABELS "Catch" 22 | ) 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonSerializer/misc.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | TEST_CASE("serializeJson(MemberProxy)") { 6 | DynamicJsonDocument doc(4096); 7 | deserializeJson(doc, "{\"hello\":42}"); 8 | JsonObject obj = doc.as(); 9 | std::string result; 10 | 11 | serializeJson(obj["hello"], result); 12 | 13 | REQUIRE(result == "42"); 14 | } 15 | 16 | TEST_CASE("serializeJson(ElementProxy)") { 17 | DynamicJsonDocument doc(4096); 18 | deserializeJson(doc, "[42]"); 19 | JsonArray arr = doc.as(); 20 | std::string result; 21 | 22 | serializeJson(arr[0], result); 23 | 24 | REQUIRE(result == "42"); 25 | } 26 | 27 | TEST_CASE("serializeJson(JsonVariantSubscript)") { 28 | DynamicJsonDocument doc(4096); 29 | deserializeJson(doc, "[42]"); 30 | JsonVariant var = doc.as(); 31 | std::string result; 32 | 33 | serializeJson(var[0], result); 34 | 35 | REQUIRE(result == "42"); 36 | } 37 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonVariant/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(JsonVariantTests 6 | add.cpp 7 | as.cpp 8 | clear.cpp 9 | compare.cpp 10 | containsKey.cpp 11 | converters.cpp 12 | copy.cpp 13 | createNested.cpp 14 | is.cpp 15 | isnull.cpp 16 | memoryUsage.cpp 17 | misc.cpp 18 | nesting.cpp 19 | nullptr.cpp 20 | or.cpp 21 | overflow.cpp 22 | remove.cpp 23 | set.cpp 24 | shallowCopy.cpp 25 | size.cpp 26 | stl_containers.cpp 27 | subscript.cpp 28 | types.cpp 29 | unbound.cpp 30 | ) 31 | 32 | add_test(JsonVariant JsonVariantTests) 33 | 34 | set_tests_properties(JsonVariant 35 | PROPERTIES 36 | LABELS "Catch" 37 | ) 38 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonVariant/add.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | TEST_CASE("JsonVariant::add()") { 10 | DynamicJsonDocument doc(4096); 11 | JsonVariant var = doc.to(); 12 | 13 | SECTION("add integer to new variant") { 14 | var.add(42); 15 | 16 | REQUIRE(var.as() == "[42]"); 17 | } 18 | 19 | SECTION("add const char* to new variant") { 20 | var.add("hello"); 21 | 22 | REQUIRE(var.as() == "[\"hello\"]"); 23 | } 24 | 25 | SECTION("add std::string to new variant") { 26 | var.add(std::string("hello")); 27 | 28 | REQUIRE(var.as() == "[\"hello\"]"); 29 | } 30 | 31 | SECTION("add integer to integer") { 32 | var.set(123); 33 | 34 | var.add(456); // no-op 35 | 36 | REQUIRE(var.as() == "123"); 37 | } 38 | 39 | SECTION("add integer to object") { 40 | var["val"] = 123; 41 | 42 | var.add(456); // no-op 43 | 44 | REQUIRE(var.as() == "{\"val\":123}"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonVariant/clear.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | TEST_CASE("JsonVariant::clear()") { 10 | DynamicJsonDocument doc(4096); 11 | JsonVariant var = doc.to(); 12 | 13 | SECTION("size goes back to zero") { 14 | var.add(42); 15 | var.clear(); 16 | 17 | REQUIRE(var.size() == 0); 18 | } 19 | 20 | SECTION("isNull() return true") { 21 | var.add("hello"); 22 | var.clear(); 23 | 24 | REQUIRE(var.isNull() == true); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonVariant/nesting.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonVariant::nesting()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonVariant var = doc.to(); 11 | 12 | SECTION("return 0 if uninitialized") { 13 | JsonVariant unitialized; 14 | REQUIRE(unitialized.nesting() == 0); 15 | } 16 | 17 | SECTION("returns 0 for string") { 18 | var.set("hello"); 19 | REQUIRE(var.nesting() == 0); 20 | } 21 | 22 | SECTION("returns 1 for empty object") { 23 | var.to(); 24 | REQUIRE(var.nesting() == 1); 25 | } 26 | 27 | SECTION("returns 1 for empty array") { 28 | var.to(); 29 | REQUIRE(var.nesting() == 1); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonVariant/nullptr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | TEST_CASE("nullptr") { 6 | DynamicJsonDocument doc(4096); 7 | JsonVariant variant = doc.to(); 8 | 9 | SECTION("JsonVariant == nullptr") { 10 | REQUIRE(variant == nullptr); 11 | REQUIRE_FALSE(variant != nullptr); 12 | } 13 | 14 | SECTION("JsonVariant != nullptr") { 15 | variant.set(42); 16 | 17 | REQUIRE_FALSE(variant == nullptr); 18 | REQUIRE(variant != nullptr); 19 | } 20 | 21 | SECTION("JsonVariant.set(nullptr)") { 22 | variant.set(42); 23 | variant.set(nullptr); 24 | 25 | REQUIRE(variant.isNull()); 26 | } 27 | 28 | SECTION("JsonVariant.set(nullptr) with unbound reference") { 29 | JsonVariant unboundReference; 30 | 31 | unboundReference.set(nullptr); 32 | 33 | REQUIRE(variant.isNull()); 34 | } 35 | 36 | SECTION("JsonVariant.is()") { 37 | variant.set(42); 38 | REQUIRE(variant.is() == false); 39 | 40 | variant.clear(); 41 | REQUIRE(variant.is() == true); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonVariant/remove.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | TEST_CASE("JsonVariant::remove()") { 10 | DynamicJsonDocument doc(4096); 11 | JsonVariant var = doc.to(); 12 | 13 | SECTION("remove(int)") { 14 | var.add(1); 15 | var.add(2); 16 | var.add(3); 17 | 18 | var.remove(1); 19 | 20 | REQUIRE(var.as() == "[1,3]"); 21 | } 22 | 23 | SECTION("remove(const char *)") { 24 | var["a"] = 1; 25 | var["b"] = 2; 26 | 27 | var.remove("a"); 28 | 29 | REQUIRE(var.as() == "{\"b\":2}"); 30 | } 31 | 32 | SECTION("remove(std::string)") { 33 | var["a"] = 1; 34 | var["b"] = 2; 35 | 36 | var.remove(std::string("b")); 37 | 38 | REQUIRE(var.as() == "{\"a\":1}"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/JsonVariant/size.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("JsonVariant::size()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonVariant variant = doc.to(); 11 | 12 | SECTION("unbound reference") { 13 | JsonVariant unbound; 14 | 15 | CHECK(unbound.size() == 0); 16 | } 17 | 18 | SECTION("int") { 19 | variant.set(42); 20 | 21 | CHECK(variant.size() == 0); 22 | } 23 | 24 | SECTION("string") { 25 | variant.set("hello"); 26 | 27 | CHECK(variant.size() == 0); 28 | } 29 | 30 | SECTION("object") { 31 | variant["a"] = 1; 32 | variant["b"] = 2; 33 | 34 | CHECK(variant.size() == 2); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MemoryPool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(MemoryPoolTests 6 | allocVariant.cpp 7 | clear.cpp 8 | saveString.cpp 9 | size.cpp 10 | StringCopier.cpp 11 | ) 12 | 13 | add_test(MemoryPool MemoryPoolTests) 14 | 15 | set_tests_properties(MemoryPool 16 | PROPERTIES 17 | LABELS "Catch" 18 | ) 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MemoryPool/clear.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace ArduinoJson::detail; 10 | 11 | static const size_t poolCapacity = 512; 12 | 13 | TEST_CASE("MemoryPool::clear()") { 14 | char buffer[poolCapacity]; 15 | MemoryPool pool(buffer, sizeof(buffer)); 16 | 17 | SECTION("Discards allocated variants") { 18 | pool.allocVariant(); 19 | 20 | pool.clear(); 21 | REQUIRE(pool.size() == 0); 22 | } 23 | 24 | SECTION("Discards allocated strings") { 25 | pool.saveString(adaptString(const_cast("123456789"))); 26 | REQUIRE(pool.size() == 10); 27 | 28 | pool.clear(); 29 | 30 | REQUIRE(pool.size() == 0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MemoryPool/size.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | using namespace ArduinoJson::detail; 9 | 10 | TEST_CASE("MemoryPool::capacity()") { 11 | char buffer[4096]; 12 | const size_t capacity = 64; 13 | MemoryPool pool(buffer, capacity); 14 | REQUIRE(capacity == pool.capacity()); 15 | } 16 | 17 | TEST_CASE("MemoryPool::size()") { 18 | char buffer[4096]; 19 | MemoryPool pool(buffer, sizeof(buffer)); 20 | 21 | SECTION("Initial size is 0") { 22 | REQUIRE(0 == pool.size()); 23 | } 24 | 25 | SECTION("Doesn't grow when memory pool is full") { 26 | const size_t variantCount = sizeof(buffer) / sizeof(VariantSlot); 27 | 28 | for (size_t i = 0; i < variantCount; i++) 29 | pool.allocVariant(); 30 | size_t size = pool.size(); 31 | 32 | pool.allocVariant(); 33 | 34 | REQUIRE(size == pool.size()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Misc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(MiscTests 6 | arithmeticCompare.cpp 7 | conflicts.cpp 8 | FloatParts.cpp 9 | issue1967.cpp 10 | JsonString.cpp 11 | NoArduinoHeader.cpp 12 | printable.cpp 13 | Readers.cpp 14 | StringAdapters.cpp 15 | StringWriter.cpp 16 | TypeTraits.cpp 17 | unsigned_char.cpp 18 | Utf16.cpp 19 | Utf8.cpp 20 | version.cpp 21 | ) 22 | 23 | set_target_properties(MiscTests PROPERTIES UNITY_BUILD OFF) 24 | 25 | add_test(Misc MiscTests) 26 | 27 | set_tests_properties(Misc 28 | PROPERTIES 29 | LABELS "Catch" 30 | ) 31 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Misc/NoArduinoHeader.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #define ARDUINO 1 6 | #define ARDUINOJSON_ENABLE_PROGMEM 0 7 | #define ARDUINOJSON_ENABLE_ARDUINO_STRING 0 8 | #define ARDUINOJSON_ENABLE_ARDUINO_STREAM 0 9 | #define ARDUINOJSON_ENABLE_ARDUINO_PRINT 0 10 | #include 11 | 12 | #include 13 | 14 | TEST_CASE("Arduino.h") { 15 | #ifdef ARDUINO_H_INCLUDED 16 | FAIL("Arduino.h should not be included"); 17 | #else 18 | INFO("Arduino.h not included"); 19 | #endif 20 | } 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Misc/custom_string.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | struct custom_char_traits : std::char_traits {}; 10 | struct custom_allocator : std::allocator {}; 11 | typedef std::basic_string 12 | custom_string; 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Misc/issue1967.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | // we expect ArduinoJson.h to include 6 | #define ARDUINOJSON_ENABLE_STD_STRING 1 7 | 8 | // but we don't want it to included accidentally 9 | #undef ARDUINO 10 | #define ARDUINOJSON_ENABLE_STD_STREAM 0 11 | #define ARDUINOJSON_ENABLE_STRING_VIEW 0 12 | 13 | #include 14 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Misc/version.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | using Catch::Matchers::StartsWith; 10 | 11 | TEST_CASE("ARDUINOJSON_VERSION") { 12 | std::stringstream version; 13 | 14 | version << ARDUINOJSON_VERSION_MAJOR << "." << ARDUINOJSON_VERSION_MINOR 15 | << "." << ARDUINOJSON_VERSION_REVISION; 16 | 17 | REQUIRE_THAT(ARDUINOJSON_VERSION, StartsWith(version.str())); 18 | } 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Misc/weird_strcmp.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | 7 | #include // strcmp, strncmp 8 | 9 | // Issue #1198: strcmp() implementation that returns a value larger than 8-bit 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | int strcmp(const char* a, const char* b) { 14 | int result = ::strcmp(a, b); 15 | if (result > 0) 16 | return 2147483647; 17 | if (result < 0) 18 | return -214748364; 19 | return 0; 20 | } 21 | 22 | int strncmp(const char* a, const char* b, size_t n) { 23 | int result = ::strncmp(a, b, n); 24 | if (result > 0) 25 | return 2147483647; 26 | if (result < 0) 27 | return -214748364; 28 | return 0; 29 | } 30 | 31 | ARDUINOJSON_END_PRIVATE_NAMESPACE 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(MixedConfigurationTests 6 | decode_unicode_0.cpp 7 | decode_unicode_1.cpp 8 | enable_alignment_0.cpp 9 | enable_alignment_1.cpp 10 | enable_comments_0.cpp 11 | enable_comments_1.cpp 12 | enable_infinity_0.cpp 13 | enable_infinity_1.cpp 14 | enable_nan_0.cpp 15 | enable_nan_1.cpp 16 | enable_progmem_1.cpp 17 | enable_string_deduplication_0.cpp 18 | enable_string_deduplication_1.cpp 19 | issue1707.cpp 20 | use_double_0.cpp 21 | use_double_1.cpp 22 | use_long_long_0.cpp 23 | use_long_long_1.cpp 24 | ) 25 | 26 | set_target_properties(MixedConfigurationTests PROPERTIES UNITY_BUILD OFF) 27 | 28 | add_test(MixedConfiguration MixedConfigurationTests) 29 | 30 | set_tests_properties(MixedConfiguration 31 | PROPERTIES 32 | LABELS "Catch" 33 | ) 34 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/decode_unicode_0.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_DECODE_UNICODE 0 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_DECODE_UNICODE == 0") { 7 | DynamicJsonDocument doc(2048); 8 | DeserializationError err = deserializeJson(doc, "\"\\uD834\\uDD1E\""); 9 | 10 | REQUIRE(err == DeserializationError::Ok); 11 | REQUIRE(doc.as() == "\\uD834\\uDD1E"); 12 | } 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/decode_unicode_1.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_DECODE_UNICODE 1 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_DECODE_UNICODE == 1") { 7 | DynamicJsonDocument doc(2048); 8 | DeserializationError err = deserializeJson(doc, "\"\\uD834\\uDD1E\""); 9 | 10 | REQUIRE(err == DeserializationError::Ok); 11 | } 12 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_0.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_VERSION_NAMESPACE NoAlignment 2 | #define ARDUINOJSON_ENABLE_ALIGNMENT 0 3 | #include 4 | 5 | #include 6 | 7 | TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 0") { 8 | using namespace ArduinoJson::detail; 9 | 10 | const size_t N = sizeof(void*); 11 | 12 | SECTION("isAligned()") { 13 | CHECK(isAligned(0) == true); 14 | CHECK(isAligned(1) == true); 15 | CHECK(isAligned(N) == true); 16 | CHECK(isAligned(N + 1) == true); 17 | CHECK(isAligned(2 * N) == true); 18 | CHECK(isAligned(2 * N + 1) == true); 19 | } 20 | 21 | SECTION("addPadding()") { 22 | CHECK(addPadding(0) == 0); 23 | CHECK(addPadding(1) == 1); 24 | CHECK(addPadding(N) == N); 25 | CHECK(addPadding(N + 1) == N + 1); 26 | } 27 | 28 | SECTION("AddPadding<>") { 29 | const size_t a = AddPadding<0>::value; 30 | CHECK(a == 0); 31 | 32 | const size_t b = AddPadding<1>::value; 33 | CHECK(b == 1); 34 | 35 | const size_t c = AddPadding::value; 36 | CHECK(c == N); 37 | 38 | const size_t d = AddPadding::value; 39 | CHECK(d == N + 1); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_1.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_ENABLE_ALIGNMENT 1 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 1") { 7 | using namespace ArduinoJson::detail; 8 | 9 | const size_t N = sizeof(void*); 10 | 11 | SECTION("isAligned()") { 12 | CHECK(isAligned(0) == true); 13 | CHECK(isAligned(1) == false); 14 | CHECK(isAligned(N) == true); 15 | CHECK(isAligned(N + 1) == false); 16 | CHECK(isAligned(2 * N) == true); 17 | CHECK(isAligned(2 * N + 1) == false); 18 | } 19 | 20 | SECTION("addPadding()") { 21 | CHECK(addPadding(0) == 0); 22 | CHECK(addPadding(1) == N); 23 | CHECK(addPadding(N) == N); 24 | CHECK(addPadding(N + 1) == 2 * N); 25 | } 26 | 27 | SECTION("AddPadding<>") { 28 | const size_t a = AddPadding<0>::value; 29 | CHECK(a == 0); 30 | 31 | const size_t b = AddPadding<1>::value; 32 | CHECK(b == N); 33 | 34 | const size_t c = AddPadding::value; 35 | CHECK(c == N); 36 | 37 | const size_t d = AddPadding::value; 38 | CHECK(d == 2 * N); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/enable_infinity_0.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_ENABLE_INFINITY 0 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | static void assertParseFails(const char* json) { 8 | DynamicJsonDocument doc(4096); 9 | DeserializationError err = deserializeJson(doc, json); 10 | 11 | REQUIRE(err == DeserializationError::InvalidInput); 12 | } 13 | 14 | static void assertJsonEquals(const JsonDocument& doc, 15 | std::string expectedJson) { 16 | std::string actualJson; 17 | serializeJson(doc, actualJson); 18 | REQUIRE(actualJson == expectedJson); 19 | } 20 | 21 | TEST_CASE("ARDUINOJSON_ENABLE_INFINITY == 0") { 22 | SECTION("serializeJson()") { 23 | DynamicJsonDocument doc(4096); 24 | doc.add(std::numeric_limits::infinity()); 25 | doc.add(-std::numeric_limits::infinity()); 26 | 27 | assertJsonEquals(doc, "[null,null]"); 28 | } 29 | 30 | SECTION("deserializeJson()") { 31 | assertParseFails("{\"X\":Infinity}"); 32 | assertParseFails("{\"X\":-Infinity}"); 33 | assertParseFails("{\"X\":+Infinity}"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/enable_infinity_1.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_ENABLE_INFINITY 1 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace my { 8 | using ArduinoJson::detail::isinf; 9 | } // namespace my 10 | 11 | TEST_CASE("ARDUINOJSON_ENABLE_INFINITY == 1") { 12 | DynamicJsonDocument doc(4096); 13 | 14 | SECTION("serializeJson()") { 15 | doc.add(std::numeric_limits::infinity()); 16 | doc.add(-std::numeric_limits::infinity()); 17 | 18 | std::string json; 19 | serializeJson(doc, json); 20 | 21 | REQUIRE(json == "[Infinity,-Infinity]"); 22 | } 23 | 24 | SECTION("deserializeJson()") { 25 | DeserializationError err = 26 | deserializeJson(doc, "[Infinity,-Infinity,+Infinity]"); 27 | float a = doc[0]; 28 | float b = doc[1]; 29 | float c = doc[2]; 30 | 31 | REQUIRE(err == DeserializationError::Ok); 32 | REQUIRE(my::isinf(a)); 33 | REQUIRE(a > 0); 34 | REQUIRE(my::isinf(b)); 35 | REQUIRE(b < 0); 36 | REQUIRE(my::isinf(c)); 37 | REQUIRE(c > 0); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/enable_nan_0.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_ENABLE_NAN 0 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | TEST_CASE("ARDUINOJSON_ENABLE_NAN == 0") { 8 | DynamicJsonDocument doc(4096); 9 | JsonObject root = doc.to(); 10 | 11 | SECTION("serializeJson()") { 12 | root["X"] = std::numeric_limits::signaling_NaN(); 13 | 14 | std::string json; 15 | serializeJson(doc, json); 16 | 17 | REQUIRE(json == "{\"X\":null}"); 18 | } 19 | 20 | SECTION("deserializeJson()") { 21 | DeserializationError err = deserializeJson(doc, "{\"X\":NaN}"); 22 | 23 | REQUIRE(err == DeserializationError::InvalidInput); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/enable_nan_1.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_ENABLE_NAN 1 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace my { 8 | using ArduinoJson::detail::isnan; 9 | } // namespace my 10 | 11 | TEST_CASE("ARDUINOJSON_ENABLE_NAN == 1") { 12 | DynamicJsonDocument doc(4096); 13 | JsonObject root = doc.to(); 14 | 15 | SECTION("serializeJson()") { 16 | root["X"] = std::numeric_limits::signaling_NaN(); 17 | 18 | std::string json; 19 | serializeJson(doc, json); 20 | 21 | REQUIRE(json == "{\"X\":NaN}"); 22 | } 23 | 24 | SECTION("deserializeJson()") { 25 | DeserializationError err = deserializeJson(doc, "{\"X\":NaN}"); 26 | float x = doc["X"]; 27 | 28 | REQUIRE(err == DeserializationError::Ok); 29 | REQUIRE(my::isnan(x)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/issue1707.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #define ARDUINO 6 | #define memcpy_P(dest, src, n) memcpy((dest), (src), (n)) 7 | 8 | #include 9 | 10 | #include 11 | 12 | TEST_CASE("Issue1707") { 13 | StaticJsonDocument<128> doc; 14 | 15 | DeserializationError err = deserializeJson(doc, F("{\"hello\":12}")); 16 | REQUIRE(err == DeserializationError::Ok); 17 | } 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/use_double_0.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_USE_DOUBLE 0 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_USE_DOUBLE == 0") { 7 | DynamicJsonDocument doc(4096); 8 | JsonObject root = doc.to(); 9 | 10 | root["pi"] = 3.14; 11 | root["e"] = 2.72; 12 | 13 | std::string json; 14 | serializeJson(doc, json); 15 | 16 | REQUIRE(json == "{\"pi\":3.14,\"e\":2.72}"); 17 | } 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/use_double_1.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_USE_DOUBLE 1 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_USE_DOUBLE == 1") { 7 | DynamicJsonDocument doc(4096); 8 | JsonObject root = doc.to(); 9 | 10 | root["pi"] = 3.14; 11 | root["e"] = 2.72; 12 | 13 | std::string json; 14 | serializeJson(doc, json); 15 | 16 | REQUIRE(json == "{\"pi\":3.14,\"e\":2.72}"); 17 | } 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/use_long_long_0.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_USE_LONG_LONG 0 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 0") { 7 | DynamicJsonDocument doc(4096); 8 | 9 | doc["A"] = 42; 10 | doc["B"] = 84; 11 | 12 | std::string json; 13 | serializeJson(doc, json); 14 | 15 | REQUIRE(json == "{\"A\":42,\"B\":84}"); 16 | } 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MixedConfiguration/use_long_long_1.cpp: -------------------------------------------------------------------------------- 1 | #define ARDUINOJSON_USE_LONG_LONG 1 2 | #include 3 | 4 | #include 5 | 6 | TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 1") { 7 | DynamicJsonDocument doc(4096); 8 | JsonObject root = doc.to(); 9 | 10 | root["A"] = 123456789123456789; 11 | root["B"] = 987654321987654321; 12 | 13 | std::string json; 14 | serializeJson(doc, json); 15 | 16 | REQUIRE(json == "{\"A\":123456789123456789,\"B\":987654321987654321}"); 17 | } 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MsgPackDeserializer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(MsgPackDeserializerTests 6 | deserializeArray.cpp 7 | deserializeObject.cpp 8 | deserializeStaticVariant.cpp 9 | deserializeVariant.cpp 10 | doubleToFloat.cpp 11 | filter.cpp 12 | incompleteInput.cpp 13 | input_types.cpp 14 | misc.cpp 15 | nestingLimit.cpp 16 | notSupported.cpp 17 | ) 18 | 19 | add_test(MsgPackDeserializer MsgPackDeserializerTests) 20 | 21 | set_tests_properties(MsgPackDeserializer 22 | PROPERTIES 23 | LABELS "Catch" 24 | ) 25 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MsgPackDeserializer/doubleToFloat.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | using namespace ArduinoJson::detail; 9 | 10 | template 11 | static void check(const char* input, T expected) { 12 | T actual; 13 | uint8_t* f = reinterpret_cast(&actual); 14 | const uint8_t* d = reinterpret_cast(input); 15 | doubleToFloat(d, f); 16 | fixEndianess(actual); 17 | CHECK(actual == expected); 18 | } 19 | 20 | TEST_CASE("doubleToFloat()") { 21 | check("\x40\x09\x21\xCA\xC0\x83\x12\x6F", 3.1415f); 22 | check("\x00\x00\x00\x00\x00\x00\x00\x00", 0.0f); 23 | check("\x80\x00\x00\x00\x00\x00\x00\x00", -0.0f); 24 | check("\xC0\x5E\xDC\xCC\xCC\xCC\xCC\xCD", -123.45f); 25 | } 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MsgPackDeserializer/misc.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | TEST_CASE("deserializeMsgPack() returns EmptyInput") { 11 | StaticJsonDocument<100> doc; 12 | 13 | SECTION("from sized buffer") { 14 | DeserializationError err = deserializeMsgPack(doc, "", 0); 15 | 16 | REQUIRE(err == DeserializationError::EmptyInput); 17 | } 18 | 19 | SECTION("from stream") { 20 | std::istringstream input(""); 21 | 22 | DeserializationError err = deserializeMsgPack(doc, input); 23 | 24 | REQUIRE(err == DeserializationError::EmptyInput); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MsgPackSerializer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(MsgPackSerializerTests 6 | destination_types.cpp 7 | measure.cpp 8 | misc.cpp 9 | serializeArray.cpp 10 | serializeObject.cpp 11 | serializeVariant.cpp 12 | ) 13 | 14 | add_test(MsgPackSerializer MsgPackSerializerTests) 15 | 16 | set_tests_properties(MsgPackSerializer 17 | PROPERTIES 18 | LABELS "Catch" 19 | ) 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/MsgPackSerializer/measure.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #include 6 | #include 7 | 8 | TEST_CASE("measureMsgPack()") { 9 | DynamicJsonDocument doc(4096); 10 | JsonObject object = doc.to(); 11 | object["hello"] = "world"; 12 | 13 | REQUIRE(measureMsgPack(doc) == 13); 14 | } 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/Numbers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(NumbersTests 6 | convertNumber.cpp 7 | parseFloat.cpp 8 | parseDouble.cpp 9 | parseInteger.cpp 10 | parseNumber.cpp 11 | ) 12 | 13 | add_test(Numbers NumbersTests) 14 | 15 | set_tests_properties(Numbers 16 | PROPERTIES 17 | LABELS "Catch" 18 | ) 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/TextFormatter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright © 2014-2023, Benoit BLANCHON 3 | # MIT License 4 | 5 | add_executable(TextFormatterTests 6 | writeFloat.cpp 7 | writeInteger.cpp 8 | writeString.cpp 9 | ) 10 | 11 | set_target_properties(TextFormatterTests PROPERTIES UNITY_BUILD OFF) 12 | 13 | add_test(TextFormatter TextFormatterTests) 14 | 15 | set_tests_properties(TextFormatter 16 | PROPERTIES 17 | LABELS "Catch" 18 | ) 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/catch/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/catch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - https://arduinojson.org 2 | # Copyright Benoit Blanchon 2014-2021 3 | # MIT License 4 | 5 | set(CMAKE_CXX_STANDARD 17) 6 | set(CMAKE_CXX_STANDARD_REQUIRED OFF) 7 | 8 | add_library(catch 9 | catch.hpp 10 | catch.cpp 11 | ) 12 | 13 | target_include_directories(catch 14 | PUBLIC 15 | ${CMAKE_CURRENT_SOURCE_DIR} 16 | ) 17 | 18 | if(MINGW) 19 | # prevent "too many sections (32837)" with MinGW 20 | target_compile_options(catch PRIVATE -Wa,-mbig-obj) 21 | endif() 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson/extras/tests/catch/catch.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #define CATCH_CONFIG_MAIN 6 | #include "catch.hpp" 7 | -------------------------------------------------------------------------------- /lib/ArduinoJson/idf_component.yml: -------------------------------------------------------------------------------- 1 | version: "6.21.4" 2 | description: >- 3 | A simple and efficient JSON library for embedded C++. 4 | ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. 5 | It is the most popular Arduino library on GitHub ❤❤❤❤❤. 6 | Check out arduinojson.org for a comprehensive documentation. 7 | url: https://arduinojson.org/ 8 | files: 9 | exclude: 10 | - "**/.vs/**/*" 11 | - ".devcontainer/**/*" 12 | - "examples/**/*" 13 | - "extras/**/*" 14 | -------------------------------------------------------------------------------- /lib/ArduinoJson/keywords.txt: -------------------------------------------------------------------------------- 1 | # Macros 2 | JSON_ARRAY_SIZE KEYWORD2 3 | JSON_OBJECT_SIZE KEYWORD2 4 | JSON_STRING_SIZE KEYWORD2 5 | 6 | # Free functions 7 | deserializeJson KEYWORD2 8 | deserializeMsgPack KEYWORD2 9 | serialized KEYWORD2 10 | serializeJson KEYWORD2 11 | serializeJsonPretty KEYWORD2 12 | serializeMsgPack KEYWORD2 13 | measureJson KEYWORD2 14 | measureJsonPretty KEYWORD2 15 | measureMsgPack KEYWORD2 16 | 17 | # Methods 18 | add KEYWORD2 19 | as KEYWORD2 20 | createNestedArray KEYWORD2 21 | createNestedObject KEYWORD2 22 | get KEYWORD2 23 | set KEYWORD2 24 | to KEYWORD2 25 | 26 | # Type names 27 | DeserializationError KEYWORD1 DATA_TYPE 28 | DynamicJsonDocument KEYWORD1 DATA_TYPE 29 | JsonArray KEYWORD1 DATA_TYPE 30 | JsonArrayConst KEYWORD1 DATA_TYPE 31 | JsonDocument KEYWORD1 DATA_TYPE 32 | JsonFloat KEYWORD1 DATA_TYPE 33 | JsonInteger KEYWORD1 DATA_TYPE 34 | JsonObject KEYWORD1 DATA_TYPE 35 | JsonObjectConst KEYWORD1 DATA_TYPE 36 | JsonString KEYWORD1 DATA_TYPE 37 | JsonUInt KEYWORD1 DATA_TYPE 38 | JsonVariant KEYWORD1 DATA_TYPE 39 | JsonVariantConst KEYWORD1 DATA_TYPE 40 | StaticJsonDocument KEYWORD1 DATA_TYPE 41 | -------------------------------------------------------------------------------- /lib/ArduinoJson/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ArduinoJson", 3 | "keywords": "json, rest, http, web", 4 | "description": "A simple and efficient JSON library for embedded C++. ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation.", 5 | "homepage": "https://arduinojson.org/?utm_source=meta&utm_medium=library.json", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/bblanchon/ArduinoJson.git" 9 | }, 10 | "version": "6.21.4", 11 | "authors": { 12 | "name": "Benoit Blanchon", 13 | "url": "https://blog.benoitblanchon.fr" 14 | }, 15 | "exclude": [ 16 | ".devcontainer", 17 | ".github", 18 | "extras" 19 | ], 20 | "frameworks": "*", 21 | "platforms": "*", 22 | "build": { 23 | "libArchive": false 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/library.properties: -------------------------------------------------------------------------------- 1 | name=ArduinoJson 2 | version=6.21.4 3 | author=Benoit Blanchon 4 | maintainer=Benoit Blanchon 5 | sentence=A simple and efficient JSON library for embedded C++. 6 | paragraph=ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation. 7 | category=Data Processing 8 | url=https://arduinojson.org/?utm_source=meta&utm_medium=library.properties 9 | architectures=* 10 | repository=https://github.com/bblanchon/ArduinoJson.git 11 | license=MIT 12 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef __cplusplus 8 | 9 | # include "ArduinoJson.hpp" 10 | 11 | using namespace ArduinoJson; 12 | 13 | #else 14 | 15 | #error ArduinoJson requires a C++ compiler, please change file extension to .cc or .cpp 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Array/ArrayFunctions.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | inline VariantData *arrayAdd(CollectionData *arr, MemoryPool *pool) { 12 | return arr ? arr->addElement(pool) : 0; 13 | } 14 | 15 | template 16 | inline typename TVisitor::result_type arrayAccept(const CollectionData *arr, 17 | TVisitor &visitor) { 18 | if (arr) 19 | return visitor.visitArray(*arr); 20 | else 21 | return visitor.visitNull(); 22 | } 23 | 24 | inline bool arrayEquals(const CollectionData *lhs, const CollectionData *rhs) { 25 | if (lhs == rhs) 26 | return true; 27 | if (!lhs || !rhs) 28 | return false; 29 | return lhs->equalsArray(*rhs); 30 | } 31 | } // namespace ARDUINOJSON_NAMESPACE 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | template 13 | inline ArrayRef ArrayShortcuts::createNestedArray() const { 14 | return impl()->addElement().template to(); 15 | } 16 | 17 | template 18 | inline ObjectRef ArrayShortcuts::createNestedObject() const { 19 | return impl()->addElement().template to(); 20 | } 21 | 22 | template 23 | inline ElementProxy ArrayShortcuts::operator[]( 24 | size_t index) const { 25 | return ElementProxy(*impl(), index); 26 | } 27 | 28 | } // namespace ARDUINOJSON_NAMESPACE 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Array/JsonArrayImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE 11 | 12 | inline JsonObject JsonArray::createNestedObject() const { 13 | return add().to(); 14 | } 15 | 16 | ARDUINOJSON_END_PUBLIC_NAMESPACE 17 | 18 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 19 | 20 | template 21 | inline JsonArray VariantRefBase::createNestedArray() const { 22 | return add().template to(); 23 | } 24 | 25 | template 26 | inline JsonObject VariantRefBase::createNestedObject() const { 27 | return add().template to(); 28 | } 29 | 30 | template 31 | inline ElementProxy VariantRefBase::operator[]( 32 | size_t index) const { 33 | return ElementProxy(derived(), index); 34 | } 35 | 36 | ARDUINOJSON_END_PRIVATE_NAMESPACE 37 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE 11 | 12 | namespace DeserializationOption { 13 | class NestingLimit { 14 | public: 15 | NestingLimit() : value_(ARDUINOJSON_DEFAULT_NESTING_LIMIT) {} 16 | explicit NestingLimit(uint8_t n) : value_(n) {} 17 | 18 | NestingLimit decrement() const { 19 | ARDUINOJSON_ASSERT(value_ > 0); 20 | return NestingLimit(static_cast(value_ - 1)); 21 | } 22 | 23 | bool reached() const { 24 | return value_ == 0; 25 | } 26 | 27 | private: 28 | uint8_t value_; 29 | }; 30 | } // namespace DeserializationOption 31 | 32 | ARDUINOJSON_END_PUBLIC_NAMESPACE 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct Reader::value>::type> { 14 | public: 15 | explicit Reader(Stream& stream) : stream_(&stream) {} 16 | 17 | int read() { 18 | // don't use stream_.read() as it ignores the timeout 19 | char c; 20 | return stream_->readBytes(&c, 1) ? static_cast(c) : -1; 21 | } 22 | 23 | size_t readBytes(char* buffer, size_t length) { 24 | return stream_->readBytes(buffer, length); 25 | } 26 | 27 | private: 28 | Stream* stream_; 29 | }; 30 | 31 | ARDUINOJSON_END_PRIVATE_NAMESPACE 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct Reader::value>::type> 14 | : BoundedReader { 15 | explicit Reader(const ::String& s) 16 | : BoundedReader(s.c_str(), s.length()) {} 17 | }; 18 | 19 | ARDUINOJSON_END_PRIVATE_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/StdStreamReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct Reader::value>::type> { 14 | public: 15 | explicit Reader(std::istream& stream) : stream_(&stream) {} 16 | 17 | int read() { 18 | return stream_->get(); 19 | } 20 | 21 | size_t readBytes(char* buffer, size_t length) { 22 | stream_->read(buffer, static_cast(length)); 23 | return static_cast(stream_->gcount()); 24 | } 25 | 26 | private: 27 | std::istream* stream_; 28 | }; 29 | 30 | ARDUINOJSON_END_PRIVATE_NAMESPACE 31 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Deserialization/Readers/VariantReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 11 | 12 | template 13 | struct Reader::value>::type> 14 | : Reader { 15 | explicit Reader(const TVariant& x) 16 | : Reader(x.template as()) {} 17 | }; 18 | 19 | ARDUINOJSON_END_PRIVATE_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Document/DynamicJsonDocument.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include // malloc, free 10 | 11 | ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE 12 | 13 | // The allocator of DynamicJsonDocument. 14 | struct DefaultAllocator { 15 | void* allocate(size_t size) { 16 | return malloc(size); 17 | } 18 | 19 | void deallocate(void* ptr) { 20 | free(ptr); 21 | } 22 | 23 | void* reallocate(void* ptr, size_t new_size) { 24 | return realloc(ptr, new_size); 25 | } 26 | }; 27 | 28 | // A JsonDocument with a memory pool in the heap. 29 | // https://arduinojson.org/v6/api/dynamicjsondocument/ 30 | typedef BasicJsonDocument DynamicJsonDocument; 31 | 32 | ARDUINOJSON_END_PUBLIC_NAMESPACE 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Json/EscapeSequence.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | class EscapeSequence { 12 | public: 13 | // Optimized for code size on a 8-bit AVR 14 | static char escapeChar(char c) { 15 | const char* p = escapeTable(true); 16 | while (p[0] && p[1] != c) { 17 | p += 2; 18 | } 19 | return p[0]; 20 | } 21 | 22 | // Optimized for code size on a 8-bit AVR 23 | static char unescapeChar(char c) { 24 | const char* p = escapeTable(false); 25 | for (;;) { 26 | if (p[0] == '\0') 27 | return 0; 28 | if (p[0] == c) 29 | return p[1]; 30 | p += 2; 31 | } 32 | } 33 | 34 | private: 35 | static const char* escapeTable(bool excludeSolidus) { 36 | return &"//\"\"\\\\b\bf\fn\nr\rt\t"[excludeSolidus ? 2 : 0]; 37 | } 38 | }; 39 | 40 | ARDUINOJSON_END_PRIVATE_NAMESPACE 41 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Misc/Visitable.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | struct Visitable { 12 | // template 13 | // void accept(Visitor&) const; 14 | }; 15 | 16 | template 17 | struct IsVisitable : is_base_of {}; 18 | 19 | template 20 | struct IsVisitable : IsVisitable {}; 21 | } // namespace ARDUINOJSON_NAMESPACE 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/MsgPack/ieee754.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | inline void doubleToFloat(const uint8_t d[8], uint8_t f[4]) { 12 | f[0] = uint8_t((d[0] & 0xC0) | (d[0] << 3 & 0x3f) | (d[1] >> 5)); 13 | f[1] = uint8_t((d[1] << 3) | (d[2] >> 5)); 14 | f[2] = uint8_t((d[2] << 3) | (d[3] >> 5)); 15 | f[3] = uint8_t((d[3] << 3) | (d[4] >> 5)); 16 | } 17 | 18 | ARDUINOJSON_END_PRIVATE_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Numbers/Float.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | #if ARDUINOJSON_USE_DOUBLE 13 | typedef double Float; 14 | #else 15 | typedef float Float; 16 | #endif 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Numbers/Integer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #include // int64_t 11 | 12 | namespace ARDUINOJSON_NAMESPACE { 13 | 14 | #if ARDUINOJSON_USE_LONG_LONG 15 | typedef int64_t Integer; 16 | typedef uint64_t UInt; 17 | #else 18 | typedef long Integer; 19 | typedef unsigned long UInt; 20 | #endif 21 | 22 | } // namespace ARDUINOJSON_NAMESPACE 23 | 24 | #if ARDUINOJSON_HAS_LONG_LONG && !ARDUINOJSON_USE_LONG_LONG 25 | # define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) \ 26 | static_assert(sizeof(T) <= sizeof(ARDUINOJSON_NAMESPACE::Integer), \ 27 | "To use 64-bit integers with ArduinoJson, you must set " \ 28 | "ARDUINOJSON_USE_LONG_LONG to 1. See " \ 29 | "https://arduinojson.org/v6/api/config/use_long_long/"); 30 | #else 31 | # define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) 32 | #endif 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Numbers/JsonFloat.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE 11 | 12 | #if ARDUINOJSON_USE_DOUBLE 13 | typedef double JsonFloat; 14 | #else 15 | typedef float JsonFloat; 16 | #endif 17 | 18 | ARDUINOJSON_END_PUBLIC_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Numbers/JsonInteger.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #include // int64_t 11 | 12 | ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE 13 | 14 | #if ARDUINOJSON_USE_LONG_LONG 15 | typedef int64_t JsonInteger; 16 | typedef uint64_t JsonUInt; 17 | #else 18 | typedef long JsonInteger; 19 | typedef unsigned long JsonUInt; 20 | #endif 21 | 22 | ARDUINOJSON_END_PUBLIC_NAMESPACE 23 | 24 | #define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) \ 25 | static_assert(sizeof(T) <= sizeof(ArduinoJson::JsonInteger), \ 26 | "To use 64-bit integers with ArduinoJson, you must set " \ 27 | "ARDUINOJSON_USE_LONG_LONG to 1. See " \ 28 | "https://arduinojson.org/v6/api/config/use_long_long/"); 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/alias_cast.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include // for size_t 9 | 10 | #include 11 | #include "math.hpp" 12 | 13 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 14 | 15 | template 16 | struct alias_cast_t { 17 | union { 18 | F raw; 19 | T data; 20 | }; 21 | }; 22 | 23 | template 24 | T alias_cast(F raw_data) { 25 | alias_cast_t ac; 26 | ac.raw = raw_data; 27 | return ac.data; 28 | } 29 | 30 | ARDUINOJSON_END_PRIVATE_NAMESPACE 31 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/assert.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #if ARDUINOJSON_DEBUG 10 | # include 11 | # define ARDUINOJSON_ASSERT(X) assert(X) 12 | #else 13 | # define ARDUINOJSON_ASSERT(X) ((void)0) 14 | #endif 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/attributes.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef _MSC_VER // Visual Studio 8 | 9 | # define FORCE_INLINE // __forceinline causes C4714 when returning std::string 10 | # define NO_INLINE __declspec(noinline) 11 | 12 | #elif defined(__GNUC__) // GCC or Clang 13 | 14 | # define FORCE_INLINE __attribute__((always_inline)) 15 | # define NO_INLINE __attribute__((noinline)) 16 | 17 | #else // Other compilers 18 | 19 | # define FORCE_INLINE 20 | # define NO_INLINE 21 | 22 | #endif 23 | 24 | #if defined(__has_attribute) 25 | # if __has_attribute(no_sanitize) 26 | # define ARDUINOJSON_NO_SANITIZE(check) __attribute__((no_sanitize(check))) 27 | # else 28 | # define ARDUINOJSON_NO_SANITIZE(check) 29 | # endif 30 | #else 31 | # define ARDUINOJSON_NO_SANITIZE(check) 32 | #endif 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/ctype.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | #ifndef isdigit 12 | inline bool isdigit(char c) { 13 | return '0' <= c && c <= '9'; 14 | } 15 | #endif 16 | 17 | inline bool issign(char c) { 18 | return '-' == c || c == '+'; 19 | } 20 | 21 | ARDUINOJSON_END_PRIVATE_NAMESPACE 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/integer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // int8_t, int16_t 8 | 9 | #include 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | template 14 | struct int_t; 15 | 16 | template <> 17 | struct int_t<8> { 18 | typedef int8_t type; 19 | }; 20 | 21 | template <> 22 | struct int_t<16> { 23 | typedef int16_t type; 24 | }; 25 | 26 | template <> 27 | struct int_t<32> { 28 | typedef int32_t type; 29 | }; 30 | 31 | ARDUINOJSON_END_PRIVATE_NAMESPACE 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/limits.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "type_traits.hpp" 8 | 9 | #ifdef _MSC_VER 10 | # pragma warning(push) 11 | # pragma warning(disable : 4310) 12 | #endif 13 | 14 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 15 | 16 | // Differs from standard because we can't use the symbols "min" and "max" 17 | template 18 | struct numeric_limits; 19 | 20 | template 21 | struct numeric_limits::value>::type> { 22 | static T lowest() { 23 | return 0; 24 | } 25 | static T highest() { 26 | return T(-1); 27 | } 28 | }; 29 | 30 | template 31 | struct numeric_limits< 32 | T, typename enable_if::value && is_signed::value>::type> { 33 | static T lowest() { 34 | return T(T(1) << (sizeof(T) * 8 - 1)); 35 | } 36 | static T highest() { 37 | return T(~lowest()); 38 | } 39 | }; 40 | 41 | ARDUINOJSON_END_PRIVATE_NAMESPACE 42 | 43 | #ifdef _MSC_VER 44 | # pragma warning(pop) 45 | #endif 46 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/math.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | // Some libraries #define isnan() and isinf() so we need to check before 12 | // using this name 13 | 14 | #ifndef isnan 15 | template 16 | bool isnan(T x) { 17 | return x != x; 18 | } 19 | #endif 20 | 21 | #ifndef isinf 22 | template 23 | bool isinf(T x) { 24 | return x != 0.0 && x * 2 == x; 25 | } 26 | #endif 27 | ARDUINOJSON_END_PRIVATE_NAMESPACE 28 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/mpl/max.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include // for size_t 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | // A meta-function that returns the highest value 14 | template Y)> 15 | struct Max {}; 16 | 17 | template 18 | struct Max { 19 | static const size_t value = X; 20 | }; 21 | 22 | template 23 | struct Max { 24 | static const size_t value = Y; 25 | }; 26 | 27 | ARDUINOJSON_END_PRIVATE_NAMESPACE 28 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/safe_strcmp.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include // int8_t 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | inline int safe_strcmp(const char* a, const char* b) { 14 | if (a == b) 15 | return 0; 16 | if (!a) 17 | return -1; 18 | if (!b) 19 | return 1; 20 | return strcmp(a, b); 21 | } 22 | 23 | inline int safe_strncmp(const char* a, const char* b, size_t n) { 24 | if (a == b) 25 | return 0; 26 | if (!a) 27 | return -1; 28 | if (!b) 29 | return 1; 30 | return strncmp(a, b, n); 31 | } 32 | } // namespace ARDUINOJSON_NAMESPACE 33 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/static_array.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2021 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #if ARDUINOJSON_ENABLE_PROGMEM 10 | 11 | # include 12 | 13 | # ifndef ARDUINOJSON_DEFINE_STATIC_ARRAY 14 | # define ARDUINOJSON_DEFINE_STATIC_ARRAY(type, name, value) \ 15 | static type const name[] PROGMEM = value; 16 | # endif 17 | 18 | # ifndef ARDUINOJSON_READ_STATIC_ARRAY 19 | # define ARDUINOJSON_READ_STATIC_ARRAY(type, name, index) \ 20 | pgm_read(name + index) 21 | # endif 22 | 23 | #else // i.e. ARDUINOJSON_ENABLE_PROGMEM == 0 24 | 25 | # ifndef ARDUINOJSON_DEFINE_STATIC_ARRAY 26 | # define ARDUINOJSON_DEFINE_STATIC_ARRAY(type, name, value) \ 27 | static type const name[] = value; 28 | # endif 29 | 30 | # ifndef ARDUINOJSON_READ_STATIC_ARRAY 31 | # define ARDUINOJSON_READ_STATIC_ARRAY(type, name, index) name[index] 32 | # endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "type_traits/conditional.hpp" 8 | #include "type_traits/enable_if.hpp" 9 | #include "type_traits/integral_constant.hpp" 10 | #include "type_traits/is_array.hpp" 11 | #include "type_traits/is_base_of.hpp" 12 | #include "type_traits/is_class.hpp" 13 | #include "type_traits/is_const.hpp" 14 | #include "type_traits/is_convertible.hpp" 15 | #include "type_traits/is_enum.hpp" 16 | #include "type_traits/is_floating_point.hpp" 17 | #include "type_traits/is_integral.hpp" 18 | #include "type_traits/is_pointer.hpp" 19 | #include "type_traits/is_same.hpp" 20 | #include "type_traits/is_signed.hpp" 21 | #include "type_traits/is_unsigned.hpp" 22 | #include "type_traits/make_unsigned.hpp" 23 | #include "type_traits/make_void.hpp" 24 | #include "type_traits/remove_const.hpp" 25 | #include "type_traits/remove_reference.hpp" 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/conditional.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct conditional { 13 | typedef TrueType type; 14 | }; 15 | 16 | template 17 | struct conditional { 18 | typedef FalseType type; 19 | }; 20 | 21 | ARDUINOJSON_END_PRIVATE_NAMESPACE 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/declval.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | T&& declval(); 13 | 14 | ARDUINOJSON_END_PRIVATE_NAMESPACE 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/enable_if.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | // A meta-function that return the type T if Condition is true. 12 | template 13 | struct enable_if {}; 14 | 15 | template 16 | struct enable_if { 17 | typedef T type; 18 | }; 19 | 20 | ARDUINOJSON_END_PRIVATE_NAMESPACE 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/integral_constant.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct integral_constant { 13 | static const T value = v; 14 | }; 15 | 16 | typedef integral_constant true_type; 17 | typedef integral_constant false_type; 18 | 19 | ARDUINOJSON_END_PRIVATE_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_array.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include // size_t 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | template 14 | struct is_array : false_type {}; 15 | 16 | template 17 | struct is_array : true_type {}; 18 | 19 | template 20 | struct is_array : true_type {}; 21 | 22 | ARDUINOJSON_END_PRIVATE_NAMESPACE 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_base_of.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include "remove_reference.hpp" 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | // A meta-function that returns true if Derived inherits from TBase is an 14 | // integral type. 15 | template 16 | class is_base_of { 17 | protected: // <- to avoid GCC's "all member functions in class are private" 18 | static int probe(const TBase*); 19 | static char probe(...); 20 | 21 | public: 22 | static const bool value = 23 | sizeof(probe(reinterpret_cast::type*>( 24 | 0))) == sizeof(int); 25 | }; 26 | 27 | ARDUINOJSON_END_PRIVATE_NAMESPACE 28 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_class.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "declval.hpp" 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct is_class { 13 | protected: // <- to avoid GCC's "all member functions in class are private" 14 | template 15 | static int probe(void (U::*)(void)); 16 | template 17 | static char probe(...); 18 | 19 | public: 20 | static const bool value = sizeof(probe(0)) == sizeof(int); 21 | }; 22 | 23 | ARDUINOJSON_END_PRIVATE_NAMESPACE 24 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_const.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | // A meta-function that return the type T without the const modifier 12 | template 13 | struct is_const : false_type {}; 14 | 15 | template 16 | struct is_const : true_type {}; 17 | 18 | ARDUINOJSON_END_PRIVATE_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_enum.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "is_class.hpp" 8 | #include "is_convertible.hpp" 9 | #include "is_floating_point.hpp" 10 | #include "is_integral.hpp" 11 | #include "is_same.hpp" 12 | 13 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 14 | 15 | template 16 | struct is_enum { 17 | static const bool value = is_convertible::value && 18 | !is_class::value && !is_integral::value && 19 | !is_floating_point::value; 20 | }; 21 | 22 | ARDUINOJSON_END_PRIVATE_NAMESPACE 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_floating_point.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | #include "is_same.hpp" 9 | #include "remove_cv.hpp" 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | template 14 | struct is_floating_point 15 | : integral_constant< 16 | bool, // 17 | is_same::type>::value || 18 | is_same::type>::value> {}; 19 | 20 | ARDUINOJSON_END_PRIVATE_NAMESPACE 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_pointer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct is_pointer : false_type {}; 13 | 14 | template 15 | struct is_pointer : true_type {}; 16 | 17 | ARDUINOJSON_END_PRIVATE_NAMESPACE 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_same.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | // A meta-function that returns true if types T and U are the same. 12 | template 13 | struct is_same : false_type {}; 14 | 15 | template 16 | struct is_same : true_type {}; 17 | 18 | ARDUINOJSON_END_PRIVATE_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | #include "is_same.hpp" 9 | #include "remove_cv.hpp" 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | // clang-format off 14 | template 15 | struct is_signed : integral_constant::type, char>::value || 17 | is_same::type, signed char>::value || 18 | is_same::type, signed short>::value || 19 | is_same::type, signed int>::value || 20 | is_same::type, signed long>::value || 21 | is_same::type, signed long long>::value || 22 | is_same::type, float>::value || 23 | is_same::type, double>::value> {}; 24 | // clang-format on 25 | 26 | ARDUINOJSON_END_PRIVATE_NAMESPACE 27 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | #include "is_same.hpp" 9 | #include "remove_cv.hpp" 10 | 11 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 12 | 13 | // clang-format off 14 | template 15 | struct is_unsigned : integral_constant::type, unsigned char>::value || 17 | is_same::type, unsigned short>::value || 18 | is_same::type, unsigned int>::value || 19 | is_same::type, unsigned long>::value || 20 | is_same::type, unsigned long long>::value || 21 | is_same::type, bool>::value> {}; 22 | // clang-format on 23 | 24 | ARDUINOJSON_END_PRIVATE_NAMESPACE 25 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/make_void.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 8 | 9 | template 10 | struct make_void { 11 | typedef void type; 12 | }; 13 | 14 | ARDUINOJSON_END_PRIVATE_NAMESPACE 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_const.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | // A meta-function that return the type T without the const modifier 12 | template 13 | struct remove_const { 14 | typedef T type; 15 | }; 16 | template 17 | struct remove_const { 18 | typedef T type; 19 | }; 20 | 21 | ARDUINOJSON_END_PRIVATE_NAMESPACE 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_cv.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct remove_cv { 13 | typedef T type; 14 | }; 15 | template 16 | struct remove_cv { 17 | typedef T type; 18 | }; 19 | template 20 | struct remove_cv { 21 | typedef T type; 22 | }; 23 | template 24 | struct remove_cv { 25 | typedef T type; 26 | }; 27 | 28 | ARDUINOJSON_END_PRIVATE_NAMESPACE 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_reference.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | // A meta-function that return the type T without the reference modifier. 12 | template 13 | struct remove_reference { 14 | typedef T type; 15 | }; 16 | template 17 | struct remove_reference { 18 | typedef T type; 19 | }; 20 | 21 | ARDUINOJSON_END_PRIVATE_NAMESPACE 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/type_identity.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | struct type_identity { 13 | typedef T type; 14 | }; 15 | 16 | ARDUINOJSON_END_PRIVATE_NAMESPACE 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "type_traits.hpp" 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | T&& forward(typename remove_reference::type& t) noexcept { 13 | return static_cast(t); 14 | } 15 | 16 | ARDUINOJSON_END_PRIVATE_NAMESPACE 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Serialization/CountingDecorator.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | class CountingDecorator { 13 | public: 14 | explicit CountingDecorator(TWriter& writer) : writer_(writer), count_(0) {} 15 | 16 | void write(uint8_t c) { 17 | count_ += writer_.write(c); 18 | } 19 | 20 | void write(const uint8_t* s, size_t n) { 21 | count_ += writer_.write(s, n); 22 | } 23 | 24 | size_t count() const { 25 | return count_; 26 | } 27 | 28 | private: 29 | TWriter writer_; 30 | size_t count_; 31 | }; 32 | 33 | ARDUINOJSON_END_PRIVATE_NAMESPACE 34 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/DummyWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | class DummyWriter { 12 | public: 13 | size_t write(uint8_t) { 14 | return 1; 15 | } 16 | 17 | size_t write(const uint8_t*, size_t n) { 18 | return n; 19 | } 20 | }; 21 | 22 | ARDUINOJSON_END_PRIVATE_NAMESPACE 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/PrintWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | class Writer< 13 | TDestination, 14 | typename enable_if::value>::type> { 15 | public: 16 | explicit Writer(::Print& print) : print_(&print) {} 17 | 18 | size_t write(uint8_t c) { 19 | return print_->write(c); 20 | } 21 | 22 | size_t write(const uint8_t* s, size_t n) { 23 | return print_->write(s, n); 24 | } 25 | 26 | private: 27 | ::Print* print_; 28 | }; 29 | 30 | ARDUINOJSON_END_PRIVATE_NAMESPACE 31 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/StaticStringWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | class StaticStringWriter { 12 | public: 13 | StaticStringWriter(char* buf, size_t size) : end(buf + size), p(buf) {} 14 | 15 | size_t write(uint8_t c) { 16 | if (p >= end) 17 | return 0; 18 | *p++ = static_cast(c); 19 | return 1; 20 | } 21 | 22 | size_t write(const uint8_t* s, size_t n) { 23 | char* begin = p; 24 | while (p < end && n > 0) { 25 | *p++ = static_cast(*s++); 26 | n--; 27 | } 28 | return size_t(p - begin); 29 | } 30 | 31 | private: 32 | char* end; 33 | char* p; 34 | }; 35 | 36 | ARDUINOJSON_END_PRIVATE_NAMESPACE 37 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Serialization/Writers/StdStreamWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 10 | 11 | template 12 | class Writer< 13 | TDestination, 14 | typename enable_if::value>::type> { 15 | public: 16 | explicit Writer(std::ostream& os) : os_(&os) {} 17 | 18 | size_t write(uint8_t c) { 19 | os_->put(static_cast(c)); 20 | return 1; 21 | } 22 | 23 | size_t write(const uint8_t* s, size_t n) { 24 | os_->write(reinterpret_cast(s), 25 | static_cast(n)); 26 | return n; 27 | } 28 | 29 | private: 30 | std::ostream* os_; 31 | }; 32 | 33 | ARDUINOJSON_END_PRIVATE_NAMESPACE 34 | -------------------------------------------------------------------------------- /lib/ArduinoJson/src/ArduinoJson/Serialization/measure.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - https://arduinojson.org 2 | // Copyright © 2014-2023, Benoit BLANCHON 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE 11 | 12 | template