├── blynk-library ├── scripts │ ├── README.md │ ├── com2tcp.bin │ └── certs │ │ └── server.crt ├── examples │ ├── Widgets │ │ ├── RTC │ │ │ ├── AppQR.png │ │ │ └── Thumbs.db │ │ ├── TimeInput │ │ │ └── SimpleTimeInput │ │ │ │ └── SimpleTimeInput.ino │ │ └── Map │ │ │ └── Map.ino │ ├── GettingStarted │ │ ├── BlynkBlink │ │ │ ├── App.png │ │ │ ├── AppQR.png │ │ │ ├── Thumbs.db │ │ │ └── readme.md │ │ └── Servo │ │ │ └── Servo.ino │ ├── Export_Demo │ │ ├── Template_ESP8266 │ │ │ ├── ota-firmwares.json │ │ │ ├── BlynkState.h │ │ │ ├── Template_ESP8266.ino │ │ │ └── ResetButton.h │ │ ├── myPlant_ESP8266 │ │ │ ├── ota-firmwares.json │ │ │ ├── BlynkState.h │ │ │ └── ResetButton.h │ │ └── Template_MKR1000 │ │ │ ├── OTA.h │ │ │ ├── BlynkState.h │ │ │ ├── Template_MKR1000.ino │ │ │ └── ResetButton.h │ ├── Boards_WiFi │ │ ├── Digistump_Oak │ │ │ └── Digistump_Oak.ino │ │ ├── Arduino_Yun │ │ │ └── Arduino_Yun.ino │ │ ├── LinkItONE │ │ │ └── LinkItONE.ino │ │ └── Fishino │ │ │ └── Fishino.ino │ ├── Boards_Bluetooth │ │ ├── Energia_BLE │ │ │ └── Energia_BLE.ino │ │ ├── RedBearLab_BLE_Mini │ │ │ └── RedBearLab_BLE_Mini.ino │ │ ├── RFDuino_BLE │ │ │ └── RFDuino_BLE.ino │ │ ├── Microduino_BLE │ │ │ └── Microduino_BLE.ino │ │ ├── Simblee_BLE │ │ │ └── Simblee_BLE.ino │ │ ├── nRF8001 │ │ │ └── BLESerial.h │ │ ├── BBC_MicroBit │ │ │ └── BLESerial.h │ │ ├── Adafruit_Bluefruit_LE │ │ │ └── BLESerial.h │ │ └── RedBearLab_BlendMicro │ │ │ └── BLESerial.h │ ├── Boards_Ethernet │ │ └── Intel_Galileo │ │ │ └── Intel_Galileo.ino │ └── Boards_USB_Serial │ │ ├── chipKIT_Uno32 │ │ └── chipKIT_Uno32.ino │ │ ├── Arduino_Zero_M0_Serial │ │ └── Arduino_Zero_M0_Serial.ino │ │ └── Digistump_Digispark │ │ └── Digistump_Digispark.ino ├── src │ ├── Blynk.h │ ├── BlynkSimpleMKR1000.h │ ├── BlynkSimpleWiFly.h │ ├── BlynkSimpleParticle.h │ ├── BlynkSimpleRedBear_Duo.h │ ├── BlynkSimpleIntelEdisonWiFi.h │ ├── BlynkSimpleWildFire.h │ ├── BlynkWidgets.h │ ├── BlynkSimpleStream.h │ ├── BlynkSimpleSIM800.h │ ├── BlynkSimpleEnergiaWiFi.h │ ├── BlynkSimpleEnergiaEthernet.h │ ├── BlynkSimpleEthernetV2_0.h │ ├── BlynkSimpleWiFiShield101.h │ ├── BlynkSimpleSerialBLE.h │ ├── BlynkSimpleWiFiShield101_SSL.h │ ├── BlynkSimpleEthernet.h │ ├── BlynkSimpleEthernet2.h │ ├── BlynkSimpleUIPEthernet.h │ ├── WidgetMap.h │ ├── BlynkSimpleWifi.h │ ├── BlynkSimpleCC3000.h │ ├── WidgetLCD.h │ ├── WidgetLED.h │ ├── BlynkSimpleTinyDuino.h │ ├── utility │ │ └── BlynkUtility.h │ ├── Blynk │ │ ├── BlynkTemplates.h │ │ └── BlynkWidgetBase.h │ ├── WidgetGPS.h │ └── WidgetRTC.h ├── linux │ ├── build.sh │ ├── BlynkDebug.cpp │ ├── README.md │ ├── main.cpp │ └── BlynkOptionsParser.h ├── library.properties ├── LICENSE └── library.json ├── ArduinoJson ├── .gitattributes ├── fuzzing │ ├── seed_corpus │ │ ├── EmptyArray.json │ │ ├── EmptyObject.json │ │ ├── Strings.json │ │ ├── Comments.json │ │ ├── Numbers.json │ │ ├── ExcessiveNesting.json │ │ └── OpenWeatherMap.json │ ├── my_corpus │ │ └── .gitignore │ ├── fuzz.sh │ ├── Makefile │ └── fuzzer.cpp ├── scripts │ ├── oss-fuzz │ │ ├── .gitignore │ │ └── Vagrantfile │ ├── format-code.sh │ ├── travis │ │ ├── platformio.sh │ │ ├── coverage.sh │ │ ├── arduino.sh │ │ └── cmake.sh │ ├── cpplint.sh │ ├── build-arduino-package.sh │ ├── create-build-envs.sh │ ├── run-tests.sh │ └── create-size-graph.sh ├── .mbedignore ├── .clang-format ├── .gitignore ├── ArduinoJson.h ├── include │ ├── ArduinoJson.h │ ├── ArduinoJson │ │ ├── JsonPair.hpp │ │ ├── Data │ │ │ ├── JsonFloat.hpp │ │ │ ├── JsonBufferAllocated.hpp │ │ │ ├── JsonVariantDefault.hpp │ │ │ ├── JsonInteger.hpp │ │ │ ├── ListNode.hpp │ │ │ ├── JsonVariantContent.hpp │ │ │ ├── ReferenceType.hpp │ │ │ ├── JsonVariantAs.hpp │ │ │ ├── Encoding.hpp │ │ │ ├── ListConstIterator.hpp │ │ │ ├── ListIterator.hpp │ │ │ ├── JsonVariantType.hpp │ │ │ ├── Parse.hpp │ │ │ └── ValueSetter.hpp │ │ ├── TypeTraits │ │ │ ├── EnableIf.hpp │ │ │ ├── RemoveConst.hpp │ │ │ ├── IsFloatingPoint.hpp │ │ │ ├── RemoveReference.hpp │ │ │ ├── IsConst.hpp │ │ │ ├── IsSame.hpp │ │ │ ├── IsArray.hpp │ │ │ ├── IsChar.hpp │ │ │ ├── IsBaseOf.hpp │ │ │ ├── IsIntegral.hpp │ │ │ ├── IsSignedIntegral.hpp │ │ │ └── IsUnsignedIntegral.hpp │ │ ├── Serialization │ │ │ ├── DummyPrint.hpp │ │ │ ├── DynamicStringBuilder.hpp │ │ │ ├── StaticStringBuilder.hpp │ │ │ ├── StreamPrintAdapter.hpp │ │ │ └── JsonSerializer.hpp │ │ ├── RawJson.hpp │ │ ├── JsonBufferImpl.hpp │ │ ├── Polyfills │ │ │ ├── attributes.hpp │ │ │ └── normalize.hpp │ │ ├── JsonArrayImpl.hpp │ │ ├── Print.hpp │ │ ├── JsonObjectImpl.hpp │ │ ├── Deserialization │ │ │ ├── StringWriter.hpp │ │ │ └── Comments.hpp │ │ └── StringTraits │ │ │ ├── FlashString.hpp │ │ │ ├── StringTraits.hpp │ │ │ ├── ArduinoStream.hpp │ │ │ ├── StdStream.hpp │ │ │ └── CharPointer.hpp │ └── ArduinoJson.hpp ├── third-party │ └── gtest-1.7.0 │ │ ├── xcode │ │ ├── Config │ │ │ ├── TestTarget.xcconfig │ │ │ ├── FrameworkTarget.xcconfig │ │ │ ├── StaticLibraryTarget.xcconfig │ │ │ ├── DebugProject.xcconfig │ │ │ ├── ReleaseProject.xcconfig │ │ │ └── General.xcconfig │ │ ├── Samples │ │ │ └── FrameworkSample │ │ │ │ └── Info.plist │ │ └── Resources │ │ │ └── Info.plist │ │ ├── m4 │ │ └── ltversion.m4 │ │ ├── CONTRIBUTORS │ │ └── LICENSE ├── library.properties ├── keywords.txt ├── .github │ └── ISSUE_TEMPLATE.md ├── test │ ├── Issue214.cpp │ ├── gtest.cmake │ ├── JsonObject_Basic_Tests.cpp │ ├── DynamicJsonBuffer_Object_Tests.cpp │ ├── JsonObject_Get_Tests.cpp │ ├── JsonObject_Remove_Tests.cpp │ ├── DynamicJsonBuffer_Array_Tests.cpp │ ├── JsonArray_Invalid_Tests.cpp │ ├── Issue90.cpp │ ├── JsonObject_Invalid_Tests.cpp │ ├── Deprecated_Tests.cpp │ ├── JsonArray_Iterator_Tests.cpp │ ├── JsonObject_ContainsKey_Tests.cpp │ ├── JsonArray_Basic_Tests.cpp │ ├── JsonArray_Remove_Tests.cpp │ ├── TypeTraits_Tests.cpp │ ├── Issue34.cpp │ ├── JsonVariant_Success_Tests.cpp │ ├── StaticJsonBuffer_String_Tests.cpp │ ├── DynamicJsonBuffer_String_Tests.cpp │ ├── StaticJsonBuffer_CreateArray_Tests.cpp │ ├── DynamicJsonBuffer_NoMemory_Tests.cpp │ ├── JsonObject_Iterator_Tests.cpp │ ├── JsonArray_CopyTo_Tests.cpp │ └── Issue10.cpp ├── library.json ├── CMakeLists.txt ├── appveyor.yml ├── examples │ ├── IndentedPrintExample │ │ └── IndentedPrintExample.ino │ └── JsonUdpBeacon │ │ └── JsonUdpBeacon.ino └── LICENSE.md ├── sim800l-httpgetmethod ├── HTTPGET-Write-Push-BLYNK.txt ├── HTTPGET-Method-Working.txt └── HTTPGET-BLYNK.txt ├── Libelium-SIM900-Arduino-SourceCode ├── Using the shield in standalone mode - Calls │ ├── Make a lost call │ │ └── Make a lost call.txt │ ├── Originating Voice Calls │ │ └── Originating Voice Calls.txt │ └── Note.txt ├── Using the shield in standalone mode - FTP │ └── Using the shield in standalone mode - FTP.txt ├── Using the shield in standalone mode Sending and receiving SMS │ ├── Sends SMS │ │ └── Sends SMS.txt │ └── Reads the first SMS into the memory │ │ └── Reads the first SMS into the memory.txt ├── Using the shield in standalone mode - HTTP │ └── Using the shield in standalone mode - HTTP.txt └── Using the shield in standalone mode - TCP and UDP │ ├── Multiple client │ └── Example code with a UDP and TCP connections.txt │ └── Single Client │ └── Sending data to a TCP server first,then it sends to a UDP server.txt ├── sim800l-phonebookparser └── List-phonebook-response-from-SIM800L.txt ├── sim800l-httppostmethod └── HTTPPOST-Method-Working.txt ├── Seeeduino_GPRS ├── .gitattributes ├── example │ ├── SIM800_Serial_Debug │ │ └── SIM800_Serial_Debug.ino │ ├── GPRS_CallUp │ │ └── GPRS_CallUp.ino │ ├── GPRS_SendSMS │ │ └── GPRS_SendSMS.ino │ ├── GPRS_HTTP │ │ └── GPRS_HTTP.ino │ └── FM_Test │ │ └── FM_Test.ino └── License.txt ├── sim800l-simpleserialcommunication └── sim800l-simpleserialcommunication.ino └── sim800l-gprsconnection └── sim800l-gprsconnection.ino /blynk-library/scripts/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ArduinoJson/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/seed_corpus/EmptyArray.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/seed_corpus/EmptyObject.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/my_corpus/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/oss-fuzz/.gitignore: -------------------------------------------------------------------------------- 1 | /.vagrant/ 2 | *.log 3 | -------------------------------------------------------------------------------- /ArduinoJson/.mbedignore: -------------------------------------------------------------------------------- 1 | .github/ 2 | examples/ 3 | fuzzing/ 4 | scripts/ 5 | test/ 6 | third-party/ 7 | -------------------------------------------------------------------------------- /blynk-library/scripts/com2tcp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/blynk-library/scripts/com2tcp.bin -------------------------------------------------------------------------------- /blynk-library/examples/Widgets/RTC/AppQR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/blynk-library/examples/Widgets/RTC/AppQR.png -------------------------------------------------------------------------------- /blynk-library/examples/Widgets/RTC/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/blynk-library/examples/Widgets/RTC/Thumbs.db -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/seed_corpus/Strings.json: -------------------------------------------------------------------------------- 1 | [ 2 | "hello", 3 | 'hello', 4 | hello, 5 | {"hello":"world"}, 6 | {'hello':'world'}, 7 | {hello:world} 8 | ] -------------------------------------------------------------------------------- /blynk-library/examples/GettingStarted/BlynkBlink/App.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/blynk-library/examples/GettingStarted/BlynkBlink/App.png -------------------------------------------------------------------------------- /blynk-library/examples/GettingStarted/BlynkBlink/AppQR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/blynk-library/examples/GettingStarted/BlynkBlink/AppQR.png -------------------------------------------------------------------------------- /blynk-library/examples/GettingStarted/BlynkBlink/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/blynk-library/examples/GettingStarted/BlynkBlink/Thumbs.db -------------------------------------------------------------------------------- /ArduinoJson/.clang-format: -------------------------------------------------------------------------------- 1 | # http://clang.llvm.org/docs/ClangFormatStyleOptions.html 2 | 3 | BasedOnStyle: Google 4 | Standard: Cpp03 5 | AllowShortFunctionsOnASingleLine: Empty 6 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_ESP8266/ota-firmwares.json: -------------------------------------------------------------------------------- 1 | { 2 | "338b89********************e0ad33": { 3 | "version": "1.0.2", 4 | "file": "Template_ESP8266.ino.nodemcu.bin" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/myPlant_ESP8266/ota-firmwares.json: -------------------------------------------------------------------------------- 1 | { 2 | "338b89********************e0ad33": { 3 | "version": "1.0.2", 4 | "file": "Template_ESP8266.ino.nodemcu.bin" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/format-code.sh: -------------------------------------------------------------------------------- 1 | cd .. 2 | FILES=$(find include src test -regex ".*\.[ch]pp$") 3 | 4 | clang-format -style=Google -i $FILES 5 | 6 | # insert newline at end of file 7 | sed -i -e '$a\' $FILES 8 | -------------------------------------------------------------------------------- /ArduinoJson/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.idea 3 | /build 4 | /bin 5 | /lib 6 | /sftp-config.json 7 | .tags 8 | .tags_sorted_by_file 9 | /fuzzing/*_fuzzer 10 | /fuzzing/*_fuzzer.options 11 | /fuzzing/*_fuzzer_seed_corpus.zip 12 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/travis/platformio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | pip install --user platformio 4 | 5 | rm -r test 6 | 7 | for EXAMPLE in $PWD/examples/*/*.ino; 8 | do 9 | platformio ci $EXAMPLE -l '.' -b $BOARD 10 | done 11 | -------------------------------------------------------------------------------- /blynk-library/examples/GettingStarted/BlynkBlink/readme.md: -------------------------------------------------------------------------------- 1 | ![App Screenshot](/examples/GettingStarted/BlynkBlink/App.png) 2 | 3 | You can setup a copy of this project easily by scanning this QR code: 4 | ![App ](/examples/GettingStarted/BlynkBlink/AppQR.png) 5 | -------------------------------------------------------------------------------- /ArduinoJson/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include "include/ArduinoJson.h" 9 | -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/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 -------------------------------------------------------------------------------- /sim800l-httpgetmethod/HTTPGET-Write-Push-BLYNK.txt: -------------------------------------------------------------------------------- 1 | AT+HTTPINIT 2 | OK 3 | AT+HTTPPARA="URL","http://blynk-cloud.com/423b9ca014e54a1c892d4d22d2832f68/update/V1?value=80" 4 | OK 5 | AT+HTTPACTION=0 6 | 7 | +HTTPACTION: 0,200,0 8 | 9 | AT+HTTPTERM 10 | OK 11 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/cpplint.sh: -------------------------------------------------------------------------------- 1 | CPPLINT="python third-party/cpplint/cpplint.py" 2 | FLAGS="--filter=-runtime/printf,-runtime/int,-readability/todo,-build/namespace,-runtime/references,-readability/streams" 3 | 4 | cd .. 5 | $CPPLINT $FLAGS $(find include src test -regex ".*\.[hc]pp$") -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - Calls/Make a lost call/Make a lost call.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - Calls/Make a lost call/Make a lost call.txt -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - FTP/Using the shield in standalone mode - FTP.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - FTP/Using the shield in standalone mode - FTP.txt -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode Sending and receiving SMS/Sends SMS/Sends SMS.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode Sending and receiving SMS/Sends SMS/Sends SMS.txt -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - HTTP/Using the shield in standalone mode - HTTP.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - HTTP/Using the shield in standalone mode - HTTP.txt -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/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 | ] -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include "ArduinoJson.hpp" 9 | using namespace ArduinoJson; 10 | -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - Calls/Originating Voice Calls/Originating Voice Calls.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - Calls/Originating Voice Calls/Originating Voice Calls.txt -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_MKR1000/OTA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OTA is not ready for this board yet. 3 | * It could be derived from: 4 | * https://www.hackster.io/flower-platform/program-mkr-over-the-air-goodies-voice-control-etc-562e9a 5 | */ 6 | 7 | void enterOTA() { 8 | BlynkState::set(MODE_ERROR); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - TCP and UDP/Multiple client/Example code with a UDP and TCP connections.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - TCP and UDP/Multiple client/Example code with a UDP and TCP connections.txt -------------------------------------------------------------------------------- /ArduinoJson/scripts/travis/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | curl https://cmake.org/files/v3.4/cmake-3.4.0-Linux-x86_64.tar.gz | tar xz -C /tmp --strip 1 4 | 5 | /tmp/bin/cmake -DCOVERAGE=true . 6 | make 7 | make test 8 | 9 | pip install --user cpp-coveralls 'requests[security]' 10 | coveralls --exclude third-party --gcov-options '\-lp'; fi 11 | -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/fuzz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script mimics an invocation from https://github.com/google/oss-fuzz 3 | 4 | cd $(dirname $0) 5 | export CXX='clang++' 6 | export CXXFLAGS='-fsanitize-coverage=trace-pc-guard -fsanitize=address' 7 | export LIB_FUZZING_ENGINE=-lFuzzer 8 | make OUT=. 9 | ./json_fuzzer my_corpus seed_corpus -max_len=1024 -timeout=10 10 | -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - Calls/Note.txt: -------------------------------------------------------------------------------- 1 | Originating and receiving voice calls 2 | 3 | The code example and the connection diagram shown below are used to originate a voice call and, pushing a button, 4 | end that voice call. The button is connected between digital pin 12 an ground. 5 | A 10kO pull-up resistor is needed at this pin. -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - TCP and UDP/Single Client/Sending data to a TCP server first,then it sends to a UDP server.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode - TCP and UDP/Single Client/Sending data to a TCP server first,then it sends to a UDP server.txt -------------------------------------------------------------------------------- /Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode Sending and receiving SMS/Reads the first SMS into the memory/Reads the first SMS into the memory.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoimer/sim800l-evb/HEAD/Libelium-SIM900-Arduino-SourceCode/Using the shield in standalone mode Sending and receiving SMS/Reads the first SMS into the memory/Reads the first SMS into the memory.txt -------------------------------------------------------------------------------- /ArduinoJson/library.properties: -------------------------------------------------------------------------------- 1 | name=ArduinoJson 2 | version=5.8.3 3 | author=Benoit Blanchon 4 | maintainer=Benoit Blanchon 5 | sentence=An efficient and elegant JSON library for Arduino. 6 | paragraph=Like this project? Please star it on GitHub! 7 | category=Data Processing 8 | url=https://github.com/bblanchon/ArduinoJson 9 | architectures=* 10 | -------------------------------------------------------------------------------- /sim800l-phonebookparser/List-phonebook-response-from-SIM800L.txt: -------------------------------------------------------------------------------- 1 | AT+CPBR=1,10 2 | +CPBR: 1,"121",129,"AtencionCliente" 3 | +CPBR: 2,"123",129,"Consulta saldo" 4 | +CPBR: 3,"124",129,"Buzon de voz412" 5 | +CPBR: 4,"2582",129,"Club Digitel" 6 | +CPBR: 5,"0416xxxxx7",129,"Yoimer" 7 | +CPBR: 6,"0424xxxxx1",129,"Mom" 8 | +CPBR: 7,"0212xxxxx3",129,"Home" 9 | +CPBR: 8,"0416xxxxx9",129,"Brother" 10 | OK 11 | -------------------------------------------------------------------------------- /ArduinoJson/keywords.txt: -------------------------------------------------------------------------------- 1 | JsonArray KEYWORD1 2 | JsonObject KEYWORD1 3 | JsonVariant KEYWORD1 4 | StaticJsonBuffer KEYWORD1 5 | DynamicJsonBuffer KEYWORD1 6 | add KEYWORD2 7 | createArray KEYWORD2 8 | createNestedArray KEYWORD2 9 | createNestedObject KEYWORD2 10 | createObject KEYWORD2 11 | parseArray KEYWORD2 12 | parseObject KEYWORD2 13 | prettyPrintTo KEYWORD2 14 | printTo KEYWORD2 15 | success KEYWORD2 16 | -------------------------------------------------------------------------------- /ArduinoJson/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/JsonPair.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonVariant.hpp" 11 | 12 | namespace ArduinoJson { 13 | 14 | // A key value pair for JsonObject. 15 | struct JsonPair { 16 | const char* key; 17 | JsonVariant value; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /blynk-library/src/Blynk.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Blynk.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Nov 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef Blynk_h 12 | #define Blynk_h 13 | 14 | #include 15 | #warning "Please include a board-specific header file, instead of Blynk.h (see examples)" 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /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/include \ 16 | ArduinoJson/keywords.txt \ 17 | ArduinoJson/library.properties \ 18 | ArduinoJson/LICENSE.md \ 19 | ArduinoJson/README.md \ 20 | ArduinoJson/ArduinoJson.h 21 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/JsonFloat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | #if ARDUINOJSON_USE_DOUBLE 16 | typedef double JsonFloat; 17 | #else 18 | typedef float JsonFloat; 19 | #endif 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /blynk-library/linux/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case "$1" in 4 | raspberry) 5 | sudo apt-get update 6 | sudo apt-get upgrade 7 | sudo apt-get install build-essential git-core 8 | git clone git://git.drogon.net/wiringPi 9 | cd wiringPi 10 | git pull origin 11 | ./build 12 | gpio -v 13 | cd .. 14 | make clean all target=raspberry 15 | exit 0 16 | ;; 17 | linux) 18 | make clean all 19 | exit 0 20 | ;; 21 | esac 22 | 23 | echo "Please specify platform: raspberry, linux" 24 | exit 1 25 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleMKR1000.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleMKR1000.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleMKR1000_h 12 | #define BlynkSimpleMKR1000_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "WiFi" 16 | #endif 17 | 18 | #include 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/Makefile: -------------------------------------------------------------------------------- 1 | # CAUTION: this file is invoked by https://github.com/google/oss-fuzz 2 | 3 | CXXFLAGS += -I../include 4 | 5 | all: \ 6 | $(OUT)/json_fuzzer \ 7 | $(OUT)/json_fuzzer_seed_corpus.zip \ 8 | $(OUT)/json_fuzzer.options 9 | 10 | $(OUT)/json_fuzzer: fuzzer.cpp 11 | $(CXX) $(CXXFLAGS) $< -o$@ $(LIB_FUZZING_ENGINE) 12 | 13 | $(OUT)/json_fuzzer_seed_corpus.zip: seed_corpus/* 14 | zip -j $@ $? 15 | 16 | $(OUT)/json_fuzzer.options: 17 | @echo "[libfuzzer]" > $@ 18 | @echo "max_len = 256" >> $@ 19 | @echo "timeout = 10" >> $@ 20 | -------------------------------------------------------------------------------- /sim800l-httppostmethod/HTTPPOST-Method-Working.txt: -------------------------------------------------------------------------------- 1 | Setup Complete! 2 | AT+SAPBR=3,1,"Contype", "GPRS" 3 | 4 | OK 5 | AT+SAPBR=3,1,"APN","internet.digitel.ve" 6 | 7 | OK 8 | AT+SAPBR=1,1 9 | 10 | OK 11 | AT+SAPBR=2,1 12 | 13 | +SAPBR: 1,1,"10.55.102.122" 14 | 15 | OK 16 | 17 | AT+HTTPINIT 18 | 19 | OK 20 | AT+HTTPPARA="CID",1 21 | 22 | OK 23 | AT+HTTPPARA="URL","www.sim.com" 24 | 25 | OK 26 | AT+HTTPDATA=100,10000 27 | 28 | DOWNLOAD 29 | 30 | OK 31 | AT+HTTPACTION=1 32 | 33 | OK 34 | 35 | +HTTPACTION: 1,200,69 36 | 37 | AT+HTTPTERM 38 | 39 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleWiFly.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleWiFly.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleWiFly_h 12 | #define BlynkSimpleWiFly_h 13 | 14 | #include 15 | 16 | static BlynkTransportWiFly _blynkTransport; 17 | BlynkWiFly Blynk(_blynkTransport); 18 | 19 | #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleParticle.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleParticle.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleParticle_h 12 | #define BlynkSimpleParticle_h 13 | 14 | #include "BlynkParticle.h" 15 | 16 | static BlynkTransportParticle _blynkTransport; 17 | BlynkParticle Blynk(_blynkTransport); 18 | 19 | #include "BlynkWidgets.h" 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ArduinoJson/test/Issue214.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(Issue214, IsBool) { 12 | char json[] = "{\"ota\": {\"enabled\": true}}"; 13 | StaticJsonBuffer jsonBuffer; 14 | JsonObject& parsedJson = jsonBuffer.parseObject(json); 15 | ASSERT_TRUE(parsedJson["ota"]["enabled"].is()); 16 | } 17 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/EnableIf.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T if Condition is true. 14 | template 15 | struct EnableIf {}; 16 | 17 | template 18 | struct EnableIf { 19 | typedef T type; 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleRedBear_Duo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleRedBear_Duo.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Dec 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleRedBear_Duo_h 12 | #define BlynkSimpleRedBear_Duo_h 13 | 14 | #include "BlynkParticle.h" 15 | 16 | static BlynkTransportParticle _blynkTransport; 17 | BlynkParticle Blynk(_blynkTransport); 18 | 19 | #include "BlynkWidgets.h" 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Serialization/DummyPrint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // A dummy Print implementation used in JsonPrintable::measureLength() 16 | class DummyPrint : public Print { 17 | public: 18 | virtual size_t write(uint8_t) { 19 | return 1; 20 | } 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/RawJson.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | 12 | // A special type of data that can be used to insert pregenerated JSON portions. 13 | class RawJson { 14 | public: 15 | explicit RawJson(const char* str) : _str(str) {} 16 | operator const char*() const { 17 | return _str; 18 | } 19 | 20 | private: 21 | const char* _str; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/RemoveConst.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T without the const modifier 14 | template 15 | struct RemoveConst { 16 | typedef T type; 17 | }; 18 | template 19 | struct RemoveConst { 20 | typedef T type; 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Seeeduino_GPRS/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /blynk-library/library.properties: -------------------------------------------------------------------------------- 1 | name=Blynk 2 | version=0.4.4 3 | author=Volodymyr Shymanskyy 4 | maintainer=Volodymyr Shymanskyy 5 | sentence=Build a smartphone app for your project in minutes! 6 | paragraph=It supports WiFi, BLE, Bluetooth, Ethernet, GSM, USB, Serial. Works with many boards like ESP8266, ESP32, Arduino UNO, Nano, Due, Mega, Zero, MKR100, Yun, Raspberry Pi, Particle, Energia, ARM mbed, Intel Edison/Galileo/Joule, BBC micro:bit, DFRobot, RedBearLab, Microduino, LinkIt ONE ... 7 | category=Communication 8 | url=http://blynk.cc 9 | architectures=* 10 | includes=Blynk.h 11 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsFloatingPoint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "IsSame.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace TypeTraits { 14 | 15 | // A meta-function that returns true if T is a floating point type 16 | template 17 | struct IsFloatingPoint { 18 | static const bool value = IsSame::value || IsSame::value; 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/RemoveReference.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T without the reference modifier. 14 | template 15 | struct RemoveReference { 16 | typedef T type; 17 | }; 18 | template 19 | struct RemoveReference { 20 | typedef T type; 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleIntelEdisonWiFi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleIntelEdisonWiFi.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleIntelEdisonWiFi_h 12 | #define BlynkSimpleIntelEdisonWiFi_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "WiFi" 16 | #endif 17 | 18 | #define BLYNK_MINIMIZE_PINMODE_USAGE 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /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 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/bblanchon/ArduinoJson.git" 8 | }, 9 | "version": "5.8.3", 10 | "authors": { 11 | "name": "Benoit Blanchon", 12 | "url": "https://blog.benoitblanchon.fr" 13 | }, 14 | "exclude": [ 15 | "scripts", 16 | "src/ArduinoJson.h", 17 | "test", 18 | "third-party" 19 | ], 20 | "frameworks": "arduino", 21 | "platforms": "*" 22 | } 23 | -------------------------------------------------------------------------------- /sim800l-httpgetmethod/HTTPGET-Method-Working.txt: -------------------------------------------------------------------------------- 1 | Setup Complete! 2 | AT+SAPBR=3,1,"Contype", "GPRS" 3 | 4 | OK 5 | AT+SAPBR=3,1,"APN","internet.digitel.ve" 6 | 7 | OK 8 | AT+SAPBR=1,1 9 | 10 | OK 11 | AT+SAPBR=2,1 12 | 13 | +SAPBR: 1,1,"10.55.102.122" 14 | 15 | OK 16 | AT+HTTPINIT 17 | 18 | OK 19 | AT+HTTPPARA="CID",1 20 | 21 | OK 22 | AT+HTTPPARA="URL","www.sim.com" 23 | 24 | OK 25 | AT+HTTPACTION=0 26 | 27 | OK 28 | 29 | +HTTPACTION: 0,200,69 30 | AT+HTTPREAD 31 | 32 | +HTTPREAD: 69 33 | 34 | OK 35 | AT+HTTPTERM 36 | 37 | OK 38 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsConst.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T without the const modifier 14 | template 15 | struct IsConst { 16 | static const bool value = false; 17 | }; 18 | 19 | template 20 | struct IsConst { 21 | static const bool value = true; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsSame.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that returns true if types T and U are the same. 14 | template 15 | struct IsSame { 16 | static const bool value = false; 17 | }; 18 | 19 | template 20 | struct IsSame { 21 | static const bool value = true; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleWildFire.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleWildFire.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleWildFire_h 12 | #define BlynkSimpleWildFire_h 13 | 14 | #include 15 | 16 | WildFire_CC3000 cc3000; 17 | static BlynkTransportWildFire _blynkTransport(cc3000); 18 | BlynkWildFire Blynk(cc3000, _blynkTransport); 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /blynk-library/linux/BlynkDebug.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkDebug.cpp 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief Debug utilities for Linux 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | size_t BlynkFreeRam() 14 | { 15 | // TODO 16 | return 0; 17 | } 18 | 19 | void BlynkReset() 20 | { 21 | exit(1); 22 | for(;;); // To make compiler happy 23 | } 24 | 25 | void BlynkFatal() 26 | { 27 | BlynkReset(); 28 | } 29 | -------------------------------------------------------------------------------- /ArduinoJson/test/gtest.cmake: -------------------------------------------------------------------------------- 1 | set(GTEST_DIR ../third-party/gtest-1.7.0) 2 | 3 | add_library(gtest 4 | ${GTEST_DIR}/src/gtest-all.cc 5 | ${GTEST_DIR}/src/gtest_main.cc 6 | ) 7 | 8 | target_include_directories(gtest 9 | PUBLIC 10 | ${GTEST_DIR} 11 | ${GTEST_DIR}/include 12 | ) 13 | 14 | 15 | target_compile_definitions(gtest PUBLIC -DGTEST_HAS_PTHREAD=0) 16 | 17 | if (MSVC) 18 | if (MSVC_VERSION EQUAL 1700) 19 | # Workaround for Visual Studio 2012 20 | target_compile_definitions(gtest PUBLIC -D_VARIADIC_MAX=10) 21 | endif() 22 | 23 | target_compile_definitions(gtest PUBLIC -D_CRT_SECURE_NO_WARNINGS) 24 | endif() 25 | -------------------------------------------------------------------------------- /ArduinoJson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Benoit Blanchon 2014-2017 2 | # MIT License 3 | # 4 | # Arduino JSON library 5 | # https://github.com/bblanchon/ArduinoJson 6 | # If you like this project, please add a star! 7 | 8 | cmake_minimum_required(VERSION 3.0) 9 | project(ArduinoJson) 10 | 11 | enable_testing() 12 | 13 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib) 14 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib) 15 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) 16 | 17 | if(${COVERAGE}) 18 | set(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") 19 | endif() 20 | 21 | add_subdirectory(test) 22 | -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/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]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /blynk-library/src/BlynkWidgets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkWidgets.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | // Cannot auto-include as these have library dependencies 20 | //#include 21 | //#include 22 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleStream.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleStream.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2016 Volodymyr Shymanskyy 6 | * @date Mar 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleStream_h 12 | #define BlynkSimpleStream_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "Stream" 16 | #endif 17 | 18 | #include 19 | 20 | BlynkTransportStream _blynkTransport; 21 | BlynkStream Blynk(_blynkTransport); 22 | 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/JsonBufferAllocated.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../JsonBuffer.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | class JsonBufferAllocated { 16 | public: 17 | void *operator new(size_t n, JsonBuffer *jsonBuffer) throw() { 18 | if (!jsonBuffer) return NULL; 19 | return jsonBuffer->alloc(n); 20 | } 21 | 22 | void operator delete(void *, JsonBuffer *)throw() {} 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/JsonVariantDefault.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | template 14 | struct JsonVariantDefault { 15 | static T get() { 16 | return T(); 17 | } 18 | }; 19 | 20 | template 21 | struct JsonVariantDefault : JsonVariantDefault {}; 22 | 23 | template 24 | struct JsonVariantDefault : JsonVariantDefault {}; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleSIM800.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleSIM800.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Nov 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleSIM800_h 12 | #define BlynkSimpleSIM800_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "SIM800" 16 | #endif 17 | 18 | #include 19 | 20 | static BlynkArduinoClient _blynkTransport; 21 | BlynkSIM Blynk(_blynkTransport); 22 | 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/create-build-envs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export PATH="$PATH:/Applications/CMake.app/Contents/bin/" 4 | 5 | cd $(dirname $0)/.. 6 | ROOT=$(pwd) 7 | 8 | mkdir "build" 9 | cd build 10 | BUILD=$(pwd) 11 | 12 | build-env() 13 | { 14 | cd $BUILD 15 | mkdir "$1" 16 | cd "$1" 17 | cmake "$ROOT" -G "$2" 18 | } 19 | 20 | if [[ $(uname) == MINGW* ]] 21 | then 22 | build-env "Make" "MinGW Makefiles" 23 | build-env "SublimeText" "Sublime Text 2 - Ninja" 24 | build-env "VisualStudio" "Visual Studio 14 2015" 25 | else 26 | build-env "SublimeText" "Sublime Text 2 - Ninja" 27 | build-env "Make" "Unix Makefiles" 28 | build-env "Xcode" "Xcode" 29 | fi 30 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleEnergiaWiFi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleEnergiaWiFi.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleEnergiaWiFi_h 12 | #define BlynkSimpleEnergiaWiFi_h 13 | 14 | #include 15 | #include 16 | 17 | static WiFiClient _blynkWifiClient; 18 | static BlynkArduinoClient _blynkTransport(_blynkWifiClient); 19 | BlynkWifiCommon Blynk(_blynkTransport); 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FILE=../bin/ArduinoJsonTests.exe 4 | MD5="" 5 | 6 | file_changed() { 7 | [[ ! -f "$FILE" ]] && return 1 8 | NEW_MD5=$(md5sum $FILE) 9 | [[ "$MD5" == "$NEW_MD5" ]] && return 1 10 | MD5=$NEW_MD5 11 | return 0 12 | } 13 | 14 | test_succeed() { 15 | echo -en "\007"{,} 16 | } 17 | 18 | test_failed() { 19 | echo -en "\007"{,,,,,,,,,,,} 20 | } 21 | 22 | run_tests() { 23 | $FILE 24 | case $? in 25 | 0) 26 | test_succeed 27 | ;; 28 | 1) 29 | test_failed 30 | ;; 31 | esac 32 | } 33 | 34 | while true 35 | do 36 | if file_changed 37 | then 38 | run_tests 39 | else 40 | sleep 2 41 | fi 42 | done 43 | 44 | 45 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/JsonInteger.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | #if ARDUINOJSON_USE_LONG_LONG 16 | typedef long long JsonInteger; 17 | typedef unsigned long long JsonUInt; 18 | #elif ARDUINOJSON_USE_INT64 19 | typedef __int64 JsonInteger; 20 | typedef unsigned _int64 JsonUInt; 21 | #else 22 | typedef long JsonInteger; 23 | typedef unsigned long JsonUInt; 24 | #endif 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/ListNode.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include // for NULL 11 | 12 | #include "JsonBufferAllocated.hpp" 13 | 14 | namespace ArduinoJson { 15 | namespace Internals { 16 | 17 | // A node for a singly-linked list. 18 | // Used by List and its iterators. 19 | template 20 | struct ListNode : public Internals::JsonBufferAllocated { 21 | ListNode() : next(NULL) {} 22 | 23 | ListNode *next; 24 | T content; 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/JsonBufferImpl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "Deserialization/JsonParser.hpp" 11 | 12 | inline ArduinoJson::JsonArray &ArduinoJson::JsonBuffer::createArray() { 13 | JsonArray *ptr = new (this) JsonArray(this); 14 | return ptr ? *ptr : JsonArray::invalid(); 15 | } 16 | 17 | inline ArduinoJson::JsonObject &ArduinoJson::JsonBuffer::createObject() { 18 | JsonObject *ptr = new (this) JsonObject(this); 19 | return ptr ? *ptr : JsonObject::invalid(); 20 | } 21 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/travis/arduino.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -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 | ln -s $PWD /tmp/arduino/libraries/ArduinoJson 13 | 14 | for EXAMPLE in $PWD/examples/*/*.ino; do 15 | arduino --verify --board $BOARD $EXAMPLE 16 | done 17 | -------------------------------------------------------------------------------- /blynk-library/linux/README.md: -------------------------------------------------------------------------------- 1 | # Linux Quick Start Guide (Ubuntu, Raspberry Pi, ...) 2 | 3 | 0. Connect your Raspberry Pi to the internet and open it's console. ^_^ 4 | 5 | 1. Install WiringPi: 6 | http://wiringpi.com/download-and-install/ 7 | 8 | 2. Download and build Blynk: 9 | ```bash 10 | $ git clone https://github.com/blynkkk/blynk-library.git 11 | $ cd blynk-library/linux 12 | $ make clean all target=raspberry 13 | ``` 14 | 15 | 3. Run Blynk: 16 | ```bash 17 | $ sudo ./blynk --token=YourAuthToken 18 | ``` 19 | 20 | We have also provided a build script, you can try just running (inside of the "linux" directory): 21 | 22 | ```bash 23 | $ ./build.sh raspberry 24 | ``` 25 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonObject_Basic_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | #define TEST_(name) TEST(JsonObject_Basic_Tests, name) 12 | 13 | TEST_(InitialSizeIsZero) { 14 | DynamicJsonBuffer _jsonBuffer; 15 | JsonObject& _object = _jsonBuffer.createObject(); 16 | 17 | EXPECT_EQ(0, _object.size()); 18 | } 19 | 20 | TEST_(SuccessIsTrue) { 21 | DynamicJsonBuffer _jsonBuffer; 22 | JsonObject& _object = _jsonBuffer.createObject(); 23 | 24 | EXPECT_TRUE(_object.success()); 25 | } 26 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsArray.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T without the const modifier 14 | template 15 | struct IsArray { 16 | static const bool value = false; 17 | }; 18 | template 19 | struct IsArray { 20 | static const bool value = true; 21 | }; 22 | template 23 | struct IsArray { 24 | static const bool value = true; 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleEnergiaEthernet.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleEnergiaEthernet.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Oct 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleEnergiaEthernet_h 12 | #define BlynkSimpleEnergiaEthernet_h 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | static EthernetClient _blynkEthernetClient; 19 | static BlynkArduinoClient _blynkTransport(_blynkEthernetClient); 20 | BlynkEthernet Blynk(_blynkTransport); 21 | 22 | #include 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsChar.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "IsSame.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace TypeTraits { 14 | 15 | // A meta-function that returns true if T is a charater 16 | template 17 | struct IsChar { 18 | static const bool value = IsSame::value || 19 | IsSame::value || 20 | IsSame::value; 21 | }; 22 | 23 | template 24 | struct IsChar : IsChar {}; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Polyfills/attributes.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #ifdef _MSC_VER 11 | #define FORCE_INLINE __forceinline 12 | #define NO_INLINE __declspec(noinline) 13 | #define DEPRECATED(msg) __declspec(deprecated(msg)) 14 | #else 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 | #endif 23 | -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/fuzzer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class memstream : public std::istream { 4 | struct membuf : std::streambuf { 5 | membuf(const uint8_t *p, size_t l) { 6 | setg((char *)p, (char *)p, (char *)p + l); 7 | } 8 | }; 9 | membuf _buffer; 10 | 11 | public: 12 | memstream(const uint8_t *p, size_t l) 13 | : std::istream(&_buffer), _buffer(p, l) { 14 | rdbuf(&_buffer); 15 | } 16 | }; 17 | 18 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { 19 | DynamicJsonBuffer jsonBuffer; 20 | memstream json(data, size); 21 | JsonVariant variant = jsonBuffer.parse(json); 22 | if (variant.success()) { 23 | variant.as(); // <- serialize to JSON 24 | } 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/travis/cmake.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | if [ $(uname) = 'Darwin' ]; then 4 | URL=https://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.tar.gz 5 | CMAKE=/tmp/CMake.app/Contents/bin/cmake 6 | CTEST=/tmp/CMake.app/Contents/bin/ctest 7 | else 8 | URL=https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz 9 | CMAKE=/tmp/bin/cmake 10 | CTEST=/tmp/bin/ctest 11 | fi 12 | curl -sS $URL | tar xz -C /tmp --strip 1 13 | 14 | if [ -n "$GCC" ]; then 15 | export CC="gcc-$GCC" 16 | export CXX="g++-$GCC" 17 | fi 18 | 19 | if [ -n "$CLANG" ]; then 20 | export CC="clang-$CLANG" 21 | export CXX="clang++-$CLANG" 22 | fi 23 | 24 | if [ -n "$SANITIZE" ]; then 25 | export CXXFLAGS="-fsanitize=$SANITIZE" 26 | fi 27 | 28 | $CMAKE . 29 | $CMAKE --build . 30 | $CTEST -VV . 31 | -------------------------------------------------------------------------------- /ArduinoJson/test/DynamicJsonBuffer_Object_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(DynamicJsonBuffer_Object_Tests, GrowsWithObject) { 12 | DynamicJsonBuffer json; 13 | 14 | JsonObject &obj = json.createObject(); 15 | ASSERT_EQ(JSON_OBJECT_SIZE(0), json.size()); 16 | 17 | obj["hello"] = 1; 18 | ASSERT_EQ(JSON_OBJECT_SIZE(1), json.size()); 19 | 20 | obj["world"] = 2; 21 | ASSERT_EQ(JSON_OBJECT_SIZE(2), json.size()); 22 | 23 | obj["world"] = 3; // <- same key, should not grow 24 | ASSERT_EQ(JSON_OBJECT_SIZE(2), json.size()); 25 | } 26 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleEthernetV2_0.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleEthernet.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleEthernetV2_0_h 12 | #define BlynkSimpleEthernetV2_0_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "W5200" 16 | #endif 17 | 18 | #include 19 | #include 20 | 21 | static EthernetClient _blynkEthernetClient; 22 | static BlynkArduinoClient _blynkTransport(_blynkEthernetClient); 23 | BlynkEthernet Blynk(_blynkTransport); 24 | 25 | #include 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleWiFiShield101.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleWiFiShield101.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleWiFiShield101_h 12 | #define BlynkSimpleWiFiShield101_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "WiFi101" 16 | #endif 17 | 18 | #include 19 | #include 20 | 21 | static WiFiClient _blynkWifiClient; 22 | static BlynkArduinoClient _blynkTransport(_blynkWifiClient); 23 | BlynkWifiCommon Blynk(_blynkTransport); 24 | 25 | #include 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleSerialBLE.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSerialBLE.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2016 Volodymyr Shymanskyy 6 | * @date Mar 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSerialBLE_h 12 | #define BlynkSerialBLE_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "SerialBLE" 16 | #endif 17 | 18 | #define BLYNK_SEND_ATOMIC 19 | #define BLYNK_SEND_CHUNK 20 20 | #define BLYNK_SEND_THROTTLE 40 21 | #define BLYNK_NO_INFO 22 | 23 | #include 24 | 25 | BlynkTransportStream _blynkTransport; 26 | BlynkStream Blynk(_blynkTransport); 27 | 28 | #include 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleWiFiShield101_SSL.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleWiFiShield101.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleWiFiShield101_h 12 | #define BlynkSimpleWiFiShield101_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "WiFi101" 16 | #endif 17 | 18 | #include 19 | #include 20 | 21 | static WiFiSSLClient _blynkWifiClient; 22 | static BlynkArduinoClient _blynkTransport(_blynkWifiClient); 23 | BlynkWifiCommon Blynk(_blynkTransport); 24 | 25 | #include 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ArduinoJson/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 5.8.3.{build} 2 | environment: 3 | matrix: 4 | - CMAKE_GENERATOR: Visual Studio 14 2015 5 | - CMAKE_GENERATOR: Visual Studio 12 2013 6 | - CMAKE_GENERATOR: Visual Studio 11 2012 7 | - CMAKE_GENERATOR: Visual Studio 10 2010 8 | # - CMAKE_GENERATOR: MinGW Makefiles 9 | # Note: Disabled because of unexplicated error -1073741511 10 | # This used to work fine with GCC 4.8.2 then failed after they upgraded to GCC 4.9.3 11 | configuration: Debug 12 | before_build: 13 | - set PATH=C:\MinGW\bin;%PATH:C:\Program Files\Git\usr\bin;=% # Workaround for CMake not wanting sh.exe on PATH for MinGW 14 | - cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%CMAKE_GENERATOR%" . 15 | build_script: 16 | - cmake --build . --config %CONFIGURATION% 17 | test_script: 18 | - ctest -V . 19 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonObject_Get_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | class JsonObject_Get_Tests : public ::testing::Test { 12 | public: 13 | JsonObject_Get_Tests() : _object(_jsonBuffer.createObject()) {} 14 | 15 | protected: 16 | DynamicJsonBuffer _jsonBuffer; 17 | JsonObject& _object; 18 | }; 19 | 20 | #define TEST_(name) TEST_F(JsonObject_Get_Tests, name) 21 | 22 | TEST_(GetConstCharPointer_GivenStringLiteral) { 23 | _object.set("hello", "world"); 24 | const char* value = _object.get("hello"); 25 | EXPECT_STREQ("world", value); 26 | } 27 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleEthernet.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleEthernet.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleEthernet_h 12 | #define BlynkSimpleEthernet_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "W5100" 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | static EthernetClient _blynkEthernetClient; 23 | static BlynkArduinoClient _blynkTransport(_blynkEthernetClient); 24 | BlynkEthernet Blynk(_blynkTransport); 25 | 26 | #include 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleEthernet2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleEthernet2.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleEthernet2_h 12 | #define BlynkSimpleEthernet2_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "W5500" 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | static EthernetClient _blynkEthernetClient; 23 | static BlynkArduinoClient _blynkTransport(_blynkEthernetClient); 24 | BlynkEthernet Blynk(_blynkTransport); 25 | 26 | #include 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleUIPEthernet.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleUipEthernet.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleUipEthernet_h 12 | #define BlynkSimpleUipEthernet_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "ENC28J60" 16 | #endif 17 | 18 | #define BLYNK_ENC28J60_FIX 19 | #include 20 | #include 21 | 22 | static EthernetClient _blynkEthernetClient; 23 | static BlynkArduinoClient _blynkTransport(_blynkEthernetClient); 24 | BlynkEthernet Blynk(_blynkTransport); 25 | 26 | #include 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/JsonArrayImpl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonArray.hpp" 11 | #include "JsonArraySubscript.hpp" 12 | #include "JsonObject.hpp" 13 | 14 | namespace ArduinoJson { 15 | 16 | inline JsonArray &JsonArray::createNestedArray() { 17 | if (!_buffer) return JsonArray::invalid(); 18 | JsonArray &array = _buffer->createArray(); 19 | add(array); 20 | return array; 21 | } 22 | 23 | inline JsonObject &JsonArray::createNestedObject() { 24 | if (!_buffer) return JsonObject::invalid(); 25 | JsonObject &object = _buffer->createObject(); 26 | add(object); 27 | return object; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "ArduinoJson/DynamicJsonBuffer.hpp" 11 | #include "ArduinoJson/JsonArray.hpp" 12 | #include "ArduinoJson/JsonObject.hpp" 13 | #include "ArduinoJson/JsonVariantComparisons.hpp" 14 | #include "ArduinoJson/StaticJsonBuffer.hpp" 15 | 16 | #include "ArduinoJson/Deserialization/JsonParserImpl.hpp" 17 | #include "ArduinoJson/JsonArrayImpl.hpp" 18 | #include "ArduinoJson/JsonBufferImpl.hpp" 19 | #include "ArduinoJson/JsonObjectImpl.hpp" 20 | #include "ArduinoJson/JsonVariantImpl.hpp" 21 | #include "ArduinoJson/Serialization/JsonSerializerImpl.hpp" 22 | 23 | using namespace ArduinoJson; 24 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsBaseOf.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that returns true if Derived inherits from TBase is an 14 | // integral type. 15 | template 16 | class IsBaseOf { 17 | protected: // <- to avoid GCC's "all member functions in class are private" 18 | typedef char Yes[1]; 19 | typedef char No[2]; 20 | 21 | static Yes &probe(const TBase *); 22 | static No &probe(...); 23 | 24 | public: 25 | enum { 26 | value = sizeof(probe(reinterpret_cast(0))) == sizeof(Yes) 27 | }; 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /blynk-library/src/WidgetMap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file WidgetMap.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2016 Volodymyr Shymanskyy 6 | * @date Nov 2016 7 | * @brief 8 | */ 9 | 10 | #ifndef WidgetMap_h 11 | #define WidgetMap_h 12 | 13 | #include 14 | 15 | class WidgetMap 16 | : public BlynkWidgetBase 17 | { 18 | public: 19 | WidgetMap(uint8_t vPin) : BlynkWidgetBase(vPin) {} 20 | 21 | void clear() { 22 | Blynk.virtualWrite(mPin, "clr"); 23 | } 24 | 25 | template 26 | void location(const T1& index, const T2& lat, const T3& lon, const T4& value) { 27 | Blynk.virtualWrite(mPin, index, lat, lon, value); 28 | } 29 | 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonObject_Remove_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | #define TEST_(name) TEST(JsonObject_Remove_Tests, name) 12 | 13 | TEST_(SizeDecreased_WhenValuesAreRemoved) { 14 | DynamicJsonBuffer _jsonBuffer; 15 | JsonObject& _object = _jsonBuffer.createObject(); 16 | _object["hello"] = 1; 17 | 18 | _object.remove("hello"); 19 | 20 | EXPECT_EQ(0, _object.size()); 21 | } 22 | 23 | TEST_(SizeUntouched_WhenRemoveIsCalledWithAWrongKey) { 24 | DynamicJsonBuffer _jsonBuffer; 25 | JsonObject& _object = _jsonBuffer.createObject(); 26 | _object["hello"] = 1; 27 | 28 | _object.remove("world"); 29 | 30 | EXPECT_EQ(1, _object.size()); 31 | } 32 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleWifi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleWifi.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jan 2015 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef BlynkSimpleWifi_h 12 | #define BlynkSimpleWifi_h 13 | 14 | #ifndef BLYNK_INFO_CONNECTION 15 | #define BLYNK_INFO_CONNECTION "HDG204" 16 | #endif 17 | 18 | // Fix for WiFi shield (it has a crazy ping duration) 19 | #define BLYNK_TIMEOUT_MS 6000UL 20 | #define BLYNK_SEND_ATOMIC 21 | #define BLYNK_SEND_CHUNK 64 22 | 23 | #include 24 | #include 25 | 26 | static WiFiClient _blynkWifiClient; 27 | static BlynkArduinoClient _blynkTransport(_blynkWifiClient); 28 | BlynkWifiCommon Blynk(_blynkTransport); 29 | 30 | #include 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Print.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #ifndef ARDUINO 11 | 12 | #include 13 | #include 14 | 15 | namespace ArduinoJson { 16 | // This class reproduces Arduino's Print class 17 | class Print { 18 | public: 19 | virtual ~Print() {} 20 | 21 | virtual size_t write(uint8_t) = 0; 22 | 23 | size_t print(const char* s) { 24 | size_t n = 0; 25 | while (*s) { 26 | n += write(static_cast(*s++)); 27 | } 28 | return n; 29 | } 30 | 31 | size_t println() { 32 | size_t n = 0; 33 | n += write('\r'); 34 | n += write('\n'); 35 | return n; 36 | } 37 | }; 38 | } 39 | 40 | #else 41 | 42 | #include 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleCC3000.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleCC3000.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief 8 | */ 9 | 10 | #ifndef BlynkSimpleCC3000_h 11 | #define BlynkSimpleCC3000_h 12 | 13 | #include 14 | #include 15 | 16 | // Use hardware SPI for the remaining pins 17 | // SCK = 13, MISO = 12, and MOSI = 11 18 | Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, 19 | SPI_CLOCK_DIVIDER); // you can change this clock speed 20 | 21 | static BlynkTransportCC3000 _blynkTransport(cc3000); 22 | BlynkCC3000 Blynk(cc3000, _blynkTransport); 23 | 24 | #include 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Serialization/DynamicStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | #include "../StringTraits/StringTraits.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | // A Print implementation that allows to write in a String 17 | template 18 | class DynamicStringBuilder : public Print { 19 | public: 20 | DynamicStringBuilder(TString &str) : _str(str) {} 21 | 22 | virtual size_t write(uint8_t c) { 23 | StringTraits::append(_str, static_cast(c)); 24 | return 1; 25 | } 26 | 27 | private: 28 | DynamicStringBuilder &operator=(const DynamicStringBuilder &); 29 | 30 | TString &_str; 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Serialization/StaticStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // A Print implementation that allows to write in a char[] 16 | class StaticStringBuilder : public Print { 17 | public: 18 | StaticStringBuilder(char *buf, size_t size) 19 | : buffer(buf), capacity(size - 1), length(0) { 20 | buffer[0] = '\0'; 21 | } 22 | 23 | virtual size_t write(uint8_t c) { 24 | if (length >= capacity) return 0; 25 | 26 | buffer[length++] = c; 27 | buffer[length] = '\0'; 28 | return 1; 29 | } 30 | 31 | private: 32 | char *buffer; 33 | size_t capacity; 34 | size_t length; 35 | }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/JsonObjectImpl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonArray.hpp" 11 | #include "JsonObject.hpp" 12 | #include "JsonObjectSubscript.hpp" 13 | 14 | namespace ArduinoJson { 15 | 16 | template 17 | inline JsonArray &JsonObject::createNestedArray_impl(TStringRef key) { 18 | if (!_buffer) return JsonArray::invalid(); 19 | JsonArray &array = _buffer->createArray(); 20 | set(key, array); 21 | return array; 22 | } 23 | 24 | template 25 | inline JsonObject &JsonObject::createNestedObject_impl(TStringRef key) { 26 | if (!_buffer) return JsonObject::invalid(); 27 | JsonObject &object = _buffer->createObject(); 28 | set(key, object); 29 | return object; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Serialization/StreamPrintAdapter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | 12 | #if ARDUINOJSON_ENABLE_STD_STREAM 13 | 14 | #include "../Print.hpp" 15 | 16 | #include 17 | 18 | namespace ArduinoJson { 19 | namespace Internals { 20 | 21 | class StreamPrintAdapter : public Print { 22 | public: 23 | explicit StreamPrintAdapter(std::ostream& os) : _os(os) {} 24 | 25 | virtual size_t write(uint8_t c) { 26 | _os << static_cast(c); 27 | return 1; 28 | } 29 | 30 | private: 31 | // cannot be assigned 32 | StreamPrintAdapter& operator=(const StreamPrintAdapter&); 33 | 34 | std::ostream& _os; 35 | }; 36 | } 37 | } 38 | 39 | #endif // ARDUINOJSON_ENABLE_STD_STREAM 40 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "IsSame.hpp" 11 | #include "IsSignedIntegral.hpp" 12 | #include "IsUnsignedIntegral.hpp" 13 | 14 | namespace ArduinoJson { 15 | namespace TypeTraits { 16 | 17 | // A meta-function that returns true if T is an integral type. 18 | template 19 | struct IsIntegral { 20 | static const bool value = TypeTraits::IsSignedIntegral::value || 21 | TypeTraits::IsUnsignedIntegral::value || 22 | TypeTraits::IsSame::value || 23 | TypeTraits::IsSame::value; 24 | }; 25 | 26 | template 27 | struct IsIntegral : IsIntegral {}; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/JsonVariantContent.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonFloat.hpp" 11 | #include "JsonInteger.hpp" 12 | 13 | namespace ArduinoJson { 14 | 15 | // Forward declarations 16 | class JsonArray; 17 | class JsonObject; 18 | 19 | namespace Internals { 20 | // A union that defines the actual content of a JsonVariant. 21 | // The enum JsonVariantType determines which member is in use. 22 | union JsonVariantContent { 23 | JsonFloat asFloat; // used for double and float 24 | JsonUInt asInteger; // used for bool, char, short, int and longs 25 | const char* asString; // asString can be null 26 | JsonArray* asArray; // asArray cannot be null 27 | JsonObject* asObject; // asObject cannot be null 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /blynk-library/src/WidgetLCD.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file WidgetLCD.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief 8 | */ 9 | 10 | #ifndef WidgetLCD_h 11 | #define WidgetLCD_h 12 | 13 | #include 14 | 15 | class WidgetLCD 16 | : public BlynkWidgetBase 17 | { 18 | public: 19 | WidgetLCD(uint8_t vPin) : BlynkWidgetBase(vPin) {} 20 | 21 | void clear() { 22 | Blynk.virtualWrite(mPin, "clr"); 23 | } 24 | 25 | template 26 | void print(int x, int y, const T& str) { 27 | char mem[BLYNK_MAX_SENDBYTES]; 28 | BlynkParam cmd(mem, 0, sizeof(mem)); 29 | cmd.add("p"); 30 | cmd.add(x); 31 | cmd.add(y); 32 | cmd.add(str); 33 | Blynk.virtualWrite(mPin, cmd); 34 | } 35 | 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /blynk-library/src/WidgetLED.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file WidgetLED.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Apr 2015 7 | * @brief 8 | */ 9 | 10 | #ifndef WidgetLED_h 11 | #define WidgetLED_h 12 | 13 | #include 14 | 15 | class WidgetLED 16 | : public BlynkWidgetBase 17 | { 18 | public: 19 | WidgetLED(uint8_t vPin) 20 | : BlynkWidgetBase(vPin) 21 | , mValue(0) 22 | {} 23 | 24 | uint8_t getValue() const { 25 | return mValue; 26 | } 27 | 28 | void setValue(uint8_t value) { 29 | mValue = value; 30 | Blynk.virtualWrite(mPin, value); 31 | } 32 | 33 | void on() { 34 | setValue(255); 35 | } 36 | 37 | void off() { 38 | setValue(0); 39 | } 40 | 41 | private: 42 | uint8_t mValue; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /ArduinoJson/examples/IndentedPrintExample/IndentedPrintExample.ino: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | 10 | using namespace ArduinoJson::Internals; 11 | 12 | void setup() { 13 | Serial.begin(9600); 14 | while (!Serial) { 15 | // wait serial port initialization 16 | } 17 | 18 | IndentedPrint serial(Serial); 19 | serial.setTabSize(4); 20 | 21 | serial.println("This is at indentation 0"); 22 | serial.indent(); 23 | serial.println("This is at indentation 1"); 24 | serial.println("This is also at indentation 1"); 25 | serial.indent(); 26 | serial.println("This is at indentation 2"); 27 | 28 | serial.unindent(); 29 | serial.unindent(); 30 | serial.println("This is back at indentation 0"); 31 | } 32 | 33 | void loop() { 34 | // not used in this example 35 | } 36 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Serialization/JsonSerializer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonWriter.hpp" 11 | 12 | namespace ArduinoJson { 13 | 14 | class JsonArray; 15 | class JsonArraySubscript; 16 | class JsonObject; 17 | template 18 | class JsonObjectSubscript; 19 | class JsonVariant; 20 | 21 | namespace Internals { 22 | 23 | class JsonSerializer { 24 | public: 25 | static void serialize(const JsonArray &, JsonWriter &); 26 | static void serialize(const JsonArraySubscript &, JsonWriter &); 27 | static void serialize(const JsonObject &, JsonWriter &); 28 | template 29 | static void serialize(const JsonObjectSubscript &, JsonWriter &); 30 | static void serialize(const JsonVariant &, JsonWriter &); 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ArduinoJson/test/DynamicJsonBuffer_Array_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(DynamicJsonBuffer_Array_Tests, GrowsWithArray) { 12 | DynamicJsonBuffer jsonBuffer; 13 | 14 | JsonArray &array = jsonBuffer.createArray(); 15 | ASSERT_EQ(JSON_ARRAY_SIZE(0), jsonBuffer.size()); 16 | 17 | array.add("hello"); 18 | ASSERT_EQ(JSON_ARRAY_SIZE(1), jsonBuffer.size()); 19 | 20 | array.add("world"); 21 | ASSERT_EQ(JSON_ARRAY_SIZE(2), jsonBuffer.size()); 22 | } 23 | 24 | TEST(DynamicJsonBuffer_Array_Tests, CanAdd1000Values) { 25 | DynamicJsonBuffer jsonBuffer; 26 | 27 | JsonArray &array = jsonBuffer.createArray(); 28 | 29 | for (int i = 1; i <= 1000; i++) { 30 | array.add("hello"); 31 | ASSERT_EQ(array.size(), i); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Deserialization/StringWriter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | template 14 | class StringWriter { 15 | public: 16 | class String { 17 | public: 18 | String(TChar** ptr) : _writePtr(ptr), _startPtr(*ptr) {} 19 | 20 | void append(TChar c) { 21 | *(*_writePtr)++ = c; 22 | } 23 | 24 | const char* c_str() const { 25 | *(*_writePtr)++ = 0; 26 | return reinterpret_cast(_startPtr); 27 | } 28 | 29 | private: 30 | TChar** _writePtr; 31 | TChar* _startPtr; 32 | }; 33 | 34 | StringWriter(TChar* buffer) : _ptr(buffer) {} 35 | 36 | String startString() { 37 | return String(&_ptr); 38 | } 39 | 40 | private: 41 | TChar* _ptr; 42 | }; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/ReferenceType.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | // A type that is meant to be used by reference only (JsonArray and JsonObject) 14 | class ReferenceType { 15 | public: 16 | bool operator==(const ReferenceType& other) const { 17 | // two JsonArray are equal if they are the same instance 18 | // (we don't compare the content) 19 | return this == &other; 20 | } 21 | 22 | bool operator!=(const ReferenceType& other) const { 23 | return this != &other; 24 | } 25 | 26 | protected: 27 | ReferenceType() {} 28 | 29 | private: 30 | // copy constructor is private 31 | ReferenceType(const ReferenceType&); 32 | 33 | // copy operator is private 34 | ReferenceType& operator=(const ReferenceType&); 35 | }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Samples/FrameworkSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.gtest.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /blynk-library/linux/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.cpp 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief 8 | */ 9 | 10 | //#define BLYNK_DEBUG 11 | #define BLYNK_PRINT stdout 12 | #ifdef RASPBERRY 13 | #include 14 | #else 15 | #include 16 | #endif 17 | #include 18 | #include 19 | 20 | static BlynkTransportSocket _blynkTransport; 21 | BlynkSocket Blynk(_blynkTransport); 22 | 23 | #include 24 | 25 | BLYNK_WRITE(V1) 26 | { 27 | printf("Got a value: %s\n", param[0].asStr()); 28 | } 29 | 30 | int main(int argc, char* argv[]) 31 | { 32 | const char *auth, *serv; 33 | uint16_t port; 34 | parse_options(argc, argv, auth, serv, port); 35 | 36 | Blynk.begin(auth, serv, port); 37 | 38 | while(true) { 39 | Blynk.run(); 40 | } 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/JsonVariantAs.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | // A metafunction that returns the type of the value returned by 14 | // JsonVariant::as() 15 | template 16 | struct JsonVariantAs { 17 | typedef T type; 18 | }; 19 | 20 | template <> 21 | struct JsonVariantAs { 22 | typedef const char* type; 23 | }; 24 | 25 | template <> 26 | struct JsonVariantAs { 27 | typedef JsonArray& type; 28 | }; 29 | 30 | template <> 31 | struct JsonVariantAs { 32 | typedef const JsonArray& type; 33 | }; 34 | 35 | template <> 36 | struct JsonVariantAs { 37 | typedef JsonObject& type; 38 | }; 39 | 40 | template <> 41 | struct JsonVariantAs { 42 | typedef const JsonObject& type; 43 | }; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonArray_Invalid_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(JsonArray_Invalid_Tests, SubscriptFails) { 12 | ASSERT_FALSE(JsonArray::invalid()[0].success()); 13 | } 14 | 15 | TEST(JsonArray_Invalid_Tests, AddFails) { 16 | JsonArray& array = JsonArray::invalid(); 17 | array.add(1); 18 | ASSERT_EQ(0, array.size()); 19 | } 20 | 21 | TEST(JsonArray_Invalid_Tests, CreateNestedArrayFails) { 22 | ASSERT_FALSE(JsonArray::invalid().createNestedArray().success()); 23 | } 24 | 25 | TEST(JsonArray_Invalid_Tests, CreateNestedObjectFails) { 26 | ASSERT_FALSE(JsonArray::invalid().createNestedObject().success()); 27 | } 28 | 29 | TEST(JsonArray_Invalid_Tests, PrintToWritesBrackets) { 30 | char buffer[32]; 31 | JsonArray::invalid().printTo(buffer, sizeof(buffer)); 32 | ASSERT_STREQ("[]", buffer); 33 | } 34 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Polyfills/normalize.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Polyfills { 12 | 13 | #ifdef ARDUINO 14 | 15 | // on embedded platform, favor code size over speed 16 | 17 | template 18 | short normalize(T& value) { 19 | short powersOf10 = 0; 20 | while (value && value < 1) { 21 | powersOf10--; 22 | value *= 10; 23 | } 24 | while (value > 10) { 25 | powersOf10++; 26 | value /= 10; 27 | } 28 | return powersOf10; 29 | } 30 | 31 | #else 32 | 33 | // on non-embedded platform, favor speed over code size 34 | 35 | template 36 | short normalize(T& value) { 37 | if (value == 0.0) return 0; 38 | 39 | short powersOf10 = static_cast(floor(log10(value))); 40 | value /= pow(T(10), powersOf10); 41 | 42 | return powersOf10; 43 | } 44 | 45 | #endif 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ArduinoJson/test/Issue90.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include // for LONG_MAX 10 | 11 | #define ARDUINOJSON_USE_LONG_LONG 0 12 | #define ARDUINOJSON_USE_INT64 0 13 | #include 14 | 15 | #define SUITE Issue90 16 | 17 | static const char* superLong = 18 | "12345678901234567890123456789012345678901234567890123456789012345678901234" 19 | "5678901234567890123456789012345678901234567890123456789012345678901234567"; 20 | 21 | static const JsonVariant variant = RawJson(superLong); 22 | 23 | TEST(SUITE, IsNotALong) { 24 | ASSERT_FALSE(variant.is()); 25 | } 26 | 27 | TEST(SUITE, AsLong) { 28 | ASSERT_EQ(LONG_MAX, variant.as()); 29 | } 30 | 31 | TEST(SUITE, IsAString) { 32 | ASSERT_FALSE(variant.is()); 33 | } 34 | 35 | TEST(SUITE, AsString) { 36 | ASSERT_STREQ(superLong, variant.as()); 37 | } 38 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/Encoding.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | class Encoding { 16 | public: 17 | // Optimized for code size on a 8-bit AVR 18 | static char escapeChar(char c) { 19 | const char *p = escapeTable(false); 20 | while (p[0] && p[1] != c) { 21 | p += 2; 22 | } 23 | return p[0]; 24 | } 25 | 26 | // Optimized for code size on a 8-bit AVR 27 | static char unescapeChar(char c) { 28 | const char *p = escapeTable(true); 29 | for (;;) { 30 | if (p[0] == '\0') return c; 31 | if (p[0] == c) return p[1]; 32 | p += 2; 33 | } 34 | } 35 | 36 | private: 37 | static const char *escapeTable(bool excludeIdenticals) { 38 | return &"\"\"\\\\b\bf\fn\nr\rt\t"[excludeIdenticals ? 4 : 0]; 39 | } 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonObject_Invalid_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(JsonObject_Invalid_Tests, SubscriptFails) { 12 | ASSERT_FALSE(JsonObject::invalid()["key"].success()); 13 | } 14 | 15 | TEST(JsonObject_Invalid_Tests, AddFails) { 16 | JsonObject& object = JsonObject::invalid(); 17 | object.set("hello", "world"); 18 | ASSERT_EQ(0, object.size()); 19 | } 20 | 21 | TEST(JsonObject_Invalid_Tests, CreateNestedArrayFails) { 22 | ASSERT_FALSE(JsonObject::invalid().createNestedArray("hello").success()); 23 | } 24 | 25 | TEST(JsonObject_Invalid_Tests, CreateNestedObjectFails) { 26 | ASSERT_FALSE(JsonObject::invalid().createNestedObject("world").success()); 27 | } 28 | 29 | TEST(JsonObject_Invalid_Tests, PrintToWritesBraces) { 30 | char buffer[32]; 31 | JsonObject::invalid().printTo(buffer, sizeof(buffer)); 32 | ASSERT_STREQ("{}", buffer); 33 | } 34 | -------------------------------------------------------------------------------- /ArduinoJson/test/Deprecated_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #define ARDUINOJSON_ENABLE_DEPRECATED 1 9 | 10 | #include 11 | #include 12 | 13 | #if defined(__clang__) 14 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 15 | #elif defined(__GNUC__) 16 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 17 | #elif defined(_MSC_VER) 18 | #pragma warning(disable : 4996) 19 | #endif 20 | 21 | TEST(Deprecated, asArray) { 22 | DynamicJsonBuffer jsonBuffer; 23 | JsonVariant variant = jsonBuffer.createArray(); 24 | ASSERT_TRUE(variant.asArray().success()); 25 | } 26 | 27 | TEST(Deprecated, asObject) { 28 | DynamicJsonBuffer jsonBuffer; 29 | JsonVariant variant = jsonBuffer.createObject(); 30 | ASSERT_TRUE(variant.asObject().success()); 31 | } 32 | 33 | TEST(Deprecated, asString) { 34 | JsonVariant variant = "hello"; 35 | ASSERT_STREQ("hello", variant.asString()); 36 | } 37 | -------------------------------------------------------------------------------- /Seeeduino_GPRS/example/SIM800_Serial_Debug/SIM800_Serial_Debug.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Sketch: SIM800 Serial Debug 3 | 4 | Function: This sketch is used to communicate with SIM800 with AT commands. 5 | ********************************************************************************* 6 | note: the following pins has been used and should not be used for other purposes. 7 | pin 8 // tx pin 8 | pin 7 // rx pin 9 | pin 9 // power key pin 10 | pin 12 // power status pin 11 | ********************************************************************************* 12 | created on 2013/12/5, version: 0.1 13 | by lawliet.zou(lawliet.zou@gmail.com) 14 | */ 15 | 16 | #include "gprs.h" 17 | #include 18 | 19 | GPRS gprs(9600);//BaudRate 20 | 21 | void setup(){ 22 | Serial.begin(9600); 23 | while(!Serial); 24 | Serial.println("Serial debug begin..."); 25 | gprs.preInit();//Power on SIM800 26 | while(0 != gprs.sendATTest()) 27 | { 28 | Serial.println("sim800 init error!"); 29 | } 30 | Serial.println("sim800 init O.K!"); 31 | } 32 | 33 | void loop(){ 34 | gprs.serialDebug(); 35 | } 36 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_ESP8266/BlynkState.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * 4 | * If you would like to add these features to your product, 5 | * please contact Blynk for Business: 6 | * 7 | * http://www.blynk.io/ 8 | * 9 | **************************************************************/ 10 | 11 | enum State { 12 | MODE_WAIT_CONFIG, 13 | MODE_CONFIGURING, 14 | MODE_CONNECTING_NET, 15 | MODE_CONNECTING_CLOUD, 16 | MODE_RUNNING, 17 | MODE_OTA_UPGRADE, 18 | MODE_ERROR, 19 | 20 | MODE_MAX_VALUE 21 | }; 22 | 23 | #if defined(DEBUG) 24 | const char* StateStr[MODE_MAX_VALUE] = { 25 | "WAIT_CONFIG", 26 | "CONFIGURING", 27 | "CONNECTING_NET", 28 | "CONNECTING_CLOUD", 29 | "RUNNING", 30 | "OTA_UPGRADE", 31 | "ERROR" 32 | }; 33 | #endif 34 | 35 | namespace BlynkState 36 | { 37 | volatile State state; 38 | 39 | State get() { return state; } 40 | bool is (State m) { return (state == m); } 41 | void set(State m); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_MKR1000/BlynkState.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * 4 | * If you would like to add these features to your product, 5 | * please contact Blynk for Business: 6 | * 7 | * http://www.blynk.io/ 8 | * 9 | **************************************************************/ 10 | 11 | enum State { 12 | MODE_WAIT_CONFIG, 13 | MODE_CONFIGURING, 14 | MODE_CONNECTING_NET, 15 | MODE_CONNECTING_CLOUD, 16 | MODE_RUNNING, 17 | MODE_OTA_UPGRADE, 18 | MODE_ERROR, 19 | 20 | MODE_MAX_VALUE 21 | }; 22 | 23 | #if defined(DEBUG) 24 | const char* StateStr[MODE_MAX_VALUE] = { 25 | "WAIT_CONFIG", 26 | "CONFIGURING", 27 | "CONNECTING_NET", 28 | "CONNECTING_CLOUD", 29 | "RUNNING", 30 | "OTA_UPGRADE", 31 | "ERROR" 32 | }; 33 | #endif 34 | 35 | namespace BlynkState 36 | { 37 | volatile State state; 38 | 39 | State get() { return state; } 40 | bool is (State m) { return (state == m); } 41 | void set(State m); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/myPlant_ESP8266/BlynkState.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * 4 | * If you would like to add these features to your product, 5 | * please contact Blynk for Business: 6 | * 7 | * http://www.blynk.io/ 8 | * 9 | **************************************************************/ 10 | 11 | enum State { 12 | MODE_WAIT_CONFIG, 13 | MODE_CONFIGURING, 14 | MODE_CONNECTING_NET, 15 | MODE_CONNECTING_CLOUD, 16 | MODE_RUNNING, 17 | MODE_OTA_UPGRADE, 18 | MODE_ERROR, 19 | 20 | MODE_MAX_VALUE 21 | }; 22 | 23 | #if defined(DEBUG) 24 | const char* StateStr[MODE_MAX_VALUE] = { 25 | "WAIT_CONFIG", 26 | "CONFIGURING", 27 | "CONNECTING_NET", 28 | "CONNECTING_CLOUD", 29 | "RUNNING", 30 | "OTA_UPGRADE", 31 | "ERROR" 32 | }; 33 | #endif 34 | 35 | namespace BlynkState 36 | { 37 | volatile State state; 38 | 39 | State get() { return state; } 40 | bool is (State m) { return (state == m); } 41 | void set(State m); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /blynk-library/src/BlynkSimpleTinyDuino.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkSimpleTinyDuino.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2015 7 | * @brief 8 | */ 9 | 10 | #ifndef BlynkSimpleTinyDuino_h 11 | #define BlynkSimpleTinyDuino_h 12 | 13 | #ifndef BLYNK_INFO_DEVICE 14 | #define BLYNK_INFO_DEVICE "TinyDuino" 15 | #endif 16 | 17 | #include 18 | #include 19 | 20 | // Pin definitions for the TinyCircuits WiFi TinyShield 21 | #define ADAFRUIT_CC3000_IRQ 2 22 | #define ADAFRUIT_CC3000_VBAT A3 23 | #define ADAFRUIT_CC3000_CS 8 24 | 25 | // Use hardware SPI for the remaining pins (on an UNO, SCK = 13, MISO = 12, and MOSI = 11) 26 | Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIVIDER); 27 | 28 | static BlynkTransportCC3000 _blynkTransport(cc3000); 29 | BlynkCC3000 Blynk(cc3000, _blynkTransport); 30 | 31 | #include 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ArduinoJson/fuzzing/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 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonArray_Iterator_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | template 12 | static void run_iterator_test() { 13 | StaticJsonBuffer jsonBuffer; 14 | 15 | JsonArray &array = jsonBuffer.createArray(); 16 | array.add(12); 17 | array.add(34); 18 | 19 | TIterator it = array.begin(); 20 | TIterator end = array.end(); 21 | 22 | EXPECT_NE(end, it); 23 | EXPECT_EQ(12, it->template as()); 24 | EXPECT_EQ(12, static_cast(*it)); 25 | ++it; 26 | EXPECT_NE(end, it); 27 | EXPECT_EQ(34, it->template as()); 28 | EXPECT_EQ(34, static_cast(*it)); 29 | ++it; 30 | EXPECT_EQ(end, it); 31 | } 32 | 33 | TEST(JsonArray_Iterator_Test, RunItertorToEnd) { 34 | run_iterator_test(); 35 | } 36 | 37 | TEST(JsonArray_Iterator_Test, RunConstItertorToEnd) { 38 | run_iterator_test(); 39 | } 40 | -------------------------------------------------------------------------------- /ArduinoJson/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | --------------------- 3 | 4 | Copyright © 2014-2017 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 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/ListConstIterator.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "ListNode.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // A read-only forward itertor for List 16 | template 17 | class ListConstIterator { 18 | public: 19 | explicit ListConstIterator(const ListNode *node = NULL) : _node(node) {} 20 | 21 | const T &operator*() const { 22 | return _node->content; 23 | } 24 | const T *operator->() { 25 | return &_node->content; 26 | } 27 | 28 | bool operator==(const ListConstIterator &other) const { 29 | return _node == other._node; 30 | } 31 | 32 | bool operator!=(const ListConstIterator &other) const { 33 | return _node != other._node; 34 | } 35 | 36 | ListConstIterator &operator++() { 37 | if (_node) _node = _node->next; 38 | return *this; 39 | } 40 | 41 | private: 42 | const ListNode *_node; 43 | }; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonObject_ContainsKey_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | #define TEST_(name) TEST(JsonObject_Basic_Tests, name) 12 | 13 | TEST_(ContainsKeyReturnsFalseForNonExistingKey) { 14 | DynamicJsonBuffer _jsonBuffer; 15 | JsonObject& _object = _jsonBuffer.createObject(); 16 | 17 | _object.set("hello", 42); 18 | 19 | EXPECT_FALSE(_object.containsKey("world")); 20 | } 21 | 22 | TEST_(ContainsKeyReturnsTrueForDefinedValue) { 23 | DynamicJsonBuffer _jsonBuffer; 24 | JsonObject& _object = _jsonBuffer.createObject(); 25 | 26 | _object.set("hello", 42); 27 | 28 | EXPECT_TRUE(_object.containsKey("hello")); 29 | } 30 | 31 | TEST_(ContainsKeyReturnsFalseAfterRemove) { 32 | DynamicJsonBuffer _jsonBuffer; 33 | JsonObject& _object = _jsonBuffer.createObject(); 34 | 35 | _object.set("hello", 42); 36 | _object.remove("hello"); 37 | 38 | EXPECT_FALSE(_object.containsKey("hello")); 39 | } 40 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsSignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | #include "IsSame.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace TypeTraits { 15 | 16 | // A meta-function that returns true if T is an integral type. 17 | template 18 | struct IsSignedIntegral { 19 | static const bool value = TypeTraits::IsSame::value || 20 | TypeTraits::IsSame::value || 21 | TypeTraits::IsSame::value || 22 | TypeTraits::IsSame::value || 23 | #if ARDUINOJSON_USE_LONG_LONG 24 | TypeTraits::IsSame::value || 25 | #endif 26 | 27 | #if ARDUINOJSON_USE_INT64 28 | TypeTraits::IsSame::value || 29 | #endif 30 | false; 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | #include "IsSame.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace TypeTraits { 15 | 16 | // A meta-function that returns true if T is an integral type. 17 | template 18 | struct IsUnsignedIntegral { 19 | static const bool value = TypeTraits::IsSame::value || 20 | TypeTraits::IsSame::value || 21 | TypeTraits::IsSame::value || 22 | TypeTraits::IsSame::value || 23 | #if ARDUINOJSON_USE_LONG_LONG 24 | TypeTraits::IsSame::value || 25 | #endif 26 | 27 | #if ARDUINOJSON_USE_INT64 28 | TypeTraits::IsSame::value || 29 | #endif 30 | false; 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Config/DebugProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // DebugProject.xcconfig 3 | // 4 | // These are Debug Configuration project settings for the gtest framework and 5 | // examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // No optimization 14 | GCC_OPTIMIZATION_LEVEL = 0 15 | 16 | // Deployment postprocessing is what triggers Xcode to strip, turn it off 17 | DEPLOYMENT_POSTPROCESSING = NO 18 | 19 | // Dead code stripping off 20 | DEAD_CODE_STRIPPING = NO 21 | 22 | // Debug symbols should be on obviously 23 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 24 | 25 | // Define the DEBUG macro in all debug builds 26 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1 27 | 28 | // These are turned off to avoid STL incompatibilities with client code 29 | // // Turns on special C++ STL checks to "encourage" good STL use 30 | // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS 31 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_MKR1000/Template_MKR1000.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * You should open Setting.h and modify General options. 4 | * 5 | * If you would like to add these features to your product, 6 | * please contact Blynk for Businesses: 7 | * 8 | * http://www.blynk.io/ 9 | * 10 | * This example requires some additional libraries: 11 | * https://github.com/cmaglie/FlashStorage 12 | * https://github.com/michael71/Timer5 13 | * 14 | **************************************************************/ 15 | 16 | #define USE_MKR1000_BOARD 17 | 18 | #define DEBUG // Comment this out to disable debug prints 19 | 20 | #define BLYNK_PRINT Serial 21 | #include 22 | #include 23 | #include 24 | #include "BlynkProvisioning.h" 25 | 26 | void setup() { 27 | delay(500); 28 | Serial.begin(115200); 29 | 30 | BlynkProvisioning.begin(); 31 | } 32 | 33 | void loop() { 34 | // This handles the network and cloud connection 35 | BlynkProvisioning.run(); 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /sim800l-simpleserialcommunication/sim800l-simpleserialcommunication.ino: -------------------------------------------------------------------------------- 1 | /* Piece of code for testing AT commands on SIM800L from Arduino UNO */ 2 | 3 | #include 4 | 5 | //SIM800 TX is connected to Arduino D8 6 | #define SIM800_TX_PIN 8 7 | 8 | //SIM800 RX is connected to Arduino D7 9 | #define SIM800_RX_PIN 7 10 | 11 | //Create software serial object to communicate with SIM800 12 | SoftwareSerial serialSIM800(SIM800_TX_PIN,SIM800_RX_PIN); 13 | 14 | void setup() { 15 | //Begin serial comunication with Arduino and Arduino IDE (Serial Monitor) 16 | Serial.begin(9600); 17 | while(!Serial); 18 | 19 | //Being serial communication witj Arduino and SIM800 20 | serialSIM800.begin(9600); 21 | delay(1000); 22 | 23 | Serial.println("Setup Complete!"); 24 | } 25 | 26 | void loop() { 27 | //Read SIM800 output (if available) and print it in Arduino IDE Serial Monitor 28 | if(serialSIM800.available()){ 29 | Serial.write(serialSIM800.read()); 30 | } 31 | //Read Arduino IDE Serial Monitor inputs (if available) and send them to SIM800 32 | if(Serial.available()){ 33 | serialSIM800.write(Serial.read()); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Seeeduino_GPRS/License.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Seeed Technology Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.${PRODUCT_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | GTEST_VERSIONINFO_LONG 21 | CFBundleShortVersionString 22 | GTEST_VERSIONINFO_SHORT 23 | CFBundleGetInfoString 24 | ${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT} 25 | NSHumanReadableCopyright 26 | ${GTEST_VERSIONINFO_ABOUT} 27 | CSResourcesFileMapped 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /blynk-library/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015 Volodymyr Shymanskyy 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonArray_Basic_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | #define TEST_(name) TEST(JsonArray_Basic_Tests, name) 12 | 13 | TEST_(SuccessIsTrue) { 14 | DynamicJsonBuffer _jsonBuffer; 15 | JsonArray& array = _jsonBuffer.createArray(); 16 | 17 | EXPECT_TRUE(array.success()); 18 | } 19 | 20 | TEST_(InitialSizeIsZero) { 21 | DynamicJsonBuffer _jsonBuffer; 22 | JsonArray& array = _jsonBuffer.createArray(); 23 | 24 | EXPECT_EQ(0U, array.size()); 25 | } 26 | 27 | TEST_(CreateNestedArray) { 28 | DynamicJsonBuffer _jsonBuffer; 29 | JsonArray& array = _jsonBuffer.createArray(); 30 | 31 | JsonArray& arr = array.createNestedArray(); 32 | EXPECT_EQ(&arr, &array[0].as()); 33 | } 34 | 35 | TEST_(CreateNestedObject) { 36 | DynamicJsonBuffer _jsonBuffer; 37 | JsonArray& array = _jsonBuffer.createArray(); 38 | 39 | JsonObject& obj = array.createNestedObject(); 40 | EXPECT_EQ(&obj, &array[0].as()); 41 | } 42 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Config/ReleaseProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // ReleaseProject.xcconfig 3 | // 4 | // These are Release Configuration project settings for the gtest framework 5 | // and examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // subconfig/Release.xcconfig 14 | 15 | // Optimize for space and size (Apple recommendation) 16 | GCC_OPTIMIZATION_LEVEL = s 17 | 18 | // Deploment postprocessing is what triggers Xcode to strip 19 | DEPLOYMENT_POSTPROCESSING = YES 20 | 21 | // No symbols 22 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO 23 | 24 | // Dead code strip does not affect ObjC code but can help for C 25 | DEAD_CODE_STRIPPING = YES 26 | 27 | // NDEBUG is used by things like assert.h, so define it for general compat. 28 | // ASSERT going away in release tends to create unused vars. 29 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable 30 | 31 | // When we strip we want to strip all symbols in release, but save externals. 32 | STRIP_STYLE = all 33 | -------------------------------------------------------------------------------- /blynk-library/src/utility/BlynkUtility.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkUtility.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Jun 2015 7 | * @brief Utility functions 8 | * 9 | */ 10 | 11 | #ifndef BlynkUtility_h 12 | #define BlynkUtility_h 13 | 14 | template 15 | const T& BlynkMin(const T& a, const T& b) 16 | { 17 | return (b < a) ? b : a; 18 | } 19 | 20 | template 21 | const T& BlynkMax(const T& a, const T& b) 22 | { 23 | return (b < a) ? a : b; 24 | } 25 | 26 | template 27 | void BlynkAverageSample (T& avg, const T& input) { 28 | avg -= avg/WSIZE; 29 | const T add = input/WSIZE; 30 | // Fix for shorter delays 31 | avg += (add > 0) ? add : -1; 32 | } 33 | 34 | #define BlynkBitSet(value, bit) ((value) |= (1UL << (bit))) 35 | #define BlynkBitClear(value, bit) ((value) &= ~(1UL << (bit))) 36 | #define BlynkBitRead(value, bit) (((value) >> (bit)) & 0x01) 37 | #define BlynkBitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sim800l-httpgetmethod/HTTPGET-BLYNK.txt: -------------------------------------------------------------------------------- 1 | 2 | AT+HTTPINIT 3 | OK 4 | AT+HTTPPARA="URL","http://blynk-cloud.com/423b9ca014e54a1c892d4d22d2832f68/isHardwareConnected" 5 | OK 6 | AT+HTTPACTION=0 7 | OK 8 | 9 | +HTTPACTION: 0,200,5 10 | 11 | AT+HTTPREAD 12 | +HTTPREAD: 5 13 | false 14 | <<<<<<< HEAD 15 | OK 16 | AT+HTTPTERM 17 | 18 | OK 19 | 20 | 21 | 22 | /********************Checking last value of Virtual Pin 1 (V1) on Raspberry Pi***************/ 23 | 24 | OK 25 | AT+HTTPINIT 26 | OK 27 | AT+HTTPPARA="URL","http://blynk-cloud.com/423b9ca014e54a1c892d4d22d2832f68/get/V1" 28 | OK 29 | AT+HTTPACTION=0 30 | OK 31 | 32 | +HTTPACTION: 0,200,7 33 | AT+HTTPREAD 34 | +HTTPREAD: 7 35 | ["251"] 36 | OK 37 | AT+HTTPTERM 38 | OK 39 | 40 | /********************Checking last value of Virtual Pin 1 (V9) on Raspberry Pi***************/ 41 | 42 | AT+HTTPINIT 43 | OK 44 | AT+HTTPPARA="URL","http://blynk-cloud.com/423b9ca014e54a1c892d4d22d2832f68/get/V9" 45 | AT+HTTPACTION=0 46 | OK 47 | 48 | +HTTPACTION: 0,200,6 49 | AT+HTTPREAD 50 | +HTTPREAD: 6 51 | ["24"] 52 | OK 53 | AT+HTTPTERM 54 | OK 55 | 56 | ======= 57 | OK 58 | >>>>>>> 1ec456f... Connection with BLYNK using API from just AT commands. It checks hardware network status 59 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_ESP8266/Template_ESP8266.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * You should open Setting.h and modify General options. 4 | * 5 | * If you would like to add these features to your product, 6 | * please contact Blynk for Businesses: 7 | * 8 | * http://www.blynk.io/ 9 | * 10 | **************************************************************/ 11 | 12 | #define USE_SPARKFUN_BLYNK_BOARD // Uncomment the board you are using 13 | //#define USE_NODE_MCU_BOARD // Comment out the boards you are not using 14 | //#define USE_WITTY_CLOUD_BOARD 15 | //#define USE_CUSTOM_BOARD // See "Custom board configuration" in Settings.h 16 | 17 | #define DEBUG // Comment this out to disable debug prints 18 | 19 | #define BLYNK_PRINT Serial 20 | #include 21 | #include "BlynkProvisioning.h" 22 | 23 | void setup() { 24 | delay(500); 25 | Serial.begin(115200); 26 | 27 | BlynkProvisioning.begin(); 28 | 29 | } 30 | 31 | void loop() { 32 | // This handles the network and cloud connection 33 | BlynkProvisioning.run(); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /blynk-library/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Blynk", 3 | "version": "0.4.4", 4 | "description": "Build a smartphone app for your project in minutes. Blynk allows creating IoT solutions easily. It supports WiFi, BLE, Bluetooth, Ethernet, GSM, USB, Serial. Works with many boards like ESP8266, ESP32, Arduino UNO, Nano, Due, Mega, Zero, MKR100, Yun, Raspberry Pi, Particle, Energia, ARM mbed, Intel Edison/Galileo/Joule, BBC micro:bit, DFRobot, RedBearLab, Microduino, LinkIt ONE ...", 5 | "keywords": "sensors, control, device, smartphone, mobile, app, web, cloud, communication, protocol, iot, m2m, wifi, ble, bluetooth, ethernet, usb, serial, gsm, gprs, 3g, data, esp8266, http", 6 | "authors": 7 | { 8 | "name": "Volodymyr Shymanskyy", 9 | "url": "https://github.com/vshymanskyy", 10 | "maintainer": true 11 | }, 12 | "repository": 13 | { 14 | "type": "git", 15 | "url": "https://github.com/blynkkk/blynk-library.git" 16 | }, 17 | "homepage": "http://blynk.cc", 18 | "export": { 19 | "exclude": [ 20 | "linux", 21 | "extras", 22 | "tests" 23 | ] 24 | }, 25 | "frameworks": [ "arduino", "energia", "wiringpi" ], 26 | "platforms": "*", 27 | "examples": "examples/*/*/*.ino" 28 | } 29 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/ListIterator.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "ListConstIterator.hpp" 11 | #include "ListNode.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | // A read-write forward iterator for List 17 | template 18 | class ListIterator { 19 | public: 20 | explicit ListIterator(ListNode *node = NULL) : _node(node) {} 21 | 22 | T &operator*() const { 23 | return _node->content; 24 | } 25 | T *operator->() { 26 | return &_node->content; 27 | } 28 | 29 | bool operator==(const ListIterator &other) const { 30 | return _node == other._node; 31 | } 32 | 33 | bool operator!=(const ListIterator &other) const { 34 | return _node != other._node; 35 | } 36 | 37 | ListIterator &operator++() { 38 | if (_node) _node = _node->next; 39 | return *this; 40 | } 41 | 42 | operator ListConstIterator() const { 43 | return ListConstIterator(_node); 44 | } 45 | 46 | private: 47 | ListNode *_node; 48 | }; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Seeeduino_GPRS/example/GPRS_CallUp/GPRS_CallUp.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Sketch: GPRS Call Up 3 | 4 | Function: This sketch is used to test seeeduino GPRS's callUp function.to make it 5 | work, you should insert SIM card to Seeeduino GPRS and replace the phoneNumber,enjoy it! 6 | ********************************************************************************* 7 | note: the following pins has been used and should not be used for other purposes. 8 | pin 8 // tx pin 9 | pin 7 // rx pin 10 | pin 9 // power key pin 11 | pin 12 // power status pin 12 | ********************************************************************************* 13 | created on 2013/12/5, version: 0.1 14 | by lawliet.zou(lawliet.zou@gmail.com) 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | GPRS gprs; 21 | 22 | void setup() { 23 | Serial.begin(9600); 24 | while(!Serial); 25 | Serial.println("GPRS - Call up Test..."); 26 | gprs.preInit();//power on SIM800 27 | delay(1000); 28 | while(0 !=gprs.init()) { //gprs init 29 | delay(1000); 30 | Serial.print("init error\r\n"); 31 | } 32 | Serial.println("Init success, start to call..."); 33 | gprs.callUp("150****9566"); 34 | } 35 | 36 | void loop() { 37 | //nothing to do 38 | } 39 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonArray_Remove_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | class JsonArray_Remove_Tests : public ::testing::Test { 12 | protected: 13 | JsonArray_Remove_Tests() : _array(_jsonBuffer.createArray()) { 14 | _array.add("one"); 15 | _array.add("two"); 16 | _array.add("three"); 17 | } 18 | 19 | DynamicJsonBuffer _jsonBuffer; 20 | JsonArray& _array; 21 | }; 22 | 23 | #define TEST_(name) TEST_F(JsonArray_Remove_Tests, name) 24 | 25 | TEST_(RemoveFirstElement) { 26 | _array.removeAt(0); 27 | 28 | EXPECT_EQ(2, _array.size()); 29 | EXPECT_STREQ("two", _array[0]); 30 | EXPECT_STREQ("three", _array[1]); 31 | } 32 | 33 | TEST_(RemoveMiddleElement) { 34 | _array.removeAt(1); 35 | 36 | EXPECT_EQ(2, _array.size()); 37 | EXPECT_STREQ("one", _array[0]); 38 | EXPECT_STREQ("three", _array[1]); 39 | } 40 | 41 | TEST_(RemoveLastElement) { 42 | _array.removeAt(2); 43 | 44 | EXPECT_EQ(2, _array.size()); 45 | EXPECT_STREQ("one", _array[0]); 46 | EXPECT_STREQ("two", _array[1]); 47 | } 48 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/create-size-graph.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | OUTPUT="$(pwd)/sizes.csv" 6 | 7 | echo "Tag;Date;Parser;Generator" > $OUTPUT 8 | 9 | cd $(dirname $(dirname $0)) 10 | 11 | git tag | while read TAG 12 | do 13 | 14 | git checkout -q tags/$TAG 15 | 16 | DATE=$(git log -1 --date=short --pretty=format:%cd) 17 | PARSER_SIZE=$(arduino --verify examples/JsonParserExample/JsonParserExample.ino 2>/dev/null | grep -e 'Sketch uses' | sed 's/.*uses \([0-9]*\).\([0-9]\+\).*/\1\2/') 18 | 19 | if [ -e 'examples/JsonGeneratorExample/JsonGeneratorExample.ino' ]; then 20 | GENERATOR_SIZE=$(arduino --verify examples/JsonGeneratorExample/JsonGeneratorExample.ino 2>/dev/null | grep -e 'Sketch uses' | sed 's/.*uses \([0-9]*\).\([0-9]\+\).*/\1\2/') 21 | else 22 | GENERATOR_SIZE="" 23 | fi 24 | 25 | echo $TAG 26 | if [ ! -z "$PARSER_SIZE" ] 27 | then 28 | echo "JsonParserExample = $PARSER_SIZE bytes" 29 | else 30 | echo "JsonParserExample compilation failed." 31 | fi 32 | 33 | if [ ! -z "$GENERATOR_SIZE" ] 34 | then 35 | echo "JsonGeneratorExample = $GENERATOR_SIZE bytes" 36 | else 37 | echo "JsonGeneratorExample compilation failed." 38 | fi 39 | 40 | echo "$TAG;$DATE;$PARSER_SIZE;$GENERATOR_SIZE" >> $OUTPUT 41 | 42 | done 43 | -------------------------------------------------------------------------------- /ArduinoJson/test/TypeTraits_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | using namespace ArduinoJson::TypeTraits; 13 | 14 | TEST(TypeTraits, IsBaseOf) { 15 | ASSERT_FALSE((IsBaseOf::value)); 16 | ASSERT_TRUE((IsBaseOf::value)); 17 | ASSERT_TRUE((IsBaseOf >, 18 | JsonObjectSubscript >::value)); 19 | } 20 | 21 | TEST(TypeTraits, IsArray) { 22 | ASSERT_FALSE((IsArray::value)); 23 | ASSERT_TRUE((IsArray::value)); 24 | ASSERT_TRUE((IsArray::value)); 25 | } 26 | 27 | TEST(TypeTraits, IsVariant) { 28 | ASSERT_TRUE((IsVariant >::value)); 29 | ASSERT_TRUE((IsVariant::value)); 30 | } 31 | 32 | TEST(TypeTraits, IsString) { 33 | ASSERT_TRUE((IsString::value)); 34 | ASSERT_TRUE((IsString::value)); 35 | ASSERT_FALSE((IsString::value)); 36 | } 37 | -------------------------------------------------------------------------------- /Seeeduino_GPRS/example/GPRS_SendSMS/GPRS_SendSMS.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Sketch: GPRS Connect TCP 3 | 4 | Function: This sketch is used to test seeeduino GPRS's send SMS func.to make it work, 5 | you should insert SIM card to Seeeduino GPRS and replace the phoneNumber,enjoy it! 6 | ************************************************************************************ 7 | note: the following pins has been used and should not be used for other purposes. 8 | pin 8 // tx pin 9 | pin 7 // rx pin 10 | pin 9 // power key pin 11 | pin 12 // power status pin 12 | ************************************************************************************ 13 | created on 2013/12/5, version: 0.1 14 | by lawliet.zou(lawliet.zou@gmail.com) 15 | */ 16 | #include 17 | #include 18 | 19 | GPRS gprs; 20 | 21 | void setup() { 22 | Serial.begin(9600); 23 | while(!Serial); 24 | Serial.println("GPRS - Send SMS Test ..."); 25 | gprs.preInit(); 26 | delay(1000); 27 | while(0 != gprs.init()) { 28 | delay(1000); 29 | Serial.print("init error\r\n"); 30 | } 31 | Serial.println("Init success, start to send SMS message..."); 32 | gprs.sendSMS("130****3364","hello,world"); //define phone number and text 33 | } 34 | 35 | void loop() { 36 | //nothing to do 37 | } 38 | -------------------------------------------------------------------------------- /ArduinoJson/scripts/oss-fuzz/Vagrantfile: -------------------------------------------------------------------------------- 1 | # A virtual machine to run https://github.com/google/oss-fuzz 2 | Vagrant.configure(2) do |config| 3 | config.vm.box = "ubuntu/xenial64" 4 | 5 | config.vm.synced_folder "E:\\Git\\Arduino\\libraries\\ArduinoJson", "/host/ArduinoJson" 6 | config.vm.synced_folder "E:\\Git\\oss-fuzz", "/host/oss-fuzz" 7 | 8 | config.vm.network "forwarded_port", guest: 8001, host: 8001 9 | 10 | config.vm.provision "shell", privileged: false, inline: <<-SHELL 11 | set -x 12 | 13 | sudo apt-get update 14 | sudo apt-get install -y make git docker.io zip 15 | sudo groupadd docker 16 | sudo usermod -aG docker $USER 17 | 18 | git clone https://github.com/google/fuzzer-test-suite.git FTS 19 | ./FTS/tutorial/install-deps.sh # Get deps 20 | ./FTS/tutorial/install-clang.sh # Get fresh clang binaries 21 | # Get libFuzzer sources and build it 22 | svn co http://llvm.org/svn/llvm-project/llvm/trunk/lib/Fuzzer 23 | Fuzzer/build.sh 24 | sudo mv libFuzzer.a /usr/local/lib/ 25 | 26 | echo "export PROJECT_NAME='arduinojson'" >> $HOME/.profile 27 | echo "export CC='clang'" >> $HOME/.profile 28 | echo "export CXX='clang++'" >> $HOME/.profile 29 | 30 | echo "Run /host/ArduinoJson/fuzzing/fuzz.sh" | sudo tee /etc/motd 31 | SHELL 32 | end 33 | -------------------------------------------------------------------------------- /ArduinoJson/test/Issue34.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | class Issue34 : public testing::Test { 12 | protected: 13 | template 14 | void test_with_value(T expected) { 15 | StaticJsonBuffer jsonBuffer; 16 | 17 | JsonObject& jsonObject = jsonBuffer.createObject(); 18 | 19 | jsonObject["key"] = expected; 20 | T actual = jsonObject["key"]; 21 | 22 | ASSERT_EQ(expected, actual); 23 | } 24 | }; 25 | 26 | TEST_F(Issue34, int8_t) { 27 | test_with_value(1); 28 | } 29 | 30 | TEST_F(Issue34, uint8_t) { 31 | test_with_value(2); 32 | } 33 | 34 | TEST_F(Issue34, int16_t) { 35 | test_with_value(3); 36 | } 37 | 38 | TEST_F(Issue34, uint16_t) { 39 | test_with_value(4); 40 | } 41 | 42 | TEST_F(Issue34, int32_t) { 43 | test_with_value(5); 44 | } 45 | 46 | TEST_F(Issue34, uint32_t) { 47 | test_with_value(6); 48 | } 49 | 50 | TEST_F(Issue34, float) { 51 | test_with_value(7); 52 | } 53 | 54 | TEST_F(Issue34, double) { 55 | test_with_value(8); 56 | } 57 | -------------------------------------------------------------------------------- /blynk-library/src/Blynk/BlynkTemplates.h: -------------------------------------------------------------------------------- 1 | class BlynkStackOnly 2 | { 3 | protected: 4 | BlynkStackOnly() {} 5 | ~BlynkStackOnly() {} 6 | 7 | private: 8 | /// @brief Declared as private to prevent usage of dynamic memory 9 | void* operator new(size_t size); 10 | /// @brief Declared as private to prevent usage of dynamic memory 11 | void operator delete(void *p); 12 | }; 13 | 14 | class BlynkNonCopyable 15 | { 16 | protected: 17 | BlynkNonCopyable(){} 18 | ~BlynkNonCopyable(){} 19 | 20 | private: 21 | /// @brief Declared as private to prevent usage of copy constructor 22 | BlynkNonCopyable(const BlynkNonCopyable&); 23 | /// @brief Declared as private to prevent usage of assignment operator 24 | BlynkNonCopyable& operator=(const BlynkNonCopyable&); 25 | }; 26 | 27 | template 28 | class BlynkSingleton 29 | : public BlynkNonCopyable 30 | { 31 | public: 32 | /** @brief Returns the instance of the singleton type 33 | When called for the first time, the singleton instance will be 34 | created. All subsequent calls will return a reference to the 35 | previously created instance. 36 | @return The singleton instance 37 | */ 38 | static T* instance() 39 | { 40 | static T instance; 41 | return &instance; 42 | } 43 | protected: 44 | BlynkSingleton() {} 45 | ~BlynkSingleton() {} 46 | }; 47 | 48 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonVariant_Success_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(JsonVariant_Success_Tests, ReturnsFalse_WhenUndefined) { 12 | JsonVariant variant; 13 | EXPECT_FALSE(variant.success()); 14 | } 15 | 16 | TEST(JsonVariant_Success_Tests, ReturnsTrue_WhenInteger) { 17 | JsonVariant variant = 0; 18 | EXPECT_TRUE(variant.success()); 19 | } 20 | 21 | TEST(JsonVariant_Success_Tests, ReturnsTrue_WhenEmptyArray) { 22 | DynamicJsonBuffer jsonBuffer; 23 | 24 | JsonVariant variant = jsonBuffer.createArray(); 25 | EXPECT_TRUE(variant.success()); 26 | } 27 | 28 | TEST(JsonVariant_Success_Tests, ReturnsTrue_WhenEmptyObject) { 29 | DynamicJsonBuffer jsonBuffer; 30 | 31 | JsonVariant variant = jsonBuffer.createObject(); 32 | EXPECT_TRUE(variant.success()); 33 | } 34 | 35 | TEST(JsonVariant_Success_Tests, ReturnsFalse_WhenInvalidArray) { 36 | JsonVariant variant = JsonArray::invalid(); 37 | EXPECT_FALSE(variant.success()); 38 | } 39 | 40 | TEST(JsonVariant_Success_Tests, ReturnsFalse_WhenInvalidObject) { 41 | JsonVariant variant = JsonObject::invalid(); 42 | EXPECT_FALSE(variant.success()); 43 | } 44 | -------------------------------------------------------------------------------- /Seeeduino_GPRS/example/GPRS_HTTP/GPRS_HTTP.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Sketch: GPRS HTTP Test 3 | 4 | */ 5 | #include 6 | #include 7 | 8 | char http_cmd[] = "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\r\n\r\n"; 9 | char buffer[512]; 10 | 11 | GPRS gprs; 12 | 13 | void setup() { 14 | Serial.begin(9600); 15 | while(!Serial); 16 | Serial.println("GPRS - HTTP Connection Test..."); 17 | gprs.preInit(); 18 | while(0 != gprs.init()) { 19 | delay(1000); 20 | Serial.println("init error"); 21 | } 22 | while(!gprs.join("cmnet")) { //change "cmnet" to your own APN 23 | Serial.println("gprs join network error"); 24 | delay(2000); 25 | } 26 | // successful DHCP 27 | Serial.print("IP Address is "); 28 | Serial.println(gprs.getIPAddress()); 29 | 30 | Serial.println("Init success, start to connect mbed.org..."); 31 | 32 | if(0 == gprs.connectTCP("mbed.org", 80)) { 33 | Serial.println("connect mbed.org success"); 34 | }else{ 35 | Serial.println("connect error"); 36 | while(1); 37 | } 38 | 39 | Serial.println("waiting to fetch..."); 40 | if(0 == gprs.sendTCPData(http_cmd)) 41 | { 42 | gprs.serialDebug(); 43 | } 44 | 45 | // gprs.closeTCP(); 46 | // gprs.shutTCP(); 47 | // Serial.println("close"); 48 | } 49 | 50 | void loop() { 51 | 52 | } 53 | -------------------------------------------------------------------------------- /ArduinoJson/test/StaticJsonBuffer_String_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(StaticJsonBuffer_String_Tests, WorksWhenBufferIsBigEnough) { 12 | StaticJsonBuffer<6> jsonBuffer; 13 | 14 | StaticJsonBufferBase::String str = jsonBuffer.startString(); 15 | str.append('h'); 16 | str.append('e'); 17 | str.append('l'); 18 | str.append('l'); 19 | str.append('o'); 20 | 21 | ASSERT_STREQ("hello", str.c_str()); 22 | } 23 | 24 | TEST(StaticJsonBuffer_String_Tests, ReturnsNullWhenTooSmall) { 25 | StaticJsonBuffer<5> jsonBuffer; 26 | 27 | StaticJsonBufferBase::String str = jsonBuffer.startString(); 28 | str.append('h'); 29 | str.append('e'); 30 | str.append('l'); 31 | str.append('l'); 32 | str.append('o'); 33 | 34 | ASSERT_EQ(NULL, str.c_str()); 35 | } 36 | 37 | TEST(StaticJsonBuffer_String_Tests, SizeIncreases) { 38 | StaticJsonBuffer<5> jsonBuffer; 39 | 40 | StaticJsonBufferBase::String str = jsonBuffer.startString(); 41 | ASSERT_EQ(0, jsonBuffer.size()); 42 | 43 | str.append('h'); 44 | ASSERT_EQ(1, jsonBuffer.size()); 45 | 46 | str.c_str(); 47 | ASSERT_EQ(2, jsonBuffer.size()); 48 | } 49 | -------------------------------------------------------------------------------- /ArduinoJson/test/DynamicJsonBuffer_String_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(DynamicJsonBuffer_String_Tests, WorksWhenBufferIsBigEnough) { 12 | DynamicJsonBuffer jsonBuffer(6); 13 | 14 | DynamicJsonBuffer::String str = jsonBuffer.startString(); 15 | str.append('h'); 16 | str.append('e'); 17 | str.append('l'); 18 | str.append('l'); 19 | str.append('o'); 20 | 21 | ASSERT_STREQ("hello", str.c_str()); 22 | } 23 | 24 | TEST(DynamicJsonBuffer_String_Tests, GrowsWhenBufferIsTooSmall) { 25 | DynamicJsonBuffer jsonBuffer(5); 26 | 27 | DynamicJsonBuffer::String str = jsonBuffer.startString(); 28 | str.append('h'); 29 | str.append('e'); 30 | str.append('l'); 31 | str.append('l'); 32 | str.append('o'); 33 | 34 | ASSERT_STREQ("hello", str.c_str()); 35 | } 36 | 37 | TEST(DynamicJsonBuffer_String_Tests, SizeIncreases) { 38 | DynamicJsonBuffer jsonBuffer(5); 39 | 40 | DynamicJsonBuffer::String str = jsonBuffer.startString(); 41 | ASSERT_EQ(0, jsonBuffer.size()); 42 | 43 | str.append('h'); 44 | ASSERT_EQ(1, jsonBuffer.size()); 45 | 46 | str.c_str(); 47 | ASSERT_EQ(2, jsonBuffer.size()); 48 | } 49 | -------------------------------------------------------------------------------- /sim800l-gprsconnection/sim800l-gprsconnection.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Sketch: GPRS HTTP Test 3 | 4 | */ 5 | #include 6 | #include 7 | 8 | char http_cmd[] = "GET http://castillolk.com.ve/WhiteList.txt\r\n\r\n"; 9 | char buffer[512]; 10 | 11 | GPRS gprs; 12 | 13 | void setup() { 14 | Serial.begin(9600); 15 | while(!Serial); 16 | Serial.println("GPRS - HTTP Connection Test..."); 17 | gprs.preInit(); 18 | while(0 != gprs.init()) { 19 | delay(1000); 20 | Serial.println("init error"); 21 | } 22 | while(!gprs.join("internet.digitel.ve","","")) { //change "cmnet" to your own APN 23 | Serial.println("gprs join network error"); 24 | delay(2000); 25 | } 26 | // successful DHCP 27 | Serial.print("IP Address is "); 28 | Serial.println(gprs.getIPAddress()); 29 | 30 | Serial.println("Init success, start to connect castillo..."); 31 | 32 | if(0 == gprs.connectTCP("http://castillolk.com.ve", 80)) { 33 | Serial.println("connect castillolk.com.ve"); 34 | }else{ 35 | Serial.println("connect error"); 36 | while(1); 37 | } 38 | 39 | Serial.println("waiting to fetch..."); 40 | if(0 == gprs.sendTCPData(http_cmd)) 41 | { 42 | gprs.serialDebug(); 43 | } 44 | 45 | // gprs.closeTCP(); 46 | // gprs.shutTCP(); 47 | // Serial.println("close"); 48 | } 49 | 50 | void loop() { 51 | 52 | } 53 | -------------------------------------------------------------------------------- /ArduinoJson/test/StaticJsonBuffer_CreateArray_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(StaticJsonBuffer_CreateArray_Tests, GrowsWithArray) { 12 | StaticJsonBuffer json; 13 | 14 | JsonArray &array = json.createArray(); 15 | ASSERT_EQ(JSON_ARRAY_SIZE(0), json.size()); 16 | 17 | array.add("hello"); 18 | ASSERT_EQ(JSON_ARRAY_SIZE(1), json.size()); 19 | 20 | array.add("world"); 21 | ASSERT_EQ(JSON_ARRAY_SIZE(2), json.size()); 22 | } 23 | 24 | TEST(StaticJsonBuffer_CreateArray_Tests, SucceedWhenBigEnough) { 25 | StaticJsonBuffer json; 26 | 27 | JsonArray &array = json.createArray(); 28 | ASSERT_TRUE(array.success()); 29 | } 30 | 31 | TEST(StaticJsonBuffer_CreateArray_Tests, FailsWhenTooSmall) { 32 | StaticJsonBuffer json; 33 | 34 | JsonArray &array = json.createArray(); 35 | ASSERT_FALSE(array.success()); 36 | } 37 | 38 | TEST(StaticJsonBuffer_CreateArray_Tests, ArrayDoesntGrowWhenFull) { 39 | StaticJsonBuffer json; 40 | 41 | JsonArray &array = json.createArray(); 42 | array.add("hello"); 43 | array.add("world"); 44 | 45 | EXPECT_EQ(1, array.size()); 46 | } 47 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/xcode/Config/General.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // General.xcconfig 3 | // 4 | // These are General configuration settings for the gtest framework and 5 | // examples. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Build for PPC and Intel, 32- and 64-bit 11 | ARCHS = i386 x86_64 ppc ppc64 12 | 13 | // Zerolink prevents link warnings so turn it off 14 | ZERO_LINK = NO 15 | 16 | // Prebinding considered unhelpful in 10.3 and later 17 | PREBINDING = NO 18 | 19 | // Strictest warning policy 20 | WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow 21 | 22 | // Work around Xcode bugs by using external strip. See: 23 | // http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html 24 | SEPARATE_STRIP = YES 25 | 26 | // Force C99 dialect 27 | GCC_C_LANGUAGE_STANDARD = c99 28 | 29 | // not sure why apple defaults this on, but it's pretty risky 30 | ALWAYS_SEARCH_USER_PATHS = NO 31 | 32 | // Turn on position dependent code for most cases (overridden where appropriate) 33 | GCC_DYNAMIC_NO_PIC = YES 34 | 35 | // Default SDK and minimum OS version is 10.4 36 | SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk 37 | MACOSX_DEPLOYMENT_TARGET = 10.4 38 | GCC_VERSION = 4.0 39 | 40 | // VERSIONING BUILD SETTINGS (used in Info.plist) 41 | GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc. 42 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_ESP8266/ResetButton.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * 4 | * If you would like to add these features to your product, 5 | * please contact Blynk for Business: 6 | * 7 | * http://www.blynk.io/ 8 | * 9 | **************************************************************/ 10 | 11 | volatile bool g_buttonPressed = false; 12 | volatile uint32_t g_buttonPressTime = -1; 13 | 14 | void button_action(void) 15 | { 16 | config_reset(); 17 | } 18 | 19 | void button_change(void) 20 | { 21 | #if BOARD_BUTTON_ACTIVE_LOW 22 | g_buttonPressed = !digitalRead(BOARD_BUTTON_PIN); 23 | #else 24 | g_buttonPressed = digitalRead(BOARD_BUTTON_PIN); 25 | #endif 26 | 27 | if (g_buttonPressed) { 28 | DEBUG_PRINT("Hold the button to reset configuration..."); 29 | g_buttonPressTime = millis(); 30 | } else { 31 | uint32_t buttonHoldTime = millis() - g_buttonPressTime; 32 | if (buttonHoldTime >= BUTTON_HOLD_TIME_ACTION) { 33 | button_action(); 34 | } 35 | g_buttonPressTime = -1; 36 | } 37 | } 38 | 39 | void button_init() 40 | { 41 | #if BOARD_BUTTON_ACTIVE_LOW 42 | pinMode(BOARD_BUTTON_PIN, INPUT_PULLUP); 43 | #else 44 | pinMode(BOARD_BUTTON_PIN, INPUT); 45 | #endif 46 | attachInterrupt(BOARD_BUTTON_PIN, button_change, CHANGE); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/myPlant_ESP8266/ResetButton.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * 4 | * If you would like to add these features to your product, 5 | * please contact Blynk for Business: 6 | * 7 | * http://www.blynk.io/ 8 | * 9 | **************************************************************/ 10 | 11 | volatile bool g_buttonPressed = false; 12 | volatile uint32_t g_buttonPressTime = -1; 13 | 14 | void button_action(void) 15 | { 16 | config_reset(); 17 | } 18 | 19 | void button_change(void) 20 | { 21 | #if BOARD_BUTTON_ACTIVE_LOW 22 | g_buttonPressed = !digitalRead(BOARD_BUTTON_PIN); 23 | #else 24 | g_buttonPressed = digitalRead(BOARD_BUTTON_PIN); 25 | #endif 26 | 27 | if (g_buttonPressed) { 28 | DEBUG_PRINT("Hold the button to reset configuration..."); 29 | g_buttonPressTime = millis(); 30 | } else { 31 | uint32_t buttonHoldTime = millis() - g_buttonPressTime; 32 | if (buttonHoldTime >= BUTTON_HOLD_TIME_ACTION) { 33 | button_action(); 34 | } 35 | g_buttonPressTime = -1; 36 | } 37 | } 38 | 39 | void button_init() 40 | { 41 | #if BOARD_BUTTON_ACTIVE_LOW 42 | pinMode(BOARD_BUTTON_PIN, INPUT_PULLUP); 43 | #else 44 | pinMode(BOARD_BUTTON_PIN, INPUT); 45 | #endif 46 | attachInterrupt(BOARD_BUTTON_PIN, button_change, CHANGE); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /blynk-library/examples/Export_Demo/Template_MKR1000/ResetButton.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * This is a DEMO. You can use it only for development and testing. 3 | * 4 | * If you would like to add these features to your product, 5 | * please contact Blynk for Business: 6 | * 7 | * http://www.blynk.io/ 8 | * 9 | **************************************************************/ 10 | 11 | volatile bool g_buttonPressed = false; 12 | volatile uint32_t g_buttonPressTime = -1; 13 | 14 | void button_action(void) 15 | { 16 | config_reset(); 17 | } 18 | 19 | void button_change(void) 20 | { 21 | #if BOARD_BUTTON_ACTIVE_LOW 22 | g_buttonPressed = !digitalRead(BOARD_BUTTON_PIN); 23 | #else 24 | g_buttonPressed = digitalRead(BOARD_BUTTON_PIN); 25 | #endif 26 | 27 | if (g_buttonPressed) { 28 | DEBUG_PRINT("Hold the button to reset configuration..."); 29 | g_buttonPressTime = millis(); 30 | } else { 31 | uint32_t buttonHoldTime = millis() - g_buttonPressTime; 32 | if (buttonHoldTime >= BUTTON_HOLD_TIME_ACTION) { 33 | button_action(); 34 | } 35 | g_buttonPressTime = -1; 36 | } 37 | } 38 | 39 | void button_init() 40 | { 41 | #if BOARD_BUTTON_ACTIVE_LOW 42 | pinMode(BOARD_BUTTON_PIN, INPUT_PULLUP); 43 | #else 44 | pinMode(BOARD_BUTTON_PIN, INPUT_PULLDOWN); 45 | #endif 46 | attachInterrupt(BOARD_BUTTON_PIN, button_change, CHANGE); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /blynk-library/src/WidgetGPS.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file WidgetGPS.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Oct 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef WidgetGPS_h 12 | #define WidgetGPS_h 13 | 14 | #ifndef BLYNK_NO_FLOAT 15 | 16 | #include 17 | 18 | class GpsParam 19 | { 20 | public: 21 | 22 | GpsParam(const BlynkParam& param) 23 | : mLat (0) 24 | , mLon (0) 25 | , mAlt (0) 26 | , mSpeed (0) 27 | { 28 | BlynkParam::iterator it = param.begin(); 29 | if (it >= param.end()) 30 | return; 31 | 32 | mLat = it.asDouble(); 33 | 34 | if (++it >= param.end()) 35 | return; 36 | 37 | mLon = it.asDouble(); 38 | 39 | if (++it >= param.end()) 40 | return; 41 | 42 | mAlt = it.asDouble(); 43 | 44 | if (++it >= param.end()) 45 | return; 46 | 47 | mSpeed = it.asDouble(); 48 | } 49 | 50 | 51 | double getLat() const { return mLat; } 52 | double getLon() const { return mLon; } 53 | double getAltitude() const { return mAlt; } 54 | double getSpeed() const { return mSpeed; } 55 | 56 | private: 57 | double mLat; 58 | double mLon; 59 | double mAlt; 60 | double mSpeed; 61 | }; 62 | 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/StringTraits/FlashString.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | template <> 13 | struct StringTraits { 14 | class Reader { 15 | const char* _ptr; 16 | 17 | public: 18 | Reader(const __FlashStringHelper* ptr) 19 | : _ptr(reinterpret_cast(ptr)) {} 20 | 21 | void move() { 22 | _ptr++; 23 | } 24 | 25 | char current() const { 26 | return pgm_read_byte_near(_ptr); 27 | } 28 | 29 | char next() const { 30 | return pgm_read_byte_near(_ptr + 1); 31 | } 32 | }; 33 | 34 | static bool equals(const __FlashStringHelper* str, const char* expected) { 35 | return strcmp_P(expected, (PGM_P)str) == 0; 36 | } 37 | 38 | template 39 | static char* duplicate(const __FlashStringHelper* str, Buffer* buffer) { 40 | if (!str) return NULL; 41 | size_t size = strlen_P((PGM_P)str) + 1; 42 | void* dup = buffer->alloc(size); 43 | if (dup != NULL) memcpy_P(dup, (PGM_P)str, size); 44 | return static_cast(dup); 45 | } 46 | 47 | static const bool has_append = false; 48 | static const bool has_equals = true; 49 | static const bool should_duplicate = true; 50 | }; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Seeeduino_GPRS/example/FM_Test/FM_Test.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Sketch: FM Test 3 | 4 | Function: This sketch is used to test SIM800'FM function. 5 | ********************************************************************************* 6 | note: the following pins has been used and should not be used for other purposes. 7 | pin 8 // tx pin 8 | pin 7 // rx pin 9 | pin 9 // power key pin 10 | pin 12 // power status pin 11 | ********************************************************************************* 12 | created on 2013/12/5, version: 0.1 13 | by lawliet.zou(lawliet.zou@gmail.com) 14 | */ 15 | 16 | #include 17 | #include 18 | 19 | int channelButton = 5; //used for changing channel 20 | FM fm; 21 | 22 | void setup() { 23 | pinMode(channelButton,INPUT); 24 | Serial.begin(9600); 25 | while(!Serial); 26 | Serial.println("FM Test..."); 27 | fm.preInit(); 28 | while(0 != fm.powerOn()){ 29 | Serial.println("FM power on failed, try again..."); 30 | delay(2000); 31 | } 32 | Serial.println("FM power on!"); 33 | Serial.println("Setting volum..."); 34 | fm.setVolume(6); //0,1,2,3,4,5,6 35 | Serial.println("Scan channel..."); 36 | fm.scanChannel(); 37 | Serial.println("FM init success"); 38 | } 39 | 40 | void loop() { 41 | while(HIGH == digitalRead(channelButton)){ 42 | delay(50); 43 | } 44 | Serial.print("change Channel\r\n"); 45 | fm.channelNext(); 46 | while(LOW == digitalRead(channelButton)){ 47 | delay(50); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /blynk-library/src/WidgetRTC.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file WidgetRTC.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 6 | * @date Mar 2016 7 | * @brief 8 | * 9 | */ 10 | 11 | #ifndef WidgetRTC_h 12 | #define WidgetRTC_h 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | class WidgetRTC 19 | : public BlynkSingleton 20 | { 21 | public: 22 | WidgetRTC() {} 23 | void begin(); 24 | 25 | private: 26 | static time_t requestTimeSync(); 27 | }; 28 | 29 | // This is called by Time library when it needs time sync 30 | time_t WidgetRTC::requestTimeSync() 31 | { 32 | // Request RTC widget update from the server 33 | Blynk.sendInternal("rtc", "sync"); 34 | // Tell the Time library that we'll set it later 35 | return 0; 36 | } 37 | 38 | inline 39 | void WidgetRTC::begin() 40 | { 41 | setSyncProvider(requestTimeSync); 42 | } 43 | 44 | BLYNK_WRITE(InternalPinRTC) { 45 | const unsigned long DEFAULT_TIME = 1357041600; // Jan 1 2013 46 | unsigned long blynkTime = param.asLong(); 47 | 48 | if (blynkTime >= DEFAULT_TIME) { // Check the integer is a valid time (greater than Jan 1 2013) 49 | setTime(blynkTime); // Sync Time library clock to the value received from Blynk 50 | BLYNK_LOG1(BLYNK_F("Time sync: OK")); 51 | } 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino: -------------------------------------------------------------------------------- 1 | // Send a JSON object on UDP at regular interval 2 | // 3 | // You can easily test this program with netcat: 4 | // $ nc -ulp 8888 5 | // 6 | // by Benoit Blanchon, MIT License 2015-2017 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; 13 | IPAddress localIp(192, 168, 0, 177); 14 | IPAddress remoteIp(192, 168, 0, 109); 15 | unsigned int remotePort = 8888; 16 | unsigned localPort = 8888; 17 | EthernetUDP udp; 18 | 19 | JsonObject& buildJson(JsonBuffer& jsonBuffer) { 20 | JsonObject& root = jsonBuffer.createObject(); 21 | 22 | JsonArray& analogValues = root.createNestedArray("analog"); 23 | for (int pin = 0; pin < 6; pin++) { 24 | int value = analogRead(pin); 25 | analogValues.add(value); 26 | } 27 | 28 | JsonArray& digitalValues = root.createNestedArray("digital"); 29 | for (int pin = 0; pin < 14; pin++) { 30 | int value = digitalRead(pin); 31 | digitalValues.add(value); 32 | } 33 | 34 | return root; 35 | } 36 | 37 | void sendJson(JsonObject& json) { 38 | udp.beginPacket(remoteIp, remotePort); 39 | json.printTo(udp); 40 | udp.println(); 41 | udp.endPacket(); 42 | } 43 | 44 | void setup() { 45 | Ethernet.begin(mac, localIp); 46 | udp.begin(localPort); 47 | } 48 | 49 | void loop() { 50 | delay(1000); 51 | 52 | StaticJsonBuffer<300> jsonBuffer; 53 | JsonObject& json = buildJson(jsonBuffer); 54 | sendJson(json); 55 | } 56 | -------------------------------------------------------------------------------- /blynk-library/scripts/certs/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIID5TCCAs2gAwIBAgIJAIHSnb+cv4ECMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYD 3 | VQQGEwJVQTENMAsGA1UECAwES3lpdjENMAsGA1UEBwwES3lpdjELMAkGA1UECgwC 4 | SVQxEzARBgNVBAsMCkJseW5rIEluYy4xGDAWBgNVBAMMD2JseW5rLWNsb3VkLmNv 5 | bTEfMB0GCSqGSIb3DQEJARYQZG1pdHJpeUBibHluay5jYzAeFw0xNjAzMTcxMTU4 6 | MDdaFw0yMTAzMTYxMTU4MDdaMIGIMQswCQYDVQQGEwJVQTENMAsGA1UECAwES3lp 7 | djENMAsGA1UEBwwES3lpdjELMAkGA1UECgwCSVQxEzARBgNVBAsMCkJseW5rIElu 8 | Yy4xGDAWBgNVBAMMD2JseW5rLWNsb3VkLmNvbTEfMB0GCSqGSIb3DQEJARYQZG1p 9 | dHJpeUBibHluay5jYzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALso 10 | bhbXQuNlzYBFa9h9pd69n43yrGTL4Ba6k5Q1zDwY9HQbMdfC5ZfnCkqT7Zf+R5MO 11 | RW0Q9nLsFNLJkwKnluRCYGyUES8NAmDLQBbZoVc8mv9K3mIgAQvGyY2LmKak5GSI 12 | V0PC3x+iN03xU2774+Zi7DaQd7vTl/9RGk8McyHe/s5Ikbe14bzWcY9ZV4PKgCck 13 | p1chbmLhSfGbT3v64sL8ZbIppQk57/JgsZMrVpjExvxQPZuJfWbtoypPfpYO+O8l 14 | 1szaMlTEPIZVMoYi9uE+DnOlhzJFn6Ac4FMrDzJXzMmCweSX3IxguvXALeKhUHQJ 15 | +VP3G6Q3pkZRVKz+5XsCAwEAAaNQME4wHQYDVR0OBBYEFJtqtI62Io66cZgiTR5L 16 | A5Tl5m+xMB8GA1UdIwQYMBaAFJtqtI62Io66cZgiTR5LA5Tl5m+xMAwGA1UdEwQF 17 | MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAKphjtEOGs7oC3S87+AUgIw4gFNOuv+L 18 | C98/l47OD6WtsqJKvCZ1lmKxY5aIro9FBPk8ktCOsbwEjE+nyr5wul+6CLFr+rnv 19 | 7OHYGwLpjoz+rZgYJiQ61E1m0AZ4y9Fyd+D90HW6247vrBXyEiUXOhN/oDDVfDQA 20 | eqmNBx1OqWel81D3tA7zPMA7vUItyWcFIXNjOCP+POy7TMxZuhuPMh5bVu+/cthl 21 | /Q9u/Z2lKl4CWV0Ivt2BtlN6iefva0e2AP/As+gfwjxrb0t11zSILLNJ+nxRIwg+ 22 | k4MGb1zihKbIXUzsjslONK4FY5rlQUSwKJgEAVF0ClxB4g6dECm0ckc= 23 | -----END CERTIFICATE----- 24 | -------------------------------------------------------------------------------- /blynk-library/linux/BlynkOptionsParser.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | static 6 | void parse_options(int argc, char* argv[], 7 | const char*& auth, 8 | const char*& serv, 9 | uint16_t& port) 10 | { 11 | static struct option long_options[] = { 12 | {"token", required_argument, 0, 't'}, 13 | {"server", required_argument, 0, 's'}, 14 | {"port", required_argument, 0, 'p'}, 15 | {0, 0, 0, 0} 16 | }; 17 | 18 | // Set default values 19 | auth = NULL; 20 | serv = BLYNK_DEFAULT_DOMAIN; 21 | port = BLYNK_DEFAULT_PORT; 22 | 23 | const char* usage = 24 | "Usage: blynk [options]\n" 25 | "\n" 26 | "Options:\n" 27 | " -t auth, --token=auth Your auth token\n" 28 | " -s addr, --server=addr Server name (default: " BLYNK_DEFAULT_DOMAIN ")\n" 29 | " -p num, --port=num Server port (default: " BLYNK_TOSTRING(BLYNK_DEFAULT_PORT) ")\n" 30 | "\n"; 31 | 32 | int rez; 33 | while (-1 != (rez = getopt_long(argc, argv,"t:s:p:", long_options, NULL))) { 34 | switch (rez) { 35 | case 't': auth = optarg; break; 36 | case 's': serv = optarg; break; 37 | case 'p': port = atoi(optarg); break; 38 | default : printf(usage); exit(1); 39 | }; 40 | }; 41 | 42 | // Check mandatory options 43 | if (!auth) { 44 | printf(usage); 45 | exit(1); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Hady Zalek 15 | Jeffrey Yasskin 16 | Jói Sigurðsson 17 | Keir Mierle 18 | Keith Ray 19 | Kenton Varda 20 | Manuel Klimek 21 | Markus Heule 22 | Mika Raento 23 | Miklós Fazekas 24 | Pasi Valminen 25 | Patrick Hanna 26 | Patrick Riley 27 | Peter Kaminski 28 | Preston Jackson 29 | Rainer Klaffenboeck 30 | Russ Cox 31 | Russ Rufer 32 | Sean Mcafee 33 | Sigurður Ásgeirsson 34 | Tracy Bialik 35 | Vadim Berman 36 | Vlad Losev 37 | Zhanyong Wan 38 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/StringTraits/StringTraits.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | template 16 | struct StringTraits {}; 17 | 18 | template 19 | struct StringTraits : StringTraits {}; 20 | 21 | template 22 | struct StringTraits : StringTraits {}; 23 | } 24 | } 25 | 26 | #include "CharPointer.hpp" 27 | 28 | #if ARDUINOJSON_ENABLE_STD_STRING || ARDUINOJSON_ENABLE_ARDUINO_STRING 29 | #include "StdString.hpp" 30 | #endif 31 | 32 | #if ARDUINOJSON_ENABLE_STD_STREAM 33 | #include "StdStream.hpp" 34 | #endif 35 | 36 | #if ARDUINOJSON_ENABLE_ARDUINO_STREAM 37 | #include "ArduinoStream.hpp" 38 | #endif 39 | 40 | #if ARDUINOJSON_ENABLE_PROGMEM 41 | #include "FlashString.hpp" 42 | #endif 43 | 44 | namespace ArduinoJson { 45 | namespace TypeTraits { 46 | template 47 | struct IsString { 48 | static const bool value = false; 49 | }; 50 | 51 | template 52 | struct IsString::has_equals>::type> { 54 | static const bool value = Internals::StringTraits::has_equals; 55 | }; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/JsonVariantType.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | class JsonArray; 12 | class JsonObject; 13 | 14 | namespace Internals { 15 | 16 | // Enumerated type to know the current type of a JsonVariant. 17 | // The value determines which member of JsonVariantContent is used. 18 | enum JsonVariantType { 19 | JSON_UNDEFINED, // JsonVariant has not been initialized 20 | JSON_UNPARSED, // JsonVariant contains an unparsed string 21 | JSON_STRING, // JsonVariant stores a const char* 22 | JSON_BOOLEAN, // JsonVariant stores a bool 23 | JSON_POSITIVE_INTEGER, // JsonVariant stores an unsigned long 24 | JSON_NEGATIVE_INTEGER, // JsonVariant stores an unsigned long that must be 25 | // negated 26 | JSON_ARRAY, // JsonVariant stores a pointer to a JsonArray 27 | JSON_OBJECT, // JsonVariant stores a pointer to a JsonObject 28 | 29 | // The following values are reserved for float values 30 | // Multiple values are used for double, depending on the number of decimal 31 | // digits that must be printed in the JSON output. 32 | // This little trick allow to save one extra member in JsonVariant 33 | JSON_FLOAT_0_DECIMALS 34 | // JSON_FLOAT_1_DECIMAL 35 | // JSON_FLOAT_2_DECIMALS 36 | // ... 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_WiFi/Digistump_Oak/Digistump_Oak.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * This example shows how to use Digistump Oak with Blynk. 17 | * 18 | * Please be sure to select the right board type 19 | * in the Tools -> Board menu! 20 | * 21 | * Change Blynk auth token to run :) 22 | * 23 | **************************************************************/ 24 | 25 | #define BLYNK_PRINT Serial // Comment this out to disable prints and save space 26 | #include 27 | #include 28 | 29 | // You should get Auth Token in the Blynk App. 30 | // Go to the Project Settings (nut icon). 31 | char auth[] = "YourAuthToken"; 32 | 33 | void setup() 34 | { 35 | Serial.begin(9600); 36 | // Oak has already configured WiFi 37 | Blynk.config(auth); 38 | } 39 | 40 | void loop() 41 | { 42 | Blynk.run(); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /ArduinoJson/test/DynamicJsonBuffer_NoMemory_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | class NoMemoryAllocator { 12 | public: 13 | void* allocate(size_t) { 14 | return NULL; 15 | } 16 | void deallocate(void*) {} 17 | }; 18 | 19 | class DynamicJsonBuffer_NoMemory_Tests : public ::testing::Test { 20 | protected: 21 | DynamicJsonBufferBase _jsonBuffer; 22 | }; 23 | 24 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, FixCodeCoverage) { 25 | // call this function to fix code coverage 26 | NoMemoryAllocator().deallocate(NULL); 27 | } 28 | 29 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, CreateArray) { 30 | ASSERT_FALSE(_jsonBuffer.createArray().success()); 31 | } 32 | 33 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, CreateObject) { 34 | ASSERT_FALSE(_jsonBuffer.createObject().success()); 35 | } 36 | 37 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, ParseArray) { 38 | char json[] = "[]"; 39 | ASSERT_FALSE(_jsonBuffer.parseArray(json).success()); 40 | } 41 | 42 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, ParseObject) { 43 | char json[] = "{}"; 44 | ASSERT_FALSE(_jsonBuffer.parseObject(json).success()); 45 | } 46 | 47 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, String) { 48 | DynamicJsonBufferBase::String str = _jsonBuffer.startString(); 49 | str.append('!'); 50 | ASSERT_EQ(NULL, str.c_str()); 51 | } 52 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/Parse.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | template 15 | TFloat parse(const char *); 16 | 17 | template <> 18 | inline float parse(const char *s) { 19 | return static_cast(strtod(s, NULL)); 20 | } 21 | 22 | template <> 23 | inline double parse(const char *s) { 24 | return strtod(s, NULL); 25 | } 26 | 27 | template <> 28 | inline long parse(const char *s) { 29 | return strtol(s, NULL, 10); 30 | } 31 | 32 | template <> 33 | inline unsigned long parse(const char *s) { 34 | return strtoul(s, NULL, 10); 35 | } 36 | 37 | template <> 38 | inline int parse(const char *s) { 39 | return atoi(s); 40 | } 41 | 42 | #if ARDUINOJSON_USE_LONG_LONG 43 | template <> 44 | inline long long parse(const char *s) { 45 | return strtoll(s, NULL, 10); 46 | } 47 | 48 | template <> 49 | inline unsigned long long parse(const char *s) { 50 | return strtoull(s, NULL, 10); 51 | } 52 | #endif 53 | 54 | #if ARDUINOJSON_USE_INT64 55 | template <> 56 | inline __int64 parse<__int64>(const char *s) { 57 | return _strtoi64(s, NULL, 10); 58 | } 59 | 60 | template <> 61 | inline unsigned __int64 parse(const char *s) { 62 | return _strtoui64(s, NULL, 10); 63 | } 64 | #endif 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /blynk-library/examples/Widgets/TimeInput/SimpleTimeInput/SimpleTimeInput.ino: -------------------------------------------------------------------------------- 1 | /************************************************************* 2 | Blynk is a platform with iOS and Android apps to control 3 | Arduino, Raspberry Pi and the likes over the Internet. 4 | You can easily build graphic interfaces for all your 5 | projects by simply dragging and dropping widgets. 6 | 7 | Downloads, docs, tutorials: http://www.blynk.cc 8 | Blynk community: http://community.blynk.cc 9 | Social networks: http://www.fb.com/blynkapp 10 | http://twitter.com/blynk_app 11 | 12 | Blynk library is licensed under MIT license 13 | This example code is in public domain. 14 | 15 | ************************************************************* 16 | App project setup: 17 | Time Input widget on V1 with only start time option. 18 | *************************************************************/ 19 | 20 | /* Comment this out to disable prints and save space */ 21 | #define BLYNK_PRINT Serial 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | // You should get Auth Token in the Blynk App. 28 | // Go to the Project Settings (nut icon). 29 | char auth[] = "YourAuthToken"; 30 | 31 | BLYNK_WRITE(V1) { 32 | int startTimeInSecs = param[0].asInt(); 33 | Serial.println(startTimeInSecs); 34 | Serial.println(); 35 | } 36 | 37 | void setup() 38 | { 39 | // Debug console 40 | Serial.begin(9600); 41 | 42 | Blynk.begin(auth); 43 | } 44 | 45 | void loop() 46 | { 47 | Blynk.run(); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /blynk-library/examples/GettingStarted/Servo/Servo.ino: -------------------------------------------------------------------------------- 1 | /************************************************************* 2 | Blynk is a platform with iOS and Android apps to control 3 | Arduino, Raspberry Pi and the likes over the Internet. 4 | You can easily build graphic interfaces for all your 5 | projects by simply dragging and dropping widgets. 6 | 7 | Downloads, docs, tutorials: http://www.blynk.cc 8 | Blynk community: http://community.blynk.cc 9 | Social networks: http://www.fb.com/blynkapp 10 | http://twitter.com/blynk_app 11 | 12 | Blynk library is licensed under MIT license 13 | This example code is in public domain. 14 | 15 | ************************************************************* 16 | Rotate a servo using a slider! 17 | 18 | App project setup: 19 | Slider widget (0...180) on V3 20 | *************************************************************/ 21 | 22 | /* Comment this out to disable prints and save space */ 23 | #define BLYNK_PRINT Serial 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // You should get Auth Token in the Blynk App. 31 | // Go to the Project Settings (nut icon). 32 | char auth[] = "YourAuthToken"; 33 | 34 | Servo servo; 35 | 36 | BLYNK_WRITE(V3) 37 | { 38 | servo.write(param.asInt()); 39 | } 40 | 41 | void setup() 42 | { 43 | // Debug console 44 | Serial.begin(9600); 45 | 46 | Blynk.begin(auth); 47 | 48 | servo.attach(9); 49 | } 50 | 51 | void loop() 52 | { 53 | Blynk.run(); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /blynk-library/src/Blynk/BlynkWidgetBase.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file BlynkWidgetBase.h 3 | * @author Volodymyr Shymanskyy 4 | * @license This project is released under the MIT License (MIT) 5 | * @copyright Copyright (c) 2016 Volodymyr Shymanskyy 6 | * @date Nov 2016 7 | * @brief 8 | */ 9 | 10 | #ifndef BlynkWidgetBase_h 11 | #define BlynkWidgetBase_h 12 | 13 | #include 14 | 15 | class BlynkWidgetBase 16 | { 17 | public: 18 | BlynkWidgetBase(uint8_t vPin) : mPin(vPin) {} 19 | void setVPin(uint8_t vPin) { mPin = vPin; } 20 | 21 | void onWrite(BlynkReq BLYNK_UNUSED &request, const BlynkParam BLYNK_UNUSED ¶m) { 22 | BLYNK_LOG1(BLYNK_F("BlynkWidgetBase::onWrite should not be called")); 23 | } 24 | 25 | template 26 | void setLabel(Args... args) { 27 | Blynk.setProperty(mPin, "label", args...); 28 | } 29 | 30 | template 31 | void setColor(Args... args) { 32 | Blynk.setProperty(mPin, "color", args...); 33 | } 34 | 35 | protected: 36 | uint8_t mPin; 37 | }; 38 | 39 | class BlynkAttachWidgetHelper { 40 | public: 41 | template 42 | explicit BlynkAttachWidgetHelper(T& widget, uint8_t vPin) { 43 | widget.setVPin(vPin); 44 | } 45 | }; 46 | 47 | // Could use __attribute__ ((constructor)), but hope for better portability 48 | #define BLYNK_ATTACH_WIDGET(widget, pin) \ 49 | BlynkAttachWidgetHelper BLYNK_CONCAT2(blnk_widget_helper_, __COUNTER__)((widget), (pin)); \ 50 | BLYNK_WRITE(pin) { (widget).onWrite(request, param); } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /ArduinoJson/third-party/gtest-1.7.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_WiFi/Arduino_Yun/Arduino_Yun.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * This example shows how to use Arduino Yun Bridge 17 | * to connect your project to Blynk. 18 | * Feel free to apply it to any other example. It's simple! 19 | * 20 | **************************************************************/ 21 | 22 | #define BLYNK_PRINT Serial // Comment this out to disable prints and save space 23 | #include 24 | #include 25 | 26 | // You should get Auth Token in the Blynk App. 27 | // Go to the Project Settings (nut icon). 28 | char auth[] = "YourAuthToken"; 29 | 30 | void setup() 31 | { 32 | Serial.begin(9600); 33 | Blynk.begin(auth); 34 | // Or specify server using one of those commands: 35 | //Blynk.begin(auth, "blynk-cloud.com", 8442); 36 | //Blynk.begin(auth, server_ip, port); 37 | } 38 | 39 | void loop() 40 | { 41 | Blynk.run(); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/Energia_BLE/Energia_BLE.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * This example shows how to use Energia BLE 18 | * to connect your project to Blynk. 19 | * 20 | * NOTE: BLE support is in beta! 21 | * 22 | **************************************************************/ 23 | 24 | //#define BLYNK_DEBUG 25 | #define BLYNK_PRINT Serial 26 | #define BLYNK_RUN_YIELD() { ble.handleEvents(); } 27 | 28 | #include 29 | #include 30 | 31 | // You should get Auth Token in the Blynk App. 32 | // Go to the Project Settings (nut icon). 33 | char auth[] = "YourAuthToken"; 34 | 35 | void setup() { 36 | Serial.begin(115200); 37 | 38 | ble.setLogLevel(BLE_LOG_ERRORS); 39 | ble.begin(); 40 | ble.serial(); 41 | ble.setAdvertName("Blynk BLE"); 42 | ble.startAdvert(); 43 | 44 | Blynk.begin(ble, auth); 45 | } 46 | 47 | void loop() { 48 | Blynk.run(); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/RedBearLab_BLE_Mini/RedBearLab_BLE_Mini.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * This example shows how to use Arduino + RedBearLab BLE Mini 18 | * to connect your project to Blynk. 19 | * 20 | * NOTE: BLE support is in beta! 21 | * 22 | **************************************************************/ 23 | 24 | #define BLYNK_USE_DIRECT_CONNECT 25 | 26 | #define BLYNK_PRINT Serial 27 | 28 | #include 29 | 30 | // You should get Auth Token in the Blynk App. 31 | // Go to the Project Settings (nut icon). 32 | char auth[] = "YourAuthToken"; 33 | 34 | #define SerialBLE Serial1 // Set Serial object 35 | 36 | void setup() 37 | { 38 | // This is for debug prints 39 | Serial.begin(9600); 40 | 41 | SerialBLE.begin(57600); // BLE Mini uses baud 57600 42 | Blynk.begin(SerialBLE, auth); 43 | } 44 | 45 | void loop() 46 | { 47 | Blynk.run(); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/RFDuino_BLE/RFDuino_BLE.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * This example shows how to use RFduino BLE 18 | * to connect your project to Blynk. 19 | * 20 | * NOTE: BLE support is in beta! 21 | * 22 | **************************************************************/ 23 | 24 | //#define BLYNK_USE_DIRECT_CONNECT 25 | 26 | #define BLYNK_PRINT Serial 27 | 28 | #include 29 | #include 30 | 31 | char auth[] = "YourAuthToken"; 32 | 33 | void setup() 34 | { 35 | Serial.begin(9600); 36 | 37 | RFduinoBLE.deviceName = "RFDuino"; 38 | RFduinoBLE.advertisementInterval = MILLISECONDS(300); 39 | RFduinoBLE.txPowerLevel = -20; // (-20dbM to +4 dBm) 40 | 41 | // start the BLE stack 42 | RFduinoBLE.begin(); 43 | 44 | Blynk.begin(auth); 45 | 46 | Serial.println("Waiting for connections..."); 47 | } 48 | 49 | void loop() 50 | { 51 | Blynk.run(); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /blynk-library/examples/Widgets/Map/Map.ino: -------------------------------------------------------------------------------- 1 | /************************************************************* 2 | Blynk is a platform with iOS and Android apps to control 3 | Arduino, Raspberry Pi and the likes over the Internet. 4 | You can easily build graphic interfaces for all your 5 | projects by simply dragging and dropping widgets. 6 | 7 | Downloads, docs, tutorials: http://www.blynk.cc 8 | Blynk community: http://community.blynk.cc 9 | Social networks: http://www.fb.com/blynkapp 10 | http://twitter.com/blynk_app 11 | 12 | Blynk library is licensed under MIT license 13 | This example code is in public domain. 14 | 15 | ************************************************************* 16 | Output any data on Map widget! 17 | 18 | App project setup: 19 | Map widget on V1 20 | *************************************************************/ 21 | 22 | /* Comment this out to disable prints and save space */ 23 | #define BLYNK_PRINT Serial 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | // You should get Auth Token in the Blynk App. 30 | // Go to the Project Settings (nut icon). 31 | char auth[] = "YourAuthToken"; 32 | 33 | WidgetMap myMap(V1); 34 | 35 | void setup() 36 | { 37 | // Debug console 38 | Serial.begin(9600); 39 | 40 | Blynk.begin(auth); 41 | 42 | // If you want to remove all points: 43 | //myMap.clear(); 44 | 45 | int index = 1; 46 | float lat = 51.5074; 47 | float lon = 0.1278; 48 | myMap.location(index, lat, lon, "value"); 49 | } 50 | 51 | void loop() 52 | { 53 | Blynk.run(); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/Microduino_BLE/Microduino_BLE.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * This example shows how to use Microduino/mCookie Bluetooth LE 18 | * to connect your project to Blynk. 19 | * 20 | * NOTE: BLE support is in beta! 21 | * 22 | **************************************************************/ 23 | 24 | //#define BLYNK_USE_DIRECT_CONNECT 25 | 26 | // For CoreUSB, use Serial for debug output 27 | #define BLYNK_PRINT Serial 28 | 29 | #include 30 | 31 | // You should get Auth Token in the Blynk App. 32 | // Go to the Project Settings (nut icon). 33 | char auth[] = "YourAuthToken"; 34 | 35 | void setup() 36 | { 37 | // Debug console 38 | Serial.begin(9600); 39 | 40 | // Blynk will work through Serial1 41 | // Do not read or write this serial manually in your sketch 42 | Serial1.begin(9600); 43 | Blynk.begin(auth, Serial1); 44 | } 45 | 46 | void loop() 47 | { 48 | Blynk.run(); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonObject_Iterator_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | class JsonObject_Iterator_Test : public testing::Test { 12 | public: 13 | JsonObject_Iterator_Test() : _object(_buffer.createObject()) { 14 | _object["ab"] = 12; 15 | _object["cd"] = 34; 16 | } 17 | 18 | protected: 19 | StaticJsonBuffer _buffer; 20 | JsonObject& _object; 21 | }; 22 | 23 | TEST_F(JsonObject_Iterator_Test, NonConstIterator) { 24 | JsonObject::iterator it = _object.begin(); 25 | ASSERT_NE(_object.end(), it); 26 | EXPECT_STREQ("ab", it->key); 27 | EXPECT_EQ(12, it->value); 28 | it->key = "a.b"; 29 | it->value = 1.2; 30 | ++it; 31 | ASSERT_NE(_object.end(), it); 32 | EXPECT_STREQ("cd", it->key); 33 | EXPECT_EQ(34, it->value); 34 | it->key = "c.d"; 35 | it->value = 3.4; 36 | ++it; 37 | ASSERT_EQ(_object.end(), it); 38 | 39 | ASSERT_EQ(2, _object.size()); 40 | EXPECT_EQ(1.2, _object["a.b"]); 41 | EXPECT_EQ(3.4, _object["c.d"]); 42 | } 43 | 44 | TEST_F(JsonObject_Iterator_Test, ConstIterator) { 45 | const JsonObject& const_object = _object; 46 | JsonObject::const_iterator it = const_object.begin(); 47 | 48 | ASSERT_NE(const_object.end(), it); 49 | EXPECT_STREQ("ab", it->key); 50 | EXPECT_EQ(12, it->value); 51 | ++it; 52 | ASSERT_NE(const_object.end(), it); 53 | EXPECT_STREQ("cd", it->key); 54 | EXPECT_EQ(34, it->value); 55 | ++it; 56 | ASSERT_EQ(const_object.end(), it); 57 | } 58 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/Simblee_BLE/Simblee_BLE.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * This example shows how to use Simblee BLE 18 | * to connect your project to Blynk. 19 | * 20 | * NOTE: BLE support is in beta! 21 | * 22 | **************************************************************/ 23 | 24 | //#define BLYNK_USE_DIRECT_CONNECT 25 | 26 | #define BLYNK_PRINT Serial 27 | 28 | #include 29 | #include 30 | 31 | char auth[] = "YourAuthToken"; 32 | 33 | void setup() 34 | { 35 | Serial.begin(9600); 36 | 37 | SimbleeBLE.deviceName = "Simblee"; 38 | SimbleeBLE.advertisementInterval = MILLISECONDS(300); 39 | SimbleeBLE.txPowerLevel = -20; // (-20dbM to +4 dBm) 40 | 41 | // start the BLE stack 42 | SimbleeBLE.begin(); 43 | 44 | Blynk.begin(auth); 45 | 46 | Serial.println("Bluetooth device active, waiting for connections..."); 47 | } 48 | 49 | 50 | void loop() 51 | { 52 | Blynk.run(); 53 | } 54 | 55 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_WiFi/LinkItONE/LinkItONE.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * This example shows how to use LinkItONE to connect your project to Blynk. 18 | * 19 | * Change WiFi ssid, pass, and Blynk auth token to run :) 20 | * Feel free to apply it to any other example. It's simple! 21 | * 22 | **************************************************************/ 23 | #include 24 | #include 25 | #include 26 | 27 | // You should get Auth Token in the Blynk App. 28 | // Go to the Project Settings (nut icon). 29 | char auth[] = "YourAuthToken"; 30 | 31 | // Your WiFi credentials. 32 | // Choose wifi_sec from LWIFI_OPEN, LWIFI_WPA, or LWIFI_WEP 33 | char ssid[] = "YourNetworkName"; 34 | char pass[] = "YourPassword"; 35 | int wifi_sec = LWIFI_WPA; 36 | 37 | void setup() 38 | { 39 | Serial.begin(9600); 40 | Blynk.begin(auth, ssid, pass, wifi_sec); 41 | } 42 | 43 | void loop() 44 | { 45 | Blynk.run(); 46 | } 47 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/StringTraits/ArduinoStream.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include "../TypeTraits/EnableIf.hpp" 13 | #include "../TypeTraits/IsBaseOf.hpp" 14 | #include "../TypeTraits/RemoveReference.hpp" 15 | 16 | namespace ArduinoJson { 17 | namespace Internals { 18 | 19 | struct ArduinoStreamTraits { 20 | class Reader { 21 | Stream& _stream; 22 | char _current, _next; 23 | 24 | public: 25 | Reader(Stream& stream) : _stream(stream), _current(0), _next(0) {} 26 | 27 | void move() { 28 | _current = _next; 29 | _next = 0; 30 | } 31 | 32 | char current() { 33 | if (!_current) _current = read(); 34 | return _current; 35 | } 36 | 37 | char next() { 38 | // assumes that current() has been called 39 | if (!_next) _next = read(); 40 | return _next; 41 | } 42 | 43 | private: 44 | char read() { 45 | // don't use _stream.read() as it ignores the timeout 46 | char c = 0; 47 | _stream.readBytes(&c, 1); 48 | return c; 49 | } 50 | }; 51 | }; 52 | 53 | template 54 | struct StringTraits::type>::value>::type> 59 | : ArduinoStreamTraits {}; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ArduinoJson/test/JsonArray_CopyTo_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | TEST(JsonArray_CopyTo_Tests, BiggerOneDimensionIntegerArray) { 12 | char json[] = "[1,2,3]"; 13 | 14 | DynamicJsonBuffer jsonBuffer; 15 | JsonArray& array = jsonBuffer.parseArray(json); 16 | 17 | int destination[4] = {0}; 18 | size_t result = array.copyTo(destination); 19 | 20 | ASSERT_EQ(3, result); 21 | ASSERT_EQ(1, destination[0]); 22 | ASSERT_EQ(2, destination[1]); 23 | ASSERT_EQ(3, destination[2]); 24 | ASSERT_EQ(0, destination[3]); 25 | } 26 | 27 | TEST(JsonArray_CopyTo_Tests, SmallerOneDimensionIntegerArray) { 28 | char json[] = "[1,2,3]"; 29 | 30 | DynamicJsonBuffer jsonBuffer; 31 | JsonArray& array = jsonBuffer.parseArray(json); 32 | 33 | int destination[2] = {0}; 34 | size_t result = array.copyTo(destination); 35 | 36 | ASSERT_EQ(2, result); 37 | ASSERT_EQ(1, destination[0]); 38 | ASSERT_EQ(2, destination[1]); 39 | } 40 | 41 | TEST(JsonArray_CopyTo_Tests, TwoOneDimensionIntegerArray) { 42 | char json[] = "[[1,2],[3],[4]]"; 43 | 44 | DynamicJsonBuffer jsonBuffer; 45 | JsonArray& array = jsonBuffer.parseArray(json); 46 | 47 | int destination[3][2] = {{0}}; 48 | array.copyTo(destination); 49 | 50 | ASSERT_EQ(1, destination[0][0]); 51 | ASSERT_EQ(2, destination[0][1]); 52 | ASSERT_EQ(3, destination[1][0]); 53 | ASSERT_EQ(0, destination[1][1]); 54 | ASSERT_EQ(4, destination[2][0]); 55 | ASSERT_EQ(0, destination[2][1]); 56 | } 57 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/StringTraits/StdStream.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "../TypeTraits/EnableIf.hpp" 12 | #include "../TypeTraits/IsBaseOf.hpp" 13 | #include "../TypeTraits/RemoveReference.hpp" 14 | 15 | namespace ArduinoJson { 16 | namespace Internals { 17 | 18 | struct StdStreamTraits { 19 | class Reader { 20 | std::istream& _stream; 21 | char _current, _next; 22 | 23 | public: 24 | Reader(std::istream& stream) : _stream(stream), _current(0), _next(0) {} 25 | 26 | void move() { 27 | _current = _next; 28 | _next = 0; 29 | } 30 | 31 | char current() { 32 | if (!_current) _current = read(); 33 | return _current; 34 | } 35 | 36 | char next() { 37 | // assumes that current() has been called 38 | if (!_next) _next = read(); 39 | return _next; 40 | } 41 | 42 | private: 43 | Reader& operator=(const Reader&); // Visual Studio C4512 44 | 45 | char read() { 46 | return _stream.eof() ? '\0' : static_cast(_stream.get()); 47 | } 48 | }; 49 | }; 50 | 51 | template 52 | struct StringTraits::type>::value>::type> 57 | : StdStreamTraits {}; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Ethernet/Intel_Galileo/Intel_Galileo.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * This example shows how to use Intel Galileo with Blynk. 17 | * 18 | * Feel free to apply it to any other example. It's simple! 19 | * 20 | **************************************************************/ 21 | 22 | #define BLYNK_PRINT Serial // Comment this out to disable prints and save space 23 | #include 24 | #include 25 | #include 26 | 27 | // You should get Auth Token in the Blynk App. 28 | // Go to the Project Settings (nut icon). 29 | char auth[] = "YourAuthToken"; 30 | 31 | void setup() 32 | { 33 | Serial.begin(9600); 34 | Blynk.begin(auth); 35 | // You can also specify server. 36 | // For more options, see Boards_Ethernet/Arduino_Ethernet_Manual example 37 | //Blynk.begin(auth, "your_server.com", 8442); 38 | //Blynk.begin(auth, IPAddress(192,168,1,100), 8888); 39 | } 40 | 41 | void loop() 42 | { 43 | Blynk.run(); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_USB_Serial/chipKIT_Uno32/chipKIT_Uno32.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * This example shows how to use ordinary Arduino Serial 17 | * to connect your project to Blynk. 18 | * Feel free to apply it to any other example. It's simple! 19 | * 20 | ************************************************************** 21 | * USB HOWTO: http://tiny.cc/BlynkUSB 22 | **************************************************************/ 23 | 24 | #define BLYNK_PRINT Serial1 25 | #include 26 | 27 | // You should get Auth Token in the Blynk App. 28 | // Go to the Project Settings (nut icon). 29 | char auth[] = "YourAuthToken"; 30 | 31 | void setup() 32 | { 33 | // Debug prints on pins 39 (RX), 40 (TX) 34 | Serial1.begin(9600); 35 | 36 | // Blynk will work through Serial 37 | // Do not read or write this serial manually in your sketch 38 | Serial.begin(9600); 39 | Blynk.begin(Serial, auth); 40 | } 41 | 42 | void loop() 43 | { 44 | Blynk.run(); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_USB_Serial/Arduino_Zero_M0_Serial/Arduino_Zero_M0_Serial.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * This example shows how to use ordinary Arduino Serial 17 | * to connect your project to Blynk. 18 | * Feel free to apply it to any other example. It's simple! 19 | * 20 | ************************************************************** 21 | * USB HOWTO: http://tiny.cc/BlynkUSB 22 | **************************************************************/ 23 | 24 | #define BLYNK_PRINT SerialUSB 25 | #include 26 | 27 | // You should get Auth Token in the Blynk App. 28 | // Go to the Project Settings (nut icon). 29 | char auth[] = "YourAuthToken"; 30 | 31 | void setup() 32 | { 33 | // Debug console to SerialUSB 34 | SerialUSB.begin(9600); 35 | 36 | // Blynk will work through Serial 37 | // Do not read or write this serial manually in your sketch 38 | Serial.begin(9600); 39 | Blynk.begin(Serial, auth); 40 | } 41 | 42 | void loop() 43 | { 44 | Blynk.run(); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/nRF8001/BLESerial.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLE_SERIAL_H_ 2 | #define _BLE_SERIAL_H_ 3 | 4 | #include 5 | #include 6 | 7 | class BLESerial : public BLEPeripheral, public Stream 8 | { 9 | public: 10 | BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); 11 | 12 | void begin(...); 13 | void poll(); 14 | void end(); 15 | 16 | virtual int available(void); 17 | virtual int peek(void); 18 | virtual int read(void); 19 | virtual void flush(void); 20 | virtual size_t write(uint8_t byte); 21 | virtual size_t write(const uint8_t *buff, size_t len); 22 | using Print::write; 23 | virtual operator bool(); 24 | 25 | private: 26 | static BLESerial* _instance; 27 | 28 | size_t _rxHead; 29 | size_t _rxTail; 30 | size_t _rxCount() const; 31 | uint8_t _rxBuffer[256]; 32 | 33 | BLEService _uartService = BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); 34 | BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); 35 | BLECharacteristic _rxCharacteristic = BLECharacteristic("6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse | BLEWrite, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 36 | BLEDescriptor _rxNameDescriptor = BLEDescriptor("2901", "RX - Receive Data (Write)"); 37 | BLECharacteristic _txCharacteristic = BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLERead | BLENotify, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 38 | BLEDescriptor _txNameDescriptor = BLEDescriptor("2901", "TX - Transfer Data (Notify)"); 39 | 40 | void _received(const uint8_t* data, size_t size); 41 | static void _received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/StringTraits/CharPointer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../TypeTraits/EnableIf.hpp" 11 | #include "../TypeTraits/IsChar.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | template 17 | struct CharPointerTraits { 18 | class Reader { 19 | const TChar* _ptr; 20 | 21 | public: 22 | Reader(const TChar* ptr) 23 | : _ptr(ptr ? ptr : reinterpret_cast("")) {} 24 | 25 | void move() { 26 | ++_ptr; 27 | } 28 | 29 | TChar current() const { 30 | return _ptr[0]; 31 | } 32 | 33 | TChar next() const { 34 | return _ptr[1]; 35 | } 36 | }; 37 | 38 | static bool equals(const TChar* str, const char* expected) { 39 | return strcmp(reinterpret_cast(str), expected) == 0; 40 | } 41 | 42 | template 43 | static char* duplicate(const TChar* str, Buffer* buffer) { 44 | if (!str) return NULL; 45 | size_t size = strlen(reinterpret_cast(str)) + 1; 46 | void* dup = buffer->alloc(size); 47 | if (dup != NULL) memcpy(dup, str, size); 48 | return static_cast(dup); 49 | } 50 | 51 | static const bool has_append = false; 52 | static const bool has_equals = true; 53 | static const bool should_duplicate = false; 54 | }; 55 | 56 | template 57 | struct StringTraits::value>::type> 59 | : CharPointerTraits {}; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/BBC_MicroBit/BLESerial.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLE_SERIAL_H_ 2 | #define _BLE_SERIAL_H_ 3 | 4 | #include 5 | #include 6 | 7 | class BLESerial : public BLEPeripheral, public Stream 8 | { 9 | public: 10 | BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); 11 | 12 | void begin(...); 13 | void poll(); 14 | void end(); 15 | 16 | virtual int available(void); 17 | virtual int peek(void); 18 | virtual int read(void); 19 | virtual void flush(void); 20 | virtual size_t write(uint8_t byte); 21 | virtual size_t write(const uint8_t *buff, size_t len); 22 | using Print::write; 23 | virtual operator bool(); 24 | 25 | private: 26 | static BLESerial* _instance; 27 | 28 | size_t _rxHead; 29 | size_t _rxTail; 30 | size_t _rxCount() const; 31 | uint8_t _rxBuffer[256]; 32 | 33 | BLEService _uartService = BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); 34 | BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); 35 | BLECharacteristic _rxCharacteristic = BLECharacteristic("6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse | BLEWrite, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 36 | BLEDescriptor _rxNameDescriptor = BLEDescriptor("2901", "RX - Receive Data (Write)"); 37 | BLECharacteristic _txCharacteristic = BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLERead | BLENotify, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 38 | BLEDescriptor _txNameDescriptor = BLEDescriptor("2901", "TX - Transfer Data (Notify)"); 39 | 40 | void _received(const uint8_t* data, size_t size); 41 | static void _received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_WiFi/Fishino/Fishino.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * This example shows how to use Fishino to connect your project to Blynk. 18 | * 19 | * Note: This requires Fishino Software libraries: 20 | * http://fishino.it/en/download/ 21 | * 22 | * Change WiFi ssid, pass, and Blynk auth token to run :) 23 | * 24 | **************************************************************/ 25 | 26 | #define BLYNK_PRINT Serial // Comment this out to disable prints and save space 27 | #include 28 | #include 29 | #include 30 | 31 | // You should get Auth Token in the Blynk App. 32 | // Go to the Project Settings (nut icon). 33 | char auth[] = "YourAuthToken"; 34 | 35 | // Your WiFi credentials. 36 | // Set password to "" for open networks. 37 | char ssid[] = "YourNetworkName"; 38 | char pass[] = "YourPassword"; 39 | 40 | void setup() 41 | { 42 | Serial.begin(9600); 43 | Blynk.begin(auth, ssid, pass); 44 | } 45 | 46 | void loop() 47 | { 48 | Blynk.run(); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Deserialization/Comments.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | template 13 | void skipSpacesAndComments(TInput& input) { 14 | for (;;) { 15 | switch (input.current()) { 16 | // spaces 17 | case ' ': 18 | case '\t': 19 | case '\r': 20 | case '\n': 21 | input.move(); 22 | continue; 23 | 24 | // comments 25 | case '/': 26 | switch (input.next()) { 27 | // C-style block comment 28 | case '*': 29 | input.move(); // skip '/' 30 | // no need to skip '*' 31 | for (;;) { 32 | input.move(); 33 | if (input.current() == '\0') return; 34 | if (input.current() == '*' && input.next() == '/') { 35 | input.move(); // skip '*' 36 | input.move(); // skip '/' 37 | break; 38 | } 39 | } 40 | break; 41 | 42 | // C++-style line comment 43 | case '/': 44 | // not need to skip "//" 45 | for (;;) { 46 | input.move(); 47 | if (input.current() == '\0') return; 48 | if (input.current() == '\n') break; 49 | } 50 | break; 51 | 52 | // not a comment, just a '/' 53 | default: 54 | return; 55 | } 56 | break; 57 | 58 | default: 59 | return; 60 | } 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/Adafruit_Bluefruit_LE/BLESerial.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLE_SERIAL_H_ 2 | #define _BLE_SERIAL_H_ 3 | 4 | #include 5 | #include 6 | 7 | class BLESerial : public BLEPeripheral, public Stream 8 | { 9 | public: 10 | BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); 11 | 12 | void begin(...); 13 | void poll(); 14 | void end(); 15 | 16 | virtual int available(void); 17 | virtual int peek(void); 18 | virtual int read(void); 19 | virtual void flush(void); 20 | virtual size_t write(uint8_t byte); 21 | virtual size_t write(const uint8_t *buff, size_t len); 22 | using Print::write; 23 | virtual operator bool(); 24 | 25 | private: 26 | static BLESerial* _instance; 27 | 28 | size_t _rxHead; 29 | size_t _rxTail; 30 | size_t _rxCount() const; 31 | uint8_t _rxBuffer[256]; 32 | 33 | BLEService _uartService = BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); 34 | BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); 35 | BLECharacteristic _rxCharacteristic = BLECharacteristic("6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse | BLEWrite, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 36 | BLEDescriptor _rxNameDescriptor = BLEDescriptor("2901", "RX - Receive Data (Write)"); 37 | BLECharacteristic _txCharacteristic = BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLERead | BLENotify, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 38 | BLEDescriptor _txNameDescriptor = BLEDescriptor("2901", "TX - Transfer Data (Notify)"); 39 | 40 | void _received(const uint8_t* data, size_t size); 41 | static void _received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_Bluetooth/RedBearLab_BlendMicro/BLESerial.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLE_SERIAL_H_ 2 | #define _BLE_SERIAL_H_ 3 | 4 | #include 5 | #include 6 | 7 | class BLESerial : public BLEPeripheral, public Stream 8 | { 9 | public: 10 | BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); 11 | 12 | void begin(...); 13 | void poll(); 14 | void end(); 15 | 16 | virtual int available(void); 17 | virtual int peek(void); 18 | virtual int read(void); 19 | virtual void flush(void); 20 | virtual size_t write(uint8_t byte); 21 | virtual size_t write(const uint8_t *buff, size_t len); 22 | using Print::write; 23 | virtual operator bool(); 24 | 25 | private: 26 | static BLESerial* _instance; 27 | 28 | size_t _rxHead; 29 | size_t _rxTail; 30 | size_t _rxCount() const; 31 | uint8_t _rxBuffer[256]; 32 | 33 | BLEService _uartService = BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); 34 | BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); 35 | BLECharacteristic _rxCharacteristic = BLECharacteristic("6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse | BLEWrite, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 36 | BLEDescriptor _rxNameDescriptor = BLEDescriptor("2901", "RX - Receive Data (Write)"); 37 | BLECharacteristic _txCharacteristic = BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLERead | BLENotify, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 38 | BLEDescriptor _txNameDescriptor = BLEDescriptor("2901", "TX - Transfer Data (Notify)"); 39 | 40 | void _received(const uint8_t* data, size_t size); 41 | static void _received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /blynk-library/examples/Boards_USB_Serial/Digistump_Digispark/Digistump_Digispark.ino: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Blynk is a platform with iOS and Android apps to control 3 | * Arduino, Raspberry Pi and the likes over the Internet. 4 | * You can easily build graphic interfaces for all your 5 | * projects by simply dragging and dropping widgets. 6 | * 7 | * Downloads, docs, tutorials: http://www.blynk.cc 8 | * Blynk community: http://community.blynk.cc 9 | * Social networks: http://www.fb.com/blynkapp 10 | * http://twitter.com/blynk_app 11 | * 12 | * Blynk library is licensed under MIT license 13 | * This example code is in public domain. 14 | * 15 | ************************************************************** 16 | * 17 | * There is an USB issue on Linux: 18 | * https://github.com/digistump/DigistumpArduino/issues/16 19 | * 20 | ************************************************************** 21 | * USB HOWTO: http://tiny.cc/BlynkUSB 22 | **************************************************************/ 23 | 24 | // Minimize size for non-Pro version 25 | #if !defined(ARDUINO_AVR_DIGISPARKPRO) 26 | #define BLYNK_NO_INFO 27 | #define BLYNK_NO_BUILTIN 28 | #endif 29 | 30 | #include 31 | #include 32 | 33 | // You should get Auth Token in the Blynk App. 34 | // Go to the Project Settings (nut icon). 35 | char auth[] = "YourAuthToken"; 36 | 37 | void setup() 38 | { 39 | // Blynk will work through SerialUSB 40 | // Do not read or write this serial manually in your sketch 41 | SerialUSB.begin(); 42 | Blynk.begin(SerialUSB, auth); 43 | } 44 | 45 | void loop() 46 | { 47 | Blynk.run(); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /ArduinoJson/include/ArduinoJson/Data/ValueSetter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../JsonBuffer.hpp" 11 | #include "../JsonVariant.hpp" 12 | #include "../StringTraits/StringTraits.hpp" 13 | #include "../TypeTraits/EnableIf.hpp" 14 | 15 | namespace ArduinoJson { 16 | namespace Internals { 17 | 18 | template 19 | struct ValueSetter { 20 | template 21 | static bool set(JsonBuffer*, TDestination& destination, 22 | const TSource& source) { 23 | destination = source; 24 | return true; 25 | } 26 | }; 27 | 28 | template 29 | struct ValueSetter::should_duplicate>::type> { 31 | template 32 | static bool set(JsonBuffer* buffer, TDestination& destination, 33 | const TSource& source) { 34 | const char* copy = buffer->strdup(source); 35 | if (!copy) return false; 36 | destination = copy; 37 | return true; 38 | } 39 | }; 40 | 41 | template 42 | struct ValueSetter::should_duplicate>::type> { 44 | template 45 | static bool set(JsonBuffer*, TDestination& destination, 46 | const TSource& source) { 47 | // unsigned char* -> char* 48 | destination = reinterpret_cast(source); 49 | return true; 50 | } 51 | }; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ArduinoJson/test/Issue10.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2017 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include 9 | #include 10 | 11 | struct Person { 12 | int id; 13 | char name[32]; 14 | }; 15 | 16 | class Issue10 : public testing::Test { 17 | protected: 18 | virtual void SetUp() { 19 | Person boss; 20 | boss.id = 1; 21 | strcpy(boss.name, "Jeff"); 22 | Person employee; 23 | employee.id = 2; 24 | strcpy(employee.name, "John"); 25 | persons[0] = boss; 26 | persons[1] = employee; 27 | } 28 | 29 | template 30 | void checkJsonString(const T &p) { 31 | char buffer[256]; 32 | p.printTo(buffer, sizeof(buffer)); 33 | 34 | EXPECT_STREQ("[{\"id\":1,\"name\":\"Jeff\"},{\"id\":2,\"name\":\"John\"}]", 35 | buffer); 36 | } 37 | 38 | StaticJsonBuffer json; 39 | Person persons[2]; 40 | }; 41 | 42 | TEST_F(Issue10, PopulateArrayByAddingAnObject) { 43 | JsonArray &array = json.createArray(); 44 | 45 | for (int i = 0; i < 2; i++) { 46 | JsonObject &object = json.createObject(); 47 | 48 | object["id"] = persons[i].id; 49 | object["name"] = persons[i].name; 50 | 51 | array.add(object); 52 | } 53 | 54 | checkJsonString(array); 55 | } 56 | 57 | TEST_F(Issue10, PopulateArrayByCreatingNestedObjects) { 58 | JsonArray &array = json.createArray(); 59 | 60 | for (int i = 0; i < 2; i++) { 61 | JsonObject &object = array.createNestedObject(); 62 | 63 | object["id"] = persons[i].id; 64 | object["name"] = persons[i].name; 65 | } 66 | 67 | checkJsonString(array); 68 | } 69 | --------------------------------------------------------------------------------