├── LICENSE ├── LoRaWANGateway ├── LoRaWANGateway.cpp ├── LoRaWANGateway.h ├── LoRaWANGateway.ino └── index.html.h ├── README.md └── libraries ├── AES-master ├── AES.cpp ├── AES.h ├── AES_config.h ├── CODE_OF_CONDUCT.md ├── Doxyfile ├── LICENSE.txt ├── Makefile ├── README.MD ├── examples │ ├── aes │ │ └── aes.pde │ └── test_vectors │ │ ├── RESOURCES │ │ ├── known_answers.txt │ │ └── test_vectors.pde ├── examples_Rpi │ ├── Makefile │ ├── RESOURCES │ ├── aes.cpp │ ├── known_answers.txt │ └── test_vectors.cpp ├── keywords.txt └── printf.h ├── AESM ├── AESM.cpp └── AESM.h ├── ArduinoJson ├── ArduinoJson.h ├── CHANGELOG.md ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── SUPPORT.md ├── appveyor.yml ├── banner.svg ├── examples │ ├── JsonConfigFile │ │ └── JsonConfigFile.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 ├── fuzzing │ ├── CMakeLists.txt │ ├── Makefile │ ├── fuzzer_main.cpp │ ├── 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_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 ├── keywords.txt ├── library.json ├── library.properties ├── scripts │ ├── build-arduino-package.sh │ ├── build-single-header.sh │ ├── create-build-envs.sh │ ├── oss-fuzz │ │ └── Vagrantfile │ ├── publish-particle-library.sh │ ├── publish.sh │ ├── travis │ │ ├── arduino.sh │ │ ├── build.sh │ │ ├── coverage.sh │ │ ├── fuzz.sh │ │ ├── platformio.sh │ │ └── test.sh │ └── wandbox │ │ ├── JsonGeneratorExample.cpp │ │ ├── JsonParserExample.cpp │ │ ├── MsgPackParserExample.cpp │ │ └── publish.sh ├── src │ ├── ArduinoJson.h │ ├── ArduinoJson.hpp │ └── ArduinoJson │ │ ├── Array │ │ ├── ArrayFunctions.hpp │ │ ├── ArrayImpl.hpp │ │ ├── ArrayIterator.hpp │ │ ├── ArrayRef.hpp │ │ ├── ArrayShortcuts.hpp │ │ ├── ElementProxy.hpp │ │ └── Utilities.hpp │ │ ├── Collection │ │ ├── CollectionData.hpp │ │ └── CollectionImpl.hpp │ │ ├── Configuration.hpp │ │ ├── Deserialization │ │ ├── ArduinoStreamReader.hpp │ │ ├── CharPointerReader.hpp │ │ ├── DeserializationError.hpp │ │ ├── FlashStringReader.hpp │ │ ├── IteratorReader.hpp │ │ ├── NestingLimit.hpp │ │ ├── StdStreamReader.hpp │ │ └── deserialize.hpp │ │ ├── Document │ │ ├── BasicJsonDocument.hpp │ │ ├── DynamicJsonDocument.hpp │ │ ├── JsonDocument.hpp │ │ └── StaticJsonDocument.hpp │ │ ├── Json │ │ ├── EscapeSequence.hpp │ │ ├── JsonDeserializer.hpp │ │ ├── JsonSerializer.hpp │ │ ├── PrettyJsonSerializer.hpp │ │ ├── TextFormatter.hpp │ │ └── Utf8.hpp │ │ ├── Memory │ │ ├── Alignment.hpp │ │ ├── MemoryPool.hpp │ │ ├── StringBuilder.hpp │ │ └── StringSlot.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 │ │ ├── convertNumber.hpp │ │ ├── parseFloat.hpp │ │ ├── parseInteger.hpp │ │ └── parseNumber.hpp │ │ ├── Object │ │ ├── MemberProxy.hpp │ │ ├── ObjectFunctions.hpp │ │ ├── ObjectImpl.hpp │ │ ├── ObjectIterator.hpp │ │ ├── ObjectRef.hpp │ │ ├── ObjectShortcuts.hpp │ │ └── Pair.hpp │ │ ├── Operators │ │ ├── VariantCasts.hpp │ │ ├── VariantComparisons.hpp │ │ ├── VariantOperators.hpp │ │ ├── VariantOr.hpp │ │ └── VariantShortcuts.hpp │ │ ├── Polyfills │ │ ├── alias_cast.hpp │ │ ├── assert.hpp │ │ ├── attributes.hpp │ │ ├── ctype.hpp │ │ ├── gsl │ │ │ └── not_null.hpp │ │ ├── limits.hpp │ │ ├── math.hpp │ │ ├── mpl │ │ │ └── max.hpp │ │ ├── safe_strcmp.hpp │ │ ├── type_traits.hpp │ │ ├── type_traits │ │ │ ├── conditional.hpp │ │ │ ├── enable_if.hpp │ │ │ ├── integral_constant.hpp │ │ │ ├── is_array.hpp │ │ │ ├── is_base_of.hpp │ │ │ ├── is_const.hpp │ │ │ ├── is_floating_point.hpp │ │ │ ├── is_integral.hpp │ │ │ ├── is_same.hpp │ │ │ ├── is_signed.hpp │ │ │ ├── is_unsigned.hpp │ │ │ ├── make_unsigned.hpp │ │ │ ├── remove_const.hpp │ │ │ ├── remove_reference.hpp │ │ │ └── type_identity.hpp │ │ └── utility.hpp │ │ ├── Serialization │ │ ├── DummyWriter.hpp │ │ ├── DynamicStringWriter.hpp │ │ ├── StaticStringWriter.hpp │ │ ├── StreamWriter.hpp │ │ ├── measure.hpp │ │ └── serialize.hpp │ │ ├── StringStorage │ │ ├── StringCopier.hpp │ │ ├── StringMover.hpp │ │ └── StringStorage.hpp │ │ ├── Strings │ │ ├── ArduinoStringAdapter.hpp │ │ ├── ConstRamStringAdapter.hpp │ │ ├── FlashStringAdapter.hpp │ │ ├── RamStringAdapter.hpp │ │ ├── SizedFlashStringAdapter.hpp │ │ ├── SizedRamStringAdapter.hpp │ │ ├── StlStringAdapter.hpp │ │ ├── String.hpp │ │ └── StringAdapters.hpp │ │ ├── Variant │ │ ├── SlotFunctions.hpp │ │ ├── VariantAs.hpp │ │ ├── VariantAsImpl.hpp │ │ ├── VariantContent.hpp │ │ ├── VariantData.hpp │ │ ├── VariantFunctions.hpp │ │ ├── VariantImpl.hpp │ │ ├── VariantRef.hpp │ │ ├── VariantSlot.hpp │ │ └── VariantTo.hpp │ │ ├── compatibility.hpp │ │ └── version.hpp ├── test │ ├── CMakeLists.txt │ ├── ElementProxy │ │ ├── CMakeLists.txt │ │ ├── add.cpp │ │ ├── clear.cpp │ │ ├── remove.cpp │ │ ├── set.cpp │ │ └── size.cpp │ ├── IntegrationTests │ │ ├── CMakeLists.txt │ │ ├── gbathree.cpp │ │ ├── issue772.cpp │ │ └── round_trip.cpp │ ├── JsonArray │ │ ├── CMakeLists.txt │ │ ├── add.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 │ │ └── undefined.cpp │ ├── JsonDeserializer │ │ ├── CMakeLists.txt │ │ ├── DeserializationError.cpp │ │ ├── array.cpp │ │ ├── array_static.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 │ │ ├── StaticJsonDocument.cpp │ │ ├── add.cpp │ │ ├── containsKey.cpp │ │ ├── createNested.cpp │ │ ├── isNull.cpp │ │ ├── nesting.cpp │ │ ├── remove.cpp │ │ ├── size.cpp │ │ └── subscript.cpp │ ├── JsonObject │ │ ├── CMakeLists.txt │ │ ├── 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 │ │ ├── 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 │ │ ├── copy.cpp │ │ ├── createNested.cpp │ │ ├── is.cpp │ │ ├── isnull.cpp │ │ ├── memoryUsage.cpp │ │ ├── misc.cpp │ │ ├── nesting.cpp │ │ ├── or.cpp │ │ ├── overflow.cpp │ │ ├── remove.cpp │ │ ├── set.cpp │ │ ├── subscript.cpp │ │ ├── types.cpp │ │ └── undefined.cpp │ ├── MemberProxy │ │ ├── CMakeLists.txt │ │ ├── add.cpp │ │ ├── clear.cpp │ │ ├── containsKey.cpp │ │ ├── remove.cpp │ │ ├── set.cpp │ │ ├── size.cpp │ │ └── subscript.cpp │ ├── MemoryPool │ │ ├── CMakeLists.txt │ │ ├── StringBuilder.cpp │ │ ├── allocString.cpp │ │ ├── allocVariant.cpp │ │ ├── clear.cpp │ │ └── size.cpp │ ├── Misc │ │ ├── CMakeLists.txt │ │ ├── FloatParts.cpp │ │ ├── Issue978.cpp │ │ ├── StreamReader.cpp │ │ ├── StringAdapters.cpp │ │ ├── StringWriter.cpp │ │ ├── TypeTraits.cpp │ │ ├── conflicts.cpp │ │ ├── unsigned_char.cpp │ │ └── version.cpp │ ├── MixedConfiguration │ │ ├── CMakeLists.txt │ │ ├── cpp11.cpp │ │ ├── decode_unicode_0.cpp │ │ ├── decode_unicode_1.cpp │ │ ├── enable_infinity_0.cpp │ │ ├── enable_infinity_1.cpp │ │ ├── enable_nan_0.cpp │ │ ├── enable_nan_1.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 │ │ ├── incompleteInput.cpp │ │ ├── input_types.cpp │ │ ├── nestingLimit.cpp │ │ └── notSupported.cpp │ ├── MsgPackSerializer │ │ ├── CMakeLists.txt │ │ ├── destination_types.cpp │ │ ├── measure.cpp │ │ ├── misc.cpp │ │ ├── serializeArray.cpp │ │ ├── serializeObject.cpp │ │ └── serializeVariant.cpp │ ├── Numbers │ │ ├── CMakeLists.txt │ │ ├── parseFloat.cpp │ │ ├── parseInteger.cpp │ │ └── parseNumber.cpp │ └── TextFormatter │ │ ├── CMakeLists.txt │ │ ├── writeFloat.cpp │ │ └── writeString.cpp └── third-party │ └── catch │ ├── CMakeLists.txt │ ├── catch.cpp │ └── catch.hpp ├── Base64 ├── Base64M.cpp └── Base64M.h ├── DataStructure ├── DS.h └── KeyValueMap.h ├── Node ├── NetworkNode.cpp ├── NetworkNode.h ├── Node.cpp └── Node.h ├── RFM ├── RFM.cpp └── RFM.h ├── System ├── ESPS.cpp ├── NTP.cpp ├── System.cpp └── System.h ├── SystemClock ├── SystemClock.cpp └── SystemClock.h ├── WAN ├── Message.cpp ├── Scheduled.cpp ├── WAN.cpp └── WAN.h ├── WIFI ├── AP.cpp ├── Client.cpp ├── WIFI.cpp └── WIFI.h ├── arduino-LoRa-master ├── API.md ├── LICENSE ├── README.md ├── examples │ ├── LoRaDumpRegisters │ │ └── LoRaDumpRegisters.ino │ ├── LoRaDuplex │ │ └── LoRaDuplex.ino │ ├── LoRaDuplexCallback │ │ └── LoRaDuplexCallback.ino │ ├── LoRaReceiver │ │ └── LoRaReceiver.ino │ ├── LoRaReceiverCallback │ │ └── LoRaReceiverCallback.ino │ ├── LoRaSender │ │ └── LoRaSender.ino │ ├── LoRaSenderNonBlocking │ │ └── LoRaSenderNonBlocking.ino │ ├── LoRaSetSpread │ │ └── LoRaSetSpread.ino │ ├── LoRaSetSyncWord │ │ └── LoRaSetSyncWord.ino │ ├── LoRaSimpleGateway │ │ └── LoRaSimpleGateway.ino │ └── LoRaSimpleNode │ │ └── LoRaSimpleNode.ino ├── issue_template.md ├── keywords.txt ├── library.properties └── src │ ├── LoRa.cpp │ └── LoRa.h └── arduinoWebSockets-master ├── LICENSE ├── README.md ├── examples ├── Nginx │ └── esp8266.ssl.reverse.proxy.conf ├── avr │ └── WebSocketClientAVR │ │ └── WebSocketClientAVR.ino ├── esp32 │ ├── WebSocketClient │ │ └── WebSocketClient.ino │ ├── WebSocketClientSSL │ │ └── WebSocketClientSSL.ino │ ├── WebSocketClientSocketIOack │ │ └── WebSocketClientSocketIOack.ino │ └── WebSocketServer │ │ └── WebSocketServer.ino ├── esp8266 │ ├── WebSocketClient │ │ └── WebSocketClient.ino │ ├── WebSocketClientSSL │ │ └── WebSocketClientSSL.ino │ ├── WebSocketClientSSLWithCA │ │ └── WebSocketClientSSLWithCA.ino │ ├── WebSocketClientSocketIO │ │ └── WebSocketClientSocketIO.ino │ ├── WebSocketClientSocketIOack │ │ └── WebSocketClientSocketIOack.ino │ ├── WebSocketClientStomp │ │ └── WebSocketClientStomp.ino │ ├── WebSocketClientStompOverSockJs │ │ └── WebSocketClientStompOverSockJs.ino │ ├── WebSocketServer │ │ └── WebSocketServer.ino │ ├── WebSocketServerAllFunctionsDemo │ │ └── WebSocketServerAllFunctionsDemo.ino │ ├── WebSocketServerFragmentation │ │ └── WebSocketServerFragmentation.ino │ ├── WebSocketServerHooked │ │ ├── WebSocketServerHooked.ino │ │ ├── emu │ │ └── ws-testclient.py │ ├── WebSocketServerHttpHeaderValidation │ │ └── WebSocketServerHttpHeaderValidation.ino │ └── WebSocketServer_LEDcontrol │ │ └── WebSocketServer_LEDcontrol.ino └── particle │ └── ParticleWebSocketClient │ └── application.cpp ├── library.properties ├── src ├── SocketIOclient.cpp ├── SocketIOclient.h ├── WebSockets.cpp ├── WebSockets.h ├── WebSockets4WebServer.h ├── WebSocketsClient.cpp ├── WebSocketsClient.h ├── WebSocketsServer.cpp ├── WebSocketsServer.h ├── WebSocketsVersion.h ├── libb64 │ ├── AUTHORS │ ├── LICENSE │ ├── cdecode.c │ ├── cdecode_inc.h │ ├── cencode.c │ └── cencode_inc.h └── libsha1 │ ├── libsha1.c │ └── libsha1.h ├── tests ├── webSocket.html └── webSocketServer │ ├── index.js │ └── package.json └── travis ├── common.sh └── version.py /LoRaWANGateway/LoRaWANGateway.h: -------------------------------------------------------------------------------- 1 | #ifndef __LoRaWANGateway__ 2 | #define __LoRaWANGateway__ 3 | 4 | #define ARDUINOJSON_USE_DOUBLE 1 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "index.html.h" 14 | 15 | class LoRaWANGateway : public NetworkNode { 16 | public: 17 | WIFI* wifi = NULL; 18 | System* system = NULL; 19 | WAN* wan = NULL; 20 | RFM* rfm = NULL; 21 | 22 | LoRaWANGateway(); 23 | virtual ~LoRaWANGateway(); 24 | void loop(); 25 | void setup(); 26 | virtual void html(); 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /LoRaWANGateway/LoRaWANGateway.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Pulsartronic 3 | * An Open Source project is a forever Work In Progress, feel free to contribute 4 | * 5 | */ 6 | 7 | #include "LoRaWANGateway.h" 8 | LoRaWANGateway* loRaWANGateway = NULL; 9 | 10 | void setup() { 11 | loRaWANGateway = new LoRaWANGateway(); 12 | loRaWANGateway->setup(); 13 | } 14 | 15 | void loop() { 16 | loRaWANGateway->loop(); 17 | } 18 | -------------------------------------------------------------------------------- /libraries/AES-master/AES_config.h: -------------------------------------------------------------------------------- 1 | /* code was modified by george spanos 2 | * 16/12/14 3 | */ 4 | 5 | #ifndef __AES_CONFIG_H__ 6 | #define __AES_CONFIG_H__ 7 | 8 | #if (defined(__linux) || defined(linux)) && !(defined(__ARDUINO_X86__) || defined(__arm__)) 9 | 10 | #define AES_LINUX 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | #include 23 | #include 24 | 25 | #if defined(__ARDUINO_X86__) || defined(__arm__) || (defined (__linux) || defined (linux)) 26 | #undef PROGMEM 27 | #define PROGMEM __attribute__(( section(".progmem.data") )) 28 | #define pgm_read_byte(p) (*(p)) 29 | typedef unsigned char byte; 30 | #define printf_P printf 31 | #ifndef PSTR 32 | #define PSTR(x) (x) 33 | #endif 34 | #elif defined ( ESP8266 ) 35 | #include 36 | #ifndef PSTR 37 | #define PSTR(x) (x) 38 | #endif 39 | #else 40 | #if (defined(__AVR__)) 41 | #include 42 | #else 43 | #include 44 | #endif 45 | #endif 46 | 47 | #define N_ROW 4 48 | #define N_COL 4 49 | #define N_BLOCK (N_ROW * N_COL) 50 | #define N_MAX_ROUNDS 14 51 | #define KEY_SCHEDULE_BYTES ((N_MAX_ROUNDS + 1) * N_BLOCK) 52 | #define SUCCESS (0) 53 | #define FAILURE (-1) 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /libraries/AES-master/examples/test_vectors/RESOURCES: -------------------------------------------------------------------------------- 1 | Monte Carlo test vectors: 2 | http://csrc.nist.gov/groups/STM/cavp/documents/aes/aesmct.zip 3 | 4 | (Compare the Monte Carlo output to the ECBMCT128.rsp file) 5 | 6 | Known Answer Tests: 7 | http://csrc.nist.gov/groups/STM/cavp/documents/aes/KAT_AES.zip 8 | 9 | - Compare the other test outputs to 10 | ECBVarTxt128.rsp 11 | ECBVarKey128.rsp 12 | ECBVarTxt192.rsp 13 | ECBVarKey192.rsp 14 | ECBVarTxt256.rsp 15 | ECBVarKey256.rsp 16 | 17 | -------------------------------------------------------------------------------- /libraries/AES-master/examples_Rpi/Makefile: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # 3 | # Makefile for AES examples on Raspberry Pi 4 | # 5 | # License: GPL (General Public License) 6 | # Author: gnulnulf 7 | # Date: 2013/02/07 (version 1.0) 8 | # 9 | # Description: 10 | # ------------ 11 | # use make all and make install to install the examples 12 | # You can change the install directory by editing the prefix line 13 | # 14 | prefix := /usr/local 15 | 16 | # The recommended compiler flags for the Raspberry Pi 17 | CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s 18 | #CCFLAGS= 19 | 20 | # define all programs 21 | PROGRAMS = aes test_vectors 22 | SOURCES = ${PROGRAMS:=.cpp} 23 | 24 | all: ${PROGRAMS} 25 | 26 | ${PROGRAMS}: ${SOURCES} 27 | g++ ${CCFLAGS} -Wall -I../ -lAES $@.cpp -o $@ 28 | 29 | clean: 30 | rm -rf $(PROGRAMS) 31 | 32 | install: all 33 | test -d $(prefix) || mkdir $(prefix) 34 | test -d $(prefix)/bin || mkdir $(prefix)/bin 35 | for prog in $(PROGRAMS); do \ 36 | install -m 0755 $$prog $(prefix)/bin; \ 37 | done 38 | 39 | .PHONY: install 40 | -------------------------------------------------------------------------------- /libraries/AES-master/examples_Rpi/RESOURCES: -------------------------------------------------------------------------------- 1 | Monte Carlo test vectors: 2 | http://csrc.nist.gov/groups/STM/cavp/documents/aes/aesmct.zip 3 | 4 | (Compare the Monte Carlo output to the ECBMCT128.rsp file) 5 | 6 | Known Answer Tests: 7 | http://csrc.nist.gov/groups/STM/cavp/documents/aes/KAT_AES.zip 8 | 9 | - Compare the other test outputs to 10 | ECBVarTxt128.rsp 11 | ECBVarKey128.rsp 12 | ECBVarTxt192.rsp 13 | ECBVarKey192.rsp 14 | ECBVarTxt256.rsp 15 | ECBVarKey256.rsp 16 | 17 | -------------------------------------------------------------------------------- /libraries/AES-master/examples_Rpi/aes.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "printf.h" 3 | 4 | AES aes; 5 | 6 | void prekey_test (); 7 | void prekey (int bits, int blocks); 8 | 9 | byte key[] = "01234567899876543210012345678998"; 10 | 11 | byte plain[] = "TESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTEST"; 12 | int plainLength = sizeof(plain)-1; // don't count the trailing /0 of the string ! 13 | int padedLength = plainLength + N_BLOCK - plainLength % N_BLOCK; 14 | 15 | //real iv = iv x2 ex: 01234567 = 0123456701234567 16 | unsigned long long int my_iv = 01234567; 17 | 18 | int main(int argc, char** argv) 19 | { 20 | printf("\n===testing mode\n") ; 21 | 22 | for (int i=0;i<1;i++){ 23 | prekey_test () ; 24 | } 25 | } 26 | 27 | void prekey (int bits) 28 | { 29 | byte iv [N_BLOCK] ; 30 | byte plain_p[padedLength]; 31 | byte cipher[padedLength]; 32 | aes.do_aes_encrypt(plain,plainLength,cipher,key,bits); 33 | aes.get_IV(iv); 34 | aes.do_aes_decrypt(cipher,aes.get_size(),plain_p,key,bits,iv); 35 | //normally u have sizeof(cipher) but if its in the same sketch you cannot determin it dynamically 36 | 37 | printf("\n\nPLAIN :"); 38 | aes.printArray(plain); 39 | printf("\nCIPHER:"); 40 | aes.printArray(cipher); 41 | printf("\nPlain2:"); 42 | aes.printArray(plain_p); 43 | printf("\n============================================================\n"); 44 | } 45 | 46 | void prekey_test () 47 | { 48 | prekey (128) ; 49 | } 50 | -------------------------------------------------------------------------------- /libraries/AES-master/keywords.txt: -------------------------------------------------------------------------------- 1 | AES KEYWORD1 2 | set_key KEYWORD2 3 | clean KEYWORD2 4 | encrypt KEYWORD2 5 | decrypt KEYWORD2 6 | cbc_encrypt KEYWORD2 7 | cbc_decrypt KEYWORD2 8 | -------------------------------------------------------------------------------- /libraries/AES-master/printf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 J. Coliz 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | version 2 as published by the Free Software Foundation. 7 | */ 8 | /* Galileo support from spaniakos */ 9 | 10 | /** 11 | * @file printf.h 12 | * 13 | * Setup necessary to direct stdout to the Arduino Serial library, which 14 | * enables 'printf' 15 | */ 16 | 17 | #ifndef __PRINTF_H__ 18 | #define __PRINTF_H__ 19 | 20 | #if defined (ARDUINO) && !defined (__arm__) && !defined(__ARDUINO_X86__) 21 | 22 | int serial_putc( char c, FILE * ) 23 | { 24 | Serial.write( c ); 25 | 26 | return c; 27 | } 28 | 29 | void printf_begin(void) 30 | { 31 | fdevopen( &serial_putc, 0 ); 32 | } 33 | 34 | #elif defined (__arm__) 35 | 36 | void printf_begin(void){} 37 | 38 | #elif defined(__ARDUINO_X86__) 39 | int serial_putc( char c, FILE * ) 40 | { 41 | Serial.write( c ); 42 | 43 | return c; 44 | } 45 | 46 | void printf_begin(void) 47 | { 48 | //JESUS - For reddirect stdout to /dev/ttyGS0 (Serial Monitor port) 49 | stdout = freopen("/dev/ttyGS0","w",stdout); 50 | delay(500); 51 | printf("redirecting to Serial..."); 52 | 53 | //JESUS ----------------------------------------------------------- 54 | } 55 | #else 56 | #error This example is only for use on Arduino. 57 | #endif // ARDUINO 58 | 59 | #endif // __PRINTF_H__ 60 | -------------------------------------------------------------------------------- /libraries/AESM/AESM.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifndef __AESM__ 5 | #define __AESM__ 6 | 7 | // CBC implementation 8 | class AESM { 9 | public: 10 | AES aes; 11 | byte key[32]; 12 | 13 | AESM(byte* key); 14 | static uint16_t calculateCipherLength(int plainLength); 15 | static uint16_t calculatePlainLength(int cipherLength); 16 | static void getRidOfPadding(byte* plain, uint16_t plainLength); 17 | void encrypt(byte* plain, unsigned int plainLength, byte* cipher, unsigned int cipherLength); 18 | void decrypt(byte* plain, byte* cipher, unsigned int cipherLength); 19 | String encrypt(byte* plain, int plainLength); 20 | String decrypt(byte* base64); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #include "src/ArduinoJson.h" 6 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - arduinojson.org 2 | # Copyright Benoit Blanchon 2014-2019 3 | # MIT License 4 | 5 | cmake_minimum_required(VERSION 3.0) 6 | project(ArduinoJson) 7 | 8 | enable_testing() 9 | 10 | add_definitions(-DARDUINOJSON_DEBUG) 11 | if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") 12 | add_compile_options(-g -O0) 13 | endif() 14 | 15 | if(${COVERAGE}) 16 | set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage") 17 | endif() 18 | 19 | include_directories(${CMAKE_CURRENT_LIST_DIR}/src) 20 | add_subdirectory(third-party/catch) 21 | add_subdirectory(test) 22 | add_subdirectory(fuzzing) 23 | -------------------------------------------------------------------------------- /libraries/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. Unit test every change in behavior 10 | 2. Use clang-format in "file" mode to format the code 11 | 3. Consider using the Continuous Integration (Travis and AppVeyor) 12 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | --------------------- 3 | 4 | Copyright © 2014-2019 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 | -------------------------------------------------------------------------------- /libraries/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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 6.11.0.{build} 2 | environment: 3 | matrix: 4 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 5 | CMAKE_GENERATOR: Visual Studio 15 2017 6 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 7 | CMAKE_GENERATOR: Visual Studio 14 2015 8 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 9 | CMAKE_GENERATOR: Visual Studio 12 2013 10 | - CMAKE_GENERATOR: Visual Studio 11 2012 11 | - CMAKE_GENERATOR: Visual Studio 10 2010 12 | - CMAKE_GENERATOR: MinGW Makefiles 13 | configuration: Debug 14 | before_build: 15 | - set PATH=C:\MinGW\bin;%PATH:C:\Program Files\Git\usr\bin;=% # Workaround for CMake not wanting sh.exe on PATH for MinGW 16 | - cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%CMAKE_GENERATOR%" . 17 | build_script: 18 | - cmake --build . --config %CONFIGURATION% 19 | test_script: 20 | - ctest -C %CONFIGURATION% --output-on-failure . 21 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - arduinojson.org 2 | # Copyright Benoit Blanchon 2014-2019 3 | # MIT License 4 | 5 | if(MSVC) 6 | add_compile_options(-D_CRT_SECURE_NO_WARNINGS) 7 | endif() 8 | 9 | add_executable(msgpack_fuzzer 10 | msgpack_fuzzer.cpp 11 | fuzzer_main.cpp 12 | ) 13 | 14 | add_executable(json_fuzzer 15 | json_fuzzer.cpp 16 | fuzzer_main.cpp 17 | ) 18 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/Makefile: -------------------------------------------------------------------------------- 1 | # CAUTION: this file is invoked by https://github.com/google/oss-fuzz 2 | 3 | CXXFLAGS += -I../src -DARDUINOJSON_DEBUG 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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/fuzzer_main.cpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | // This file is NOT use by Google's OSS fuzz 6 | // I only use it to reproduce the bugs found 7 | 8 | #include // size_t 9 | #include // fopen et al. 10 | #include // exit 11 | #include 12 | #include 13 | 14 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); 15 | 16 | std::vector read(const char* path) { 17 | FILE* f = fopen(path, "rb"); 18 | if (!f) { 19 | std::cerr << "Failed to open " << path << std::endl; 20 | exit(1); 21 | } 22 | 23 | fseek(f, 0, SEEK_END); 24 | size_t size = ftell(f); 25 | fseek(f, 0, SEEK_SET); 26 | 27 | std::vector buffer(size); 28 | if (fread(buffer.data(), 1, size, f) != size) { 29 | fclose(f); 30 | std::cerr << "Failed to read " << path << std::endl; 31 | exit(1); 32 | } 33 | 34 | fclose(f); 35 | return buffer; 36 | } 37 | 38 | int main(int argc, const char* argv[]) { 39 | if (argc < 2) { 40 | std::cerr << "Usage: msgpack_fuzzer files" << std::endl; 41 | return 1; 42 | } 43 | 44 | for (int i = 1; i < argc; i++) { 45 | std::cout << "Loading " << argv[i] << std::endl; 46 | std::vector buffer = read(argv[i]); 47 | LLVMFuzzerTestOneInput(buffer.data(), buffer.size()); 48 | } 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/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 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/json_seed_corpus/EmptyArray.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/json_seed_corpus/EmptyObject.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /libraries/ArduinoJson/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]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/json_seed_corpus/IntegerOverflow.json: -------------------------------------------------------------------------------- 1 | 9720730739393920739 2 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/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 | ] -------------------------------------------------------------------------------- /libraries/ArduinoJson/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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/json_seed_corpus/Strings.json: -------------------------------------------------------------------------------- 1 | [ 2 | "hello", 3 | 'hello', 4 | hello, 5 | {"hello":"world"}, 6 | {'hello':'world'}, 7 | {hello:world} 8 | ] -------------------------------------------------------------------------------- /libraries/ArduinoJson/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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/array16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/array16 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/array32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/array32 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/false: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixarray -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixint_negative: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixint_positive: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixmap -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixstr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/fixstr -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/float32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/float32 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/float64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/float64 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int16 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int32 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int64 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/int8 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/map16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/map16 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/map32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/map32 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/nil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/nil -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/str16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/str16 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/str32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/str32 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/str8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/str8 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/true: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint16 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint32 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint64 -------------------------------------------------------------------------------- /libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulsartronic/LoRaWANGatewaySC/8de03563f8c900e50d3b4f64a62e9c1359f093f8/libraries/ArduinoJson/fuzzing/msgpack_seed_corpus/uint8 -------------------------------------------------------------------------------- /libraries/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 | 14 | # Methods 15 | add KEYWORD2 16 | as KEYWORD2 17 | createNestedArray KEYWORD2 18 | createNestedObject KEYWORD2 19 | get KEYWORD2 20 | set KEYWORD2 21 | to KEYWORD2 22 | 23 | # Type names 24 | DeserializationError KEYWORD1 DATA_TYPE 25 | DynamicJsonDocument KEYWORD1 DATA_TYPE 26 | JsonArray KEYWORD1 DATA_TYPE 27 | JsonArrayConst KEYWORD1 DATA_TYPE 28 | JsonFloat KEYWORD1 DATA_TYPE 29 | JsonInteger KEYWORD1 DATA_TYPE 30 | JsonObject KEYWORD1 DATA_TYPE 31 | JsonObjectConst KEYWORD1 DATA_TYPE 32 | JsonString KEYWORD1 DATA_TYPE 33 | JsonUInt KEYWORD1 DATA_TYPE 34 | JsonVariant KEYWORD1 DATA_TYPE 35 | JsonVariantConst KEYWORD1 DATA_TYPE 36 | StaticJsonDocument KEYWORD1 DATA_TYPE 37 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ArduinoJson", 3 | "keywords": "json, rest, http, web", 4 | "description": "An elegant and efficient JSON library for embedded systems", 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.11.0", 11 | "authors": { 12 | "name": "Benoit Blanchon", 13 | "url": "https://blog.benoitblanchon.fr" 14 | }, 15 | "exclude": [ 16 | "fuzzing", 17 | "scripts", 18 | "test", 19 | "third-party" 20 | ], 21 | "frameworks": "arduino", 22 | "platforms": "*" 23 | } 24 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/library.properties: -------------------------------------------------------------------------------- 1 | name=ArduinoJson 2 | version=6.11.0 3 | author=Benoit Blanchon 4 | maintainer=Benoit Blanchon 5 | sentence=An efficient and elegant JSON library for Arduino. 6 | paragraph=ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, 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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/build-arduino-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TAG=$(git describe) 4 | OUTPUT="ArduinoJson-$TAG.zip" 5 | 6 | cd $(dirname $0)/../.. 7 | 8 | # remove existing file 9 | rm -f $OUTPUT 10 | 11 | # create zip 12 | 7z a $OUTPUT \ 13 | ArduinoJson/CHANGELOG.md \ 14 | ArduinoJson/examples \ 15 | ArduinoJson/src \ 16 | ArduinoJson/keywords.txt \ 17 | ArduinoJson/library.properties \ 18 | ArduinoJson/LICENSE.md \ 19 | ArduinoJson/README.md \ 20 | ArduinoJson/ArduinoJson.h 21 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/build-single-header.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TAG=$(git describe) 4 | RE_INCLUDE='^#include[[:space:]]*["<](.*)[">]' 5 | RE_EMPTY='^(#pragma[[:space:]]+once)?[[:space:]]*(//.*)?$' 6 | 7 | declare -A INCLUDED 8 | 9 | process() 10 | { 11 | local PARENT=$1 12 | local FOLDER=$(dirname $1) 13 | local SHOW_COMMENT=$2 14 | while IFS= read -r LINE; do 15 | if [[ $LINE =~ $RE_INCLUDE ]]; then 16 | local CHILD=${BASH_REMATCH[1]} 17 | pushd "$FOLDER" > /dev/null 18 | if [[ -e $CHILD ]]; then 19 | local CHILD_PATH=$(realpath $CHILD) 20 | if [[ ! ${INCLUDED[$CHILD_PATH]} ]]; then 21 | #echo "// $PARENT -> $CHILD" 22 | INCLUDED[$CHILD_PATH]=true 23 | process "$CHILD" false 24 | fi 25 | else 26 | if [[ ! ${INCLUDED[$CHILD]} ]]; then 27 | echo "$LINE" 28 | INCLUDED[$CHILD]=true 29 | fi 30 | fi 31 | popd > /dev/null 32 | elif [[ "${SHOW_COMMENT}" = "true" ]] ; then 33 | echo "$LINE" 34 | elif [[ ! $LINE =~ $RE_EMPTY ]]; then 35 | echo "$LINE" 36 | fi 37 | done < $PARENT 38 | } 39 | 40 | cd $(dirname $0)/../ 41 | INCLUDED=() 42 | process src/ArduinoJson.h true > ../ArduinoJson-$TAG.h 43 | g++ -x c++ -c -o ../smoketest.o - < ../ArduinoJson-$TAG.hpp 50 | g++ -x c++ -c -o ../smoketest.o - <> $HOME/.profile 28 | echo "export CC='clang'" >> $HOME/.profile 29 | echo "export CXX='clang++'" >> $HOME/.profile 30 | echo "export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/" >> $HOME/.profile 31 | 32 | echo "Run /host/ArduinoJson/fuzzing/fuzz.sh" | sudo tee /etc/motd 33 | SHELL 34 | end 35 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/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.md" "$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 18 | particle library publish 19 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/travis/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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | export CC="$_CC" 4 | export CXX="$_CXX" 5 | 6 | if [ -n "$SANITIZE" ]; then 7 | export CXXFLAGS="-fsanitize=$SANITIZE" 8 | BUILD_TYPE="Debug" 9 | else 10 | BUILD_TYPE="Release" 11 | fi 12 | 13 | cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE . 14 | cmake --build . 15 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/travis/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | cmake -DCOVERAGE=true . 4 | make 5 | make test 6 | 7 | pip install --user cpp-coveralls 'requests[security]' 8 | coveralls --exclude third-party --gcov-options '\-lp'; fi 9 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/travis/fuzz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | ROOT_DIR=$(dirname $0)/../../ 4 | INCLUDE_DIR=${ROOT_DIR}/src/ 5 | FUZZING_DIR=${ROOT_DIR}/fuzzing/ 6 | CXXFLAGS="-g -fprofile-instr-generate -fcoverage-mapping -fsanitize=address,undefined,fuzzer -fno-sanitize-recover=all" 7 | 8 | fuzz() { 9 | NAME="$1" 10 | FUZZER="${NAME}_fuzzer" 11 | FUZZER_CPP="${FUZZING_DIR}/${NAME}_fuzzer.cpp" 12 | CORPUS_DIR="${FUZZING_DIR}/${NAME}_corpus" 13 | SEED_CORPUS_DIR="${FUZZING_DIR}/${NAME}_seed_corpus" 14 | 15 | clang++-${CLANG} ${CXXFLAGS} -o ${FUZZER} -I$INCLUDE_DIR ${FUZZER_CPP} 16 | 17 | export ASAN_OPTIONS="detect_leaks=0" 18 | export LLVM_PROFILE_FILE="${FUZZER}.profraw" 19 | ./${FUZZER} "$CORPUS_DIR" "$SEED_CORPUS_DIR" -max_total_time=30 -timeout=1 20 | 21 | llvm-profdata-${CLANG} merge -sparse ${LLVM_PROFILE_FILE} -o ${FUZZER}.profdata 22 | llvm-cov-${CLANG} report ./${FUZZER} -instr-profile=${FUZZER}.profdata 23 | } 24 | 25 | fuzz json 26 | fuzz msgpack 27 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/travis/platformio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | pip install --user platformio 4 | 5 | rm -r test 6 | 7 | case $BOARD in 8 | uno) 9 | platformio lib install 868 # SD library 10 | platformio lib install 872 # Ethernet library 11 | ;; 12 | esp01) 13 | platformio lib uninstall 161 || true 14 | platformio lib uninstall 868 || true 15 | platformio lib uninstall 872 || true 16 | ;; 17 | esac 18 | 19 | for EXAMPLE in $PWD/examples/*/*.ino; 20 | do 21 | platformio ci $EXAMPLE -l '.' -b $BOARD 22 | done 23 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/scripts/travis/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | "$(dirname "$0")/build.sh" 4 | ctest --output-on-failure . 5 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/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 <add(pool) : 0; 13 | } 14 | 15 | template 16 | inline void arrayAccept(const CollectionData *arr, Visitor &visitor) { 17 | if (arr) 18 | visitor.visitArray(*arr); 19 | else 20 | visitor.visitNull(); 21 | } 22 | 23 | inline bool arrayEquals(const CollectionData *lhs, const CollectionData *rhs) { 24 | if (lhs == rhs) return true; 25 | if (!lhs || !rhs) return false; 26 | 27 | return lhs->equalsArray(*rhs); 28 | } 29 | } // namespace ARDUINOJSON_NAMESPACE 30 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Array/ArrayImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Object/ObjectRef.hpp" 8 | #include "ArrayRef.hpp" 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 | } // namespace ARDUINOJSON_NAMESPACE 23 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Array/ArrayShortcuts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/attributes.hpp" 8 | #include "../Polyfills/type_traits.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | // Forward declarations. 12 | template 13 | class ElementProxy; 14 | 15 | template 16 | class ArrayShortcuts { 17 | public: 18 | // Returns the element at specified index if the variant is an array. 19 | FORCE_INLINE ElementProxy operator[](size_t index) const; 20 | 21 | FORCE_INLINE ObjectRef createNestedObject() const; 22 | 23 | FORCE_INLINE ArrayRef createNestedArray() const; 24 | 25 | // Adds the specified value at the end of the array. 26 | // 27 | // bool add(TValue); 28 | // TValue = bool, long, int, short, float, double, serialized, VariantRef, 29 | // std::string, String, ObjectRef 30 | template 31 | FORCE_INLINE bool add(const T &value) const { 32 | return impl()->addElement().set(value); 33 | } 34 | // 35 | // bool add(TValue); 36 | // TValue = char*, const char*, const __FlashStringHelper* 37 | template 38 | FORCE_INLINE bool add(T *value) const { 39 | return impl()->addElement().set(value); 40 | } 41 | 42 | private: 43 | const TArray *impl() const { 44 | return static_cast(this); 45 | } 46 | }; 47 | } // namespace ARDUINOJSON_NAMESPACE 48 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Deserialization/ArduinoStreamReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_ARDUINO_STREAM 8 | 9 | #include 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | struct ArduinoStreamReader { 14 | Stream& _stream; 15 | 16 | public: 17 | explicit ArduinoStreamReader(Stream& stream) : _stream(stream) {} 18 | 19 | int read() { 20 | // don't use _stream.read() as it ignores the timeout 21 | uint8_t c; 22 | return _stream.readBytes(&c, 1) ? c : -1; 23 | } 24 | }; 25 | 26 | inline ArduinoStreamReader makeReader(Stream& input) { 27 | return ArduinoStreamReader(input); 28 | } 29 | } // namespace ARDUINOJSON_NAMESPACE 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Deserialization/FlashStringReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_PROGMEM 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | class UnsafeFlashStringReader { 11 | const char* _ptr; 12 | 13 | public: 14 | explicit UnsafeFlashStringReader(const __FlashStringHelper* ptr) 15 | : _ptr(reinterpret_cast(ptr)) {} 16 | 17 | int read() { 18 | return pgm_read_byte_near(_ptr++); 19 | } 20 | }; 21 | 22 | class SafeFlashStringReader { 23 | const char* _ptr; 24 | const char* _end; 25 | 26 | public: 27 | explicit SafeFlashStringReader(const __FlashStringHelper* ptr, size_t size) 28 | : _ptr(reinterpret_cast(ptr)), _end(_ptr + size) {} 29 | 30 | int read() { 31 | if (_ptr < _end) 32 | return pgm_read_byte_near(_ptr++); 33 | else 34 | return -1; 35 | } 36 | }; 37 | 38 | inline UnsafeFlashStringReader makeReader(const __FlashStringHelper* input) { 39 | return UnsafeFlashStringReader(input); 40 | } 41 | 42 | inline SafeFlashStringReader makeReader(const __FlashStringHelper* input, 43 | size_t size) { 44 | return SafeFlashStringReader(input, size); 45 | } 46 | } // namespace ARDUINOJSON_NAMESPACE 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Deserialization/IteratorReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | template 10 | class IteratorReader { 11 | TIterator _ptr, _end; 12 | 13 | public: 14 | explicit IteratorReader(TIterator begin, TIterator end) 15 | : _ptr(begin), _end(end) {} 16 | 17 | int read() { 18 | if (_ptr < _end) 19 | return static_cast(*_ptr++); 20 | else 21 | return -1; 22 | } 23 | }; 24 | 25 | template 26 | inline IteratorReader makeReader( 27 | const TInput& input) { 28 | return IteratorReader(input.begin(), 29 | input.end()); 30 | } 31 | } // namespace ARDUINOJSON_NAMESPACE 32 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Deserialization/NestingLimit.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | struct NestingLimit { 12 | NestingLimit() : value(ARDUINOJSON_DEFAULT_NESTING_LIMIT) {} 13 | explicit NestingLimit(uint8_t n) : value(n) {} 14 | 15 | uint8_t value; 16 | }; 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Deserialization/StdStreamReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_STD_STREAM 8 | 9 | #include 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | class StdStreamReader { 14 | std::istream& _stream; 15 | char _current; 16 | 17 | public: 18 | explicit StdStreamReader(std::istream& stream) 19 | : _stream(stream), _current(0) {} 20 | 21 | int read() { 22 | return _stream.get(); 23 | } 24 | 25 | private: 26 | StdStreamReader& operator=(const StdStreamReader&); // Visual Studio C4512 27 | }; 28 | 29 | inline StdStreamReader makeReader(std::istream& input) { 30 | return StdStreamReader(input); 31 | } 32 | } // namespace ARDUINOJSON_NAMESPACE 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Document/DynamicJsonDocument.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "BasicJsonDocument.hpp" 8 | 9 | #include // malloc, free 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | struct DefaultAllocator { 14 | void* allocate(size_t n) { 15 | return malloc(n); 16 | } 17 | 18 | void deallocate(void* p) { 19 | free(p); 20 | } 21 | }; 22 | 23 | typedef BasicJsonDocument DynamicJsonDocument; 24 | 25 | } // namespace ARDUINOJSON_NAMESPACE 26 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Document/StaticJsonDocument.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonDocument.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | class StaticJsonDocument : public JsonDocument { 13 | static const size_t _capacity = 14 | AddPadding::value>::value; 15 | 16 | public: 17 | StaticJsonDocument() : JsonDocument(_buffer, _capacity) {} 18 | 19 | StaticJsonDocument(const StaticJsonDocument& src) 20 | : JsonDocument(_buffer, _capacity) { 21 | set(src); 22 | } 23 | 24 | template 25 | StaticJsonDocument(const T& src, 26 | typename enable_if::value>::type* = 0) 27 | : JsonDocument(_buffer, _capacity) { 28 | set(src); 29 | } 30 | 31 | // disambiguate 32 | StaticJsonDocument(VariantRef src) : JsonDocument(_buffer, _capacity) { 33 | set(src); 34 | } 35 | 36 | StaticJsonDocument operator=(const StaticJsonDocument& src) { 37 | set(src); 38 | return *this; 39 | } 40 | 41 | template 42 | StaticJsonDocument operator=(const T& src) { 43 | set(src); 44 | return *this; 45 | } 46 | 47 | private: 48 | char _buffer[_capacity]; 49 | }; 50 | 51 | } // namespace ARDUINOJSON_NAMESPACE 52 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Json/EscapeSequence.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | class EscapeSequence { 10 | public: 11 | // Optimized for code size on a 8-bit AVR 12 | static char escapeChar(char c) { 13 | const char *p = escapeTable(false); 14 | while (p[0] && p[1] != c) { 15 | p += 2; 16 | } 17 | return p[0]; 18 | } 19 | 20 | // Optimized for code size on a 8-bit AVR 21 | static char unescapeChar(char c) { 22 | const char *p = escapeTable(true); 23 | for (;;) { 24 | if (p[0] == '\0') return c; 25 | if (p[0] == c) return p[1]; 26 | p += 2; 27 | } 28 | } 29 | 30 | private: 31 | static const char *escapeTable(bool excludeIdenticals) { 32 | return &"\"\"\\\\b\bf\fn\nr\rt\t"[excludeIdenticals ? 4 : 0]; 33 | } 34 | }; 35 | } // namespace ARDUINOJSON_NAMESPACE 36 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Json/Utf8.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | namespace Utf8 { 10 | template 11 | inline void encodeCodepoint(uint16_t codepoint, TStringBuilder &str) { 12 | if (codepoint < 0x80) { 13 | str.append(char(codepoint)); 14 | return; 15 | } 16 | 17 | if (codepoint >= 0x00000800) { 18 | str.append(char(0xe0 /*0b11100000*/ | (codepoint >> 12))); 19 | str.append(char(((codepoint >> 6) & 0x3f /*0b00111111*/) | 0x80)); 20 | } else { 21 | str.append(char(0xc0 /*0b11000000*/ | (codepoint >> 6))); 22 | } 23 | str.append(char((codepoint & 0x3f /*0b00111111*/) | 0x80)); 24 | } 25 | } // namespace Utf8 26 | } // namespace ARDUINOJSON_NAMESPACE 27 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Memory/Alignment.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // size_t 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | inline bool isAligned(void *ptr) { 12 | const size_t mask = sizeof(void *) - 1; 13 | size_t addr = reinterpret_cast(ptr); 14 | return (addr & mask) == 0; 15 | } 16 | 17 | inline size_t addPadding(size_t bytes) { 18 | const size_t mask = sizeof(void *) - 1; 19 | return (bytes + mask) & ~mask; 20 | } 21 | 22 | template 23 | struct AddPadding { 24 | static const size_t mask = sizeof(void *) - 1; 25 | static const size_t value = (bytes + mask) & ~mask; 26 | }; 27 | 28 | } // namespace ARDUINOJSON_NAMESPACE 29 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Memory/StringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "MemoryPool.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | class StringBuilder { 12 | public: 13 | explicit StringBuilder(MemoryPool* parent) : _parent(parent), _size(0) { 14 | _slot = _parent->allocExpandableString(); 15 | } 16 | 17 | void append(const char* s) { 18 | while (*s) append(*s++); 19 | } 20 | 21 | void append(const char* s, size_t n) { 22 | while (n-- > 0) append(*s++); 23 | } 24 | 25 | void append(char c) { 26 | if (!_slot.value) return; 27 | 28 | if (_size >= _slot.size) { 29 | _slot.value = 0; 30 | return; 31 | } 32 | 33 | _slot.value[_size++] = c; 34 | } 35 | 36 | char* complete() { 37 | append('\0'); 38 | if (_slot.value) { 39 | _parent->freezeString(_slot, _size); 40 | } 41 | return _slot.value; 42 | } 43 | 44 | private: 45 | MemoryPool* _parent; 46 | size_t _size; 47 | StringSlot _slot; 48 | }; 49 | 50 | } // namespace ARDUINOJSON_NAMESPACE 51 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Memory/StringSlot.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // for size_t 8 | #include "../Configuration.hpp" 9 | 10 | #define JSON_STRING_SIZE(SIZE) (SIZE) 11 | 12 | namespace ARDUINOJSON_NAMESPACE { 13 | 14 | struct StringSlot { 15 | char *value; 16 | size_t size; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Misc/Visitable.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 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 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/MsgPack/endianess.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 8 | #include "../Polyfills/utility.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | #if ARDUINOJSON_LITTLE_ENDIAN 13 | inline void fixEndianess(uint8_t *p, integral_constant) { 14 | swap(p[0], p[7]); 15 | swap(p[1], p[6]); 16 | swap(p[2], p[5]); 17 | swap(p[3], p[4]); 18 | } 19 | 20 | inline void fixEndianess(uint8_t *p, integral_constant) { 21 | swap(p[0], p[3]); 22 | swap(p[1], p[2]); 23 | } 24 | 25 | inline void fixEndianess(uint8_t *p, integral_constant) { 26 | swap(p[0], p[1]); 27 | } 28 | 29 | inline void fixEndianess(uint8_t *, integral_constant) {} 30 | 31 | template 32 | inline void fixEndianess(T &value) { 33 | fixEndianess(reinterpret_cast(&value), 34 | integral_constant()); 35 | } 36 | #else 37 | template 38 | inline void fixEndianess(T &) {} 39 | #endif 40 | 41 | } // namespace ARDUINOJSON_NAMESPACE 42 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/MsgPack/ieee754.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | inline void doubleToFloat(const uint8_t d[8], uint8_t f[4]) { 10 | f[0] = uint8_t((d[0] & 0xC0) | (d[0] << 3 & 0x3f) | (d[1] >> 5)); 11 | f[1] = uint8_t((d[1] << 3) | (d[2] >> 5)); 12 | f[2] = uint8_t((d[2] << 3) | (d[3] >> 5)); 13 | f[3] = uint8_t((d[3] << 3) | (d[4] >> 5)); 14 | } 15 | 16 | } // namespace ARDUINOJSON_NAMESPACE 17 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Namespace.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "version.hpp" 8 | 9 | #include "Configuration.hpp" 10 | 11 | #define ARDUINOJSON_DO_CONCAT(A, B) A##B 12 | #define ARDUINOJSON_CONCAT2(A, B) ARDUINOJSON_DO_CONCAT(A, B) 13 | #define ARDUINOJSON_CONCAT3(A, B, C) \ 14 | ARDUINOJSON_CONCAT2(A, ARDUINOJSON_CONCAT2(B, C)) 15 | #define ARDUINOJSON_CONCAT4(A, B, C, D) \ 16 | ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT2(A, B), ARDUINOJSON_CONCAT2(C, D)) 17 | #define ARDUINOJSON_CONCAT8(A, B, C, D, E, F, G, H) \ 18 | ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT4(A, B, C, D), \ 19 | ARDUINOJSON_CONCAT4(E, F, G, H)) 20 | #define ARDUINOJSON_CONCAT10(A, B, C, D, E, F, G, H, I, J) \ 21 | ARDUINOJSON_CONCAT8(A, B, C, D, E, F, G, ARDUINOJSON_CONCAT3(H, I, J)) 22 | 23 | #define ARDUINOJSON_NAMESPACE \ 24 | ARDUINOJSON_CONCAT10( \ 25 | ArduinoJson, ARDUINOJSON_VERSION_MAJOR, ARDUINOJSON_VERSION_MINOR, \ 26 | ARDUINOJSON_VERSION_REVISION, _, ARDUINOJSON_USE_LONG_LONG, \ 27 | ARDUINOJSON_USE_DOUBLE, ARDUINOJSON_DECODE_UNICODE, \ 28 | ARDUINOJSON_ENABLE_NAN, ARDUINOJSON_ENABLE_INFINITY) 29 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Numbers/Float.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | #if ARDUINOJSON_USE_DOUBLE 12 | typedef double Float; 13 | #else 14 | typedef float Float; 15 | #endif 16 | } // namespace ARDUINOJSON_NAMESPACE 17 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Numbers/Integer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | #include // int64_t 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | #if ARDUINOJSON_USE_LONG_LONG 14 | typedef int64_t Integer; 15 | typedef uint64_t UInt; 16 | #else 17 | typedef long Integer; 18 | typedef unsigned long UInt; 19 | #endif 20 | } // namespace ARDUINOJSON_NAMESPACE 21 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Numbers/parseFloat.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "convertNumber.hpp" 8 | #include "parseNumber.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | template 13 | inline T parseFloat(const char* s) { 14 | // try to reuse the same parameters as JsonDeserializer 15 | typedef typename choose_largest::type TFloat; 16 | return parseNumber(s).template as(); 17 | } 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Numbers/parseInteger.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 8 | #include "convertNumber.hpp" 9 | #include "parseNumber.hpp" 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | template 13 | T parseInteger(const char *s) { 14 | // try to reuse the same parameters as JsonDeserializer 15 | typedef typename choose_largest::type>::type 16 | TUInt; 17 | return parseNumber(s).template as(); 18 | } 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Object/ObjectFunctions.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Collection/CollectionData.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | void objectAccept(const CollectionData *obj, Visitor &visitor) { 13 | if (obj) 14 | visitor.visitObject(*obj); 15 | else 16 | visitor.visitNull(); 17 | } 18 | 19 | inline bool objectEquals(const CollectionData *lhs, const CollectionData *rhs) { 20 | if (lhs == rhs) return true; 21 | if (!lhs || !rhs) return false; 22 | return lhs->equalsObject(*rhs); 23 | } 24 | 25 | template 26 | inline VariantData *objectGet(const CollectionData *obj, TAdaptedString key) { 27 | if (!obj) return 0; 28 | return obj->get(key); 29 | } 30 | 31 | template 32 | void objectRemove(CollectionData *obj, TAdaptedString key) { 33 | if (!obj) return; 34 | obj->remove(key); 35 | } 36 | 37 | template 38 | inline VariantData *objectGetOrCreate(CollectionData *obj, TAdaptedString key, 39 | MemoryPool *pool) { 40 | if (!obj) return 0; 41 | 42 | // ignore null key 43 | if (key.isNull()) return 0; 44 | 45 | // search a matching key 46 | VariantData *var = obj->get(key); 47 | if (var) return var; 48 | 49 | return obj->add(key, pool); 50 | } 51 | } // namespace ARDUINOJSON_NAMESPACE 52 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Object/Pair.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Strings/String.hpp" 8 | #include "../Variant/VariantRef.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | // A key value pair for CollectionData. 12 | class Pair { 13 | public: 14 | Pair(MemoryPool* pool, VariantSlot* slot) { 15 | if (slot) { 16 | _key = String(slot->key(), !slot->ownsKey()); 17 | _value = VariantRef(pool, slot->data()); 18 | } 19 | } 20 | 21 | String key() const { 22 | return _key; 23 | } 24 | 25 | VariantRef value() const { 26 | return _value; 27 | } 28 | 29 | private: 30 | String _key; 31 | VariantRef _value; 32 | }; 33 | 34 | class PairConst { 35 | public: 36 | PairConst(const VariantSlot* slot) { 37 | if (slot) { 38 | _key = String(slot->key(), !slot->ownsKey()); 39 | _value = VariantConstRef(slot->data()); 40 | } 41 | } 42 | 43 | String key() const { 44 | return _key; 45 | } 46 | 47 | VariantConstRef value() const { 48 | return _value; 49 | } 50 | 51 | private: 52 | String _key; 53 | VariantConstRef _value; 54 | }; 55 | } // namespace ARDUINOJSON_NAMESPACE 56 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Operators/VariantCasts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/attributes.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | class VariantCasts { 13 | public: 14 | template 15 | FORCE_INLINE operator T() const { 16 | return impl()->template as(); 17 | } 18 | 19 | private: 20 | const TImpl *impl() const { 21 | return static_cast(this); 22 | } 23 | }; 24 | } // namespace ARDUINOJSON_NAMESPACE 25 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Operators/VariantOperators.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "VariantCasts.hpp" 8 | #include "VariantComparisons.hpp" 9 | #include "VariantOr.hpp" 10 | #include "VariantShortcuts.hpp" 11 | 12 | namespace ARDUINOJSON_NAMESPACE { 13 | 14 | template 15 | class VariantOperators : public VariantCasts, 16 | public VariantComparisons, 17 | public VariantOr, 18 | public VariantShortcuts {}; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Operators/VariantOr.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/attributes.hpp" 8 | #include "../Polyfills/type_traits.hpp" 9 | #include "../Variant/VariantAs.hpp" 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | template 14 | class VariantOr { 15 | public: 16 | // Returns the default value if the VariantRef is undefined of incompatible 17 | template 18 | T operator|(const T &defaultValue) const { 19 | if (impl()->template is()) 20 | return impl()->template as(); 21 | else 22 | return defaultValue; 23 | } 24 | 25 | // Returns the default value if the VariantRef is undefined of incompatible 26 | // Special case for string: null is treated as undefined 27 | const char *operator|(const char *defaultValue) const { 28 | const char *value = impl()->template as(); 29 | return value ? value : defaultValue; 30 | } 31 | 32 | private: 33 | const TImpl *impl() const { 34 | return static_cast(this); 35 | } 36 | }; 37 | } // namespace ARDUINOJSON_NAMESPACE 38 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Operators/VariantShortcuts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Array/ArrayShortcuts.hpp" 8 | #include "../Object/ObjectShortcuts.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | template 13 | class VariantShortcuts : public ObjectShortcuts, 14 | public ArrayShortcuts { 15 | public: 16 | using ArrayShortcuts::createNestedArray; 17 | using ArrayShortcuts::createNestedObject; 18 | using ArrayShortcuts::operator[]; 19 | using ObjectShortcuts::createNestedArray; 20 | using ObjectShortcuts::createNestedObject; 21 | using ObjectShortcuts::operator[]; 22 | }; 23 | } // namespace ARDUINOJSON_NAMESPACE 24 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/alias_cast.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include // for size_t 9 | #include "../Configuration.hpp" 10 | #include "../Polyfills/math.hpp" 11 | 12 | namespace ARDUINOJSON_NAMESPACE { 13 | 14 | template 15 | struct alias_cast_t { 16 | union { 17 | F raw; 18 | T data; 19 | }; 20 | }; 21 | 22 | template 23 | T alias_cast(F raw_data) { 24 | alias_cast_t ac; 25 | ac.raw = raw_data; 26 | return ac.data; 27 | } 28 | } // namespace ARDUINOJSON_NAMESPACE 29 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/assert.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef ARDUINOJSON_DEBUG 8 | #include 9 | #define ARDUINOJSON_ASSERT(X) assert(X) 10 | #else 11 | #define ARDUINOJSON_ASSERT(X) ((void)0) 12 | #endif 13 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/attributes.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 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 | #define DEPRECATED(msg) __declspec(deprecated(msg)) 12 | 13 | #elif defined(__GNUC__) // GCC or Clang 14 | 15 | #define FORCE_INLINE __attribute__((always_inline)) 16 | #define NO_INLINE __attribute__((noinline)) 17 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) 18 | #define DEPRECATED(msg) __attribute__((deprecated(msg))) 19 | #else 20 | #define DEPRECATED(msg) __attribute__((deprecated)) 21 | #endif 22 | 23 | #else // Other compilers 24 | 25 | #define FORCE_INLINE 26 | #define NO_INLINE 27 | #define DEPRECATED(msg) 28 | 29 | #endif 30 | 31 | #if __cplusplus >= 201103L 32 | #define NOEXCEPT noexcept 33 | #else 34 | #define NOEXCEPT throw() 35 | #endif 36 | 37 | #if defined(__has_attribute) 38 | #if __has_attribute(no_sanitize) 39 | #define ARDUINOJSON_NO_SANITIZE(check) __attribute__((no_sanitize(check))) 40 | #else 41 | #define ARDUINOJSON_NO_SANITIZE(check) 42 | #endif 43 | #else 44 | #define ARDUINOJSON_NO_SANITIZE(check) 45 | #endif 46 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/ctype.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | inline bool isdigit(char c) { 10 | return '0' <= c && c <= '9'; 11 | } 12 | 13 | inline bool issign(char c) { 14 | return '-' == c || c == '+'; 15 | } 16 | } // namespace ARDUINOJSON_NAMESPACE 17 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/gsl/not_null.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../assert.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | class not_null { 13 | public: 14 | explicit not_null(T ptr) : _ptr(ptr) { 15 | ARDUINOJSON_ASSERT(ptr != NULL); 16 | } 17 | 18 | T get() const { 19 | ARDUINOJSON_ASSERT(_ptr != NULL); 20 | return _ptr; 21 | } 22 | 23 | private: 24 | T _ptr; 25 | }; 26 | 27 | template 28 | not_null make_not_null(T ptr) { 29 | ARDUINOJSON_ASSERT(ptr != NULL); 30 | return not_null(ptr); 31 | } 32 | 33 | } // namespace ARDUINOJSON_NAMESPACE 34 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/limits.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 8 | 9 | #ifdef _MSC_VER 10 | #pragma warning(push) 11 | #pragma warning(disable : 4310) 12 | #endif 13 | 14 | namespace ARDUINOJSON_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 | } // namespace ARDUINOJSON_NAMESPACE 42 | 43 | #ifdef _MSC_VER 44 | #pragma warning(pop) 45 | #endif 46 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/math.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // Some libraries #define isnan() and isinf() so we need to check before 10 | // using this name 11 | 12 | #ifndef isnan 13 | template 14 | bool isnan(T x) { 15 | return x != x; 16 | } 17 | #endif 18 | 19 | #ifndef isinf 20 | template 21 | bool isinf(T x) { 22 | return x != 0.0 && x * 2 == x; 23 | } 24 | #endif 25 | } // namespace ARDUINOJSON_NAMESPACE 26 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/mpl/max.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // for size_t 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | // A meta-function that returns the highest value 12 | template Y)> 13 | struct Max {}; 14 | 15 | template 16 | struct Max { 17 | static const size_t value = X; 18 | }; 19 | 20 | template 21 | struct Max { 22 | static const size_t value = Y; 23 | }; 24 | } // namespace ARDUINOJSON_NAMESPACE 25 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/safe_strcmp.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | inline int8_t safe_strcmp(const char* a, const char* b) { 10 | if (a == b) return 0; 11 | if (!a) return -1; 12 | if (!b) return 1; 13 | return static_cast(strcmp(a, b)); 14 | } 15 | 16 | inline int8_t safe_strncmp(const char* a, const char* b, size_t n) { 17 | if (a == b) return 0; 18 | if (!a) return -1; 19 | if (!b) return 1; 20 | return static_cast(strncmp(a, b, n)); 21 | } 22 | } // namespace ARDUINOJSON_NAMESPACE 23 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 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_const.hpp" 13 | #include "type_traits/is_floating_point.hpp" 14 | #include "type_traits/is_integral.hpp" 15 | #include "type_traits/is_same.hpp" 16 | #include "type_traits/is_signed.hpp" 17 | #include "type_traits/is_unsigned.hpp" 18 | #include "type_traits/make_unsigned.hpp" 19 | #include "type_traits/remove_const.hpp" 20 | #include "type_traits/remove_reference.hpp" 21 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/conditional.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | template 10 | struct conditional { 11 | typedef TrueType type; 12 | }; 13 | 14 | template 15 | struct conditional { 16 | typedef FalseType type; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/enable_if.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that return the type T if Condition is true. 10 | template 11 | struct enable_if {}; 12 | 13 | template 14 | struct enable_if { 15 | typedef T type; 16 | }; 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/integral_constant.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | template 10 | struct integral_constant { 11 | static const T value = v; 12 | }; 13 | 14 | typedef integral_constant true_type; 15 | typedef integral_constant false_type; 16 | 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_array.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // size_t 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | struct is_array : false_type {}; 13 | 14 | template 15 | struct is_array : true_type {}; 16 | 17 | template 18 | struct is_array : true_type {}; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_base_of.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that returns true if Derived inherits from TBase is an 10 | // integral type. 11 | template 12 | class is_base_of { 13 | protected: // <- to avoid GCC's "all member functions in class are private" 14 | typedef char Yes[1]; 15 | typedef char No[2]; 16 | 17 | static Yes &probe(const TBase *); 18 | static No &probe(...); 19 | 20 | public: 21 | static const bool value = 22 | sizeof(probe(reinterpret_cast(0))) == sizeof(Yes); 23 | }; 24 | } // namespace ARDUINOJSON_NAMESPACE 25 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_const.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_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 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_floating_point.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | struct is_floating_point : false_type {}; 13 | 14 | template <> 15 | struct is_floating_point : true_type {}; 16 | 17 | template <> 18 | struct is_floating_point : true_type {}; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_integral.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../../Configuration.hpp" 8 | #include "is_same.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | // A meta-function that returns true if T is an integral type. 13 | template 14 | struct is_integral { 15 | static const bool value = 16 | is_same::value || is_same::value || 17 | is_same::value || is_same::value || 18 | is_same::value || is_same::value || 19 | is_same::value || is_same::value || 20 | #if ARDUINOJSON_HAS_LONG_LONG 21 | is_same::value || 22 | is_same::value || 23 | #endif 24 | #if ARDUINOJSON_HAS_INT64 25 | is_same::value || 26 | is_same::value || 27 | #endif 28 | is_same::value; 29 | 30 | // CAUTION: differs from std::is_integral as it doesn't include bool 31 | }; 32 | 33 | template 34 | struct is_integral : is_integral {}; 35 | } // namespace ARDUINOJSON_NAMESPACE 36 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_same.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_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 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | namespace ARDUINOJSON_NAMESPACE { 9 | 10 | template 11 | struct is_signed : false_type {}; 12 | 13 | template <> 14 | struct is_signed : true_type {}; 15 | 16 | template <> 17 | struct is_signed : true_type {}; 18 | 19 | template <> 20 | struct is_signed : true_type {}; 21 | 22 | template <> 23 | struct is_signed : true_type {}; 24 | 25 | template <> 26 | struct is_signed : true_type {}; 27 | 28 | template <> 29 | struct is_signed : true_type {}; 30 | 31 | template <> 32 | struct is_signed : true_type {}; 33 | 34 | #if ARDUINOJSON_HAS_LONG_LONG 35 | template <> 36 | struct is_signed : true_type {}; 37 | #endif 38 | 39 | #if ARDUINOJSON_HAS_INT64 40 | template <> 41 | struct is_signed : true_type {}; 42 | #endif 43 | } // namespace ARDUINOJSON_NAMESPACE 44 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | namespace ARDUINOJSON_NAMESPACE { 9 | 10 | template 11 | struct is_unsigned : false_type {}; 12 | 13 | template <> 14 | struct is_unsigned : true_type {}; 15 | 16 | template <> 17 | struct is_unsigned : true_type {}; 18 | 19 | template <> 20 | struct is_unsigned : true_type {}; 21 | 22 | template <> 23 | struct is_unsigned : true_type {}; 24 | 25 | template <> 26 | struct is_unsigned : true_type {}; 27 | 28 | #if ARDUINOJSON_HAS_INT64 29 | template <> 30 | struct is_unsigned : true_type {}; 31 | #endif 32 | 33 | #if ARDUINOJSON_HAS_LONG_LONG 34 | template <> 35 | struct is_unsigned : true_type {}; 36 | #endif 37 | } // namespace ARDUINOJSON_NAMESPACE 38 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_const.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that return the type T without the const modifier 10 | template 11 | struct remove_const { 12 | typedef T type; 13 | }; 14 | template 15 | struct remove_const { 16 | typedef T type; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/remove_reference.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that return the type T without the reference modifier. 10 | template 11 | struct remove_reference { 12 | typedef T type; 13 | }; 14 | template 15 | struct remove_reference { 16 | typedef T type; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/type_traits/type_identity.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | struct type_identity { 13 | typedef T type; 14 | }; 15 | } // namespace ARDUINOJSON_NAMESPACE 16 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | template 9 | inline void swap(T& a, T& b) { 10 | T t(a); 11 | a = b; 12 | b = t; 13 | } 14 | } // namespace ARDUINOJSON_NAMESPACE 15 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Serialization/DummyWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | class DummyWriter { 10 | public: 11 | size_t write(uint8_t) { 12 | return 1; 13 | } 14 | 15 | size_t write(const uint8_t*, size_t n) { 16 | return n; 17 | } 18 | }; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Serialization/StaticStringWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A Print implementation that allows to write in a char[] 10 | class StaticStringWriter { 11 | public: 12 | StaticStringWriter(char *buf, size_t size) : end(buf + size - 1), p(buf) { 13 | *p = '\0'; 14 | } 15 | 16 | size_t write(uint8_t c) { 17 | if (p >= end) return 0; 18 | *p++ = static_cast(c); 19 | *p = '\0'; 20 | return 1; 21 | } 22 | 23 | size_t write(const uint8_t *s, size_t n) { 24 | char *begin = p; 25 | while (p < end && n > 0) { 26 | *p++ = static_cast(*s++); 27 | n--; 28 | } 29 | *p = '\0'; 30 | return size_t(p - begin); 31 | } 32 | 33 | private: 34 | char *end; 35 | char *p; 36 | }; 37 | } // namespace ARDUINOJSON_NAMESPACE 38 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Serialization/StreamWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | #if ARDUINOJSON_ENABLE_STD_STREAM 10 | 11 | #include 12 | 13 | namespace ARDUINOJSON_NAMESPACE { 14 | 15 | class StreamWriter { 16 | public: 17 | explicit StreamWriter(std::ostream& os) : _os(os) {} 18 | 19 | size_t write(uint8_t c) { 20 | _os << c; 21 | return 1; 22 | } 23 | 24 | size_t write(const uint8_t* s, size_t n) { 25 | _os.write(reinterpret_cast(s), 26 | static_cast(n)); 27 | return n; 28 | } 29 | 30 | private: 31 | // cannot be assigned 32 | StreamWriter& operator=(const StreamWriter&); 33 | 34 | std::ostream& _os; 35 | }; 36 | } // namespace ARDUINOJSON_NAMESPACE 37 | 38 | #endif // ARDUINOJSON_ENABLE_STD_STREAM 39 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/src/ArduinoJson/Serialization/measure.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "./DummyWriter.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template