├── .gitignore ├── Eagle ├── esp.brd └── esp.sch ├── Gerber ├── esp.dri ├── esp.gbl ├── esp.gbo ├── esp.gbs ├── esp.gko ├── esp.gpi ├── esp.gtl ├── esp.gto ├── esp.gts └── esp.txt ├── LICENSE ├── OpenHab ├── PZEM │ ├── configurations │ │ ├── items │ │ │ └── default.items │ │ ├── persistence │ │ │ └── rrd4j.persist │ │ ├── rules │ │ │ └── default.rules │ │ └── sitemaps │ │ │ └── default.sitemap │ └── icons │ │ ├── current.png │ │ ├── energy.png │ │ ├── power.png │ │ └── voltage.png └── configurations │ ├── items │ └── room.items │ ├── openhab.cfg │ ├── persistence │ └── rrd4j.persist │ ├── rules │ └── room.rules │ └── sitemaps │ └── default.sitemap ├── README.md ├── esp_sensor ├── MY_ESP_UART.cpp ├── MY_ESP_UART.h ├── data │ ├── bootstrap.min.css.gz │ ├── bootstrap.min.js.gz │ ├── favicon.ico │ ├── glyphicons.ttf.gz │ ├── glyphicons.woff │ ├── glyphicons.woff2 │ ├── jquery.min.js.gz │ └── wifi.htm ├── esp_sensor.ino ├── htmlEdit.ino ├── json_config.cpp ├── json_config.h ├── libraries │ ├── Adafruit_MQTT │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE.md │ │ │ └── PULL_REQUEST_TEMPLATE.md │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Adafruit_MQTT.cpp │ │ ├── Adafruit_MQTT.h │ │ ├── Adafruit_MQTT_CC3000.h │ │ ├── Adafruit_MQTT_Client.cpp │ │ ├── Adafruit_MQTT_Client.h │ │ ├── Adafruit_MQTT_FONA.h │ │ ├── LICENSE │ │ ├── README.md │ │ ├── examples │ │ │ ├── adafruitio_anon_time_esp8266 │ │ │ │ └── adafruitio_anon_time_esp8266.ino │ │ │ ├── adafruitio_errors_esp8266 │ │ │ │ └── adafruitio_errors_esp8266.ino │ │ │ ├── adafruitio_secure_esp8266 │ │ │ │ └── adafruitio_secure_esp8266.ino │ │ │ ├── adafruitio_time_esp8266 │ │ │ │ └── adafruitio_time_esp8266.ino │ │ │ ├── mqtt_2subs_esp8266 │ │ │ │ ├── .due.test.skip │ │ │ │ ├── .leonardo.test.skip │ │ │ │ ├── .uno.test.skip │ │ │ │ ├── .zero.test.skip │ │ │ │ └── mqtt_2subs_esp8266.ino │ │ │ ├── mqtt_arbitrary_data │ │ │ │ ├── .due.test.skip │ │ │ │ ├── .leonardo.test.skip │ │ │ │ ├── .uno.test.skip │ │ │ │ ├── .zero.test.skip │ │ │ │ ├── README.md │ │ │ │ ├── mqtt_arbitrary_data.ino │ │ │ │ └── python_subscriber │ │ │ │ │ ├── mqtt_figure.png │ │ │ │ │ ├── requirements.txt │ │ │ │ │ └── subscriber.py │ │ │ ├── mqtt_cc3k │ │ │ │ ├── .due.test.skip │ │ │ │ ├── .esp8266.test.skip │ │ │ │ ├── .leonardo.test.skip │ │ │ │ ├── .uno.test.skip │ │ │ │ ├── .zero.test.skip │ │ │ │ ├── cc3000helper.cpp │ │ │ │ └── mqtt_cc3k.ino │ │ │ ├── mqtt_esp8266 │ │ │ │ ├── .due.test.skip │ │ │ │ ├── .leonardo.test.skip │ │ │ │ ├── .uno.test.skip │ │ │ │ ├── .zero.test.skip │ │ │ │ └── mqtt_esp8266.ino │ │ │ ├── mqtt_esp8266_callback │ │ │ │ └── mqtt_esp8266_callback.ino │ │ │ ├── mqtt_ethernet │ │ │ │ ├── .due.test.skip │ │ │ │ ├── .esp8266.test.skip │ │ │ │ └── mqtt_ethernet.ino │ │ │ ├── mqtt_fona │ │ │ │ ├── .due.test.skip │ │ │ │ ├── .esp8266.test.skip │ │ │ │ ├── fonahelper.cpp │ │ │ │ └── mqtt_fona.ino │ │ │ ├── mqtt_winc1500 │ │ │ │ └── mqtt_winc1500.ino │ │ │ └── mqtt_yun │ │ │ │ ├── .due.test.skip │ │ │ │ ├── .leonardo.test.skip │ │ │ │ ├── .uno.test.skip │ │ │ │ ├── .zero.test.skip │ │ │ │ └── mqtt_yun.ino │ │ ├── keywords.txt │ │ └── library.properties │ ├── ArduinoJson │ │ ├── ArduinoJson.h │ │ ├── CHANGELOG.md │ │ ├── CMakeLists.txt │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── examples │ │ │ ├── IndentedPrintExample │ │ │ │ └── IndentedPrintExample.ino │ │ │ ├── JsonGeneratorExample │ │ │ │ └── JsonGeneratorExample.ino │ │ │ ├── JsonHttpClient │ │ │ │ └── JsonHttpClient.ino │ │ │ ├── JsonParserExample │ │ │ │ └── JsonParserExample.ino │ │ │ ├── JsonServer │ │ │ │ └── JsonServer.ino │ │ │ ├── JsonUdpBeacon │ │ │ │ └── JsonUdpBeacon.ino │ │ │ └── StringExample │ │ │ │ └── StringExample.ino │ │ ├── include │ │ │ ├── ArduinoJson.h │ │ │ ├── ArduinoJson.hpp │ │ │ └── ArduinoJson │ │ │ │ ├── Configuration.hpp │ │ │ │ ├── DynamicJsonBuffer.hpp │ │ │ │ ├── Internals │ │ │ │ ├── BlockJsonBuffer.hpp │ │ │ │ ├── Comments.hpp │ │ │ │ ├── DummyPrint.hpp │ │ │ │ ├── DynamicStringBuilder.hpp │ │ │ │ ├── Encoding.hpp │ │ │ │ ├── IndentedPrint.hpp │ │ │ │ ├── JsonBufferAllocated.hpp │ │ │ │ ├── JsonFloat.hpp │ │ │ │ ├── JsonInteger.hpp │ │ │ │ ├── JsonParser.hpp │ │ │ │ ├── JsonParser.ipp │ │ │ │ ├── JsonPrintable.hpp │ │ │ │ ├── JsonSerializer.hpp │ │ │ │ ├── JsonSerializer.ipp │ │ │ │ ├── JsonVariantAs.hpp │ │ │ │ ├── JsonVariantContent.hpp │ │ │ │ ├── JsonVariantDefault.hpp │ │ │ │ ├── JsonVariantType.hpp │ │ │ │ ├── JsonWriter.hpp │ │ │ │ ├── List.hpp │ │ │ │ ├── ListConstIterator.hpp │ │ │ │ ├── ListIterator.hpp │ │ │ │ ├── ListNode.hpp │ │ │ │ ├── Parse.hpp │ │ │ │ ├── Prettyfier.hpp │ │ │ │ ├── ReferenceType.hpp │ │ │ │ ├── StaticStringBuilder.hpp │ │ │ │ ├── StreamPrintAdapter.hpp │ │ │ │ ├── StringFuncs.hpp │ │ │ │ └── ValueSetter.hpp │ │ │ │ ├── JsonArray.hpp │ │ │ │ ├── JsonArray.ipp │ │ │ │ ├── JsonArraySubscript.hpp │ │ │ │ ├── JsonBuffer.hpp │ │ │ │ ├── JsonBuffer.ipp │ │ │ │ ├── JsonObject.hpp │ │ │ │ ├── JsonObject.ipp │ │ │ │ ├── JsonObjectSubscript.hpp │ │ │ │ ├── JsonPair.hpp │ │ │ │ ├── JsonVariant.hpp │ │ │ │ ├── JsonVariant.ipp │ │ │ │ ├── JsonVariantBase.hpp │ │ │ │ ├── Polyfills │ │ │ │ ├── attributes.hpp │ │ │ │ ├── math.hpp │ │ │ │ └── normalize.hpp │ │ │ │ ├── Print.hpp │ │ │ │ ├── RawJson.hpp │ │ │ │ ├── StaticJsonBuffer.hpp │ │ │ │ └── TypeTraits │ │ │ │ ├── ConstRefOrConstPtr.hpp │ │ │ │ ├── EnableIf.hpp │ │ │ │ ├── IsFloatingPoint.hpp │ │ │ │ ├── IsIntegral.hpp │ │ │ │ ├── IsSame.hpp │ │ │ │ ├── IsSignedIntegral.hpp │ │ │ │ ├── IsUnsignedIntegral.hpp │ │ │ │ ├── RemoveConst.hpp │ │ │ │ └── RemoveReference.hpp │ │ ├── keywords.txt │ │ ├── library.json │ │ ├── library.properties │ │ ├── scripts │ │ │ ├── buffer-size-calculator.html │ │ │ ├── build-arduino-package.sh │ │ │ ├── cpplint.sh │ │ │ ├── create-build-envs.sh │ │ │ ├── create-size-graph.sh │ │ │ ├── format-code.sh │ │ │ ├── run-tests.sh │ │ │ └── travis │ │ │ │ ├── arduino.sh │ │ │ │ ├── cmake-osx.sh │ │ │ │ ├── cmake.sh │ │ │ │ ├── coverage.sh │ │ │ │ └── platformio.sh │ │ ├── test │ │ │ ├── CMakeLists.txt │ │ │ ├── DynamicJsonBuffer_Array_Tests.cpp │ │ │ ├── DynamicJsonBuffer_Basic_Tests.cpp │ │ │ ├── DynamicJsonBuffer_NoMemory_Tests.cpp │ │ │ ├── DynamicJsonBuffer_Object_Tests.cpp │ │ │ ├── GbathreeBug.cpp │ │ │ ├── IntegrationTests.cpp │ │ │ ├── Issue10.cpp │ │ │ ├── Issue214.cpp │ │ │ ├── Issue34.cpp │ │ │ ├── Issue90.cpp │ │ │ ├── JsonArray_Add_Tests.cpp │ │ │ ├── JsonArray_Basic_Tests.cpp │ │ │ ├── JsonArray_CopyFrom_Tests.cpp │ │ │ ├── JsonArray_CopyTo_Tests.cpp │ │ │ ├── JsonArray_Invalid_Tests.cpp │ │ │ ├── JsonArray_Iterator_Tests.cpp │ │ │ ├── JsonArray_PrettyPrintTo_Tests.cpp │ │ │ ├── JsonArray_PrintTo_Tests.cpp │ │ │ ├── JsonArray_Remove_Tests.cpp │ │ │ ├── JsonArray_Set_Tests.cpp │ │ │ ├── JsonArray_Subscript_Tests.cpp │ │ │ ├── JsonObject_Basic_Tests.cpp │ │ │ ├── JsonObject_ContainsKey_Tests.cpp │ │ │ ├── JsonObject_Get_Tests.cpp │ │ │ ├── JsonObject_Invalid_Tests.cpp │ │ │ ├── JsonObject_Iterator_Tests.cpp │ │ │ ├── JsonObject_PrettyPrintTo_Tests.cpp │ │ │ ├── JsonObject_PrintTo_Tests.cpp │ │ │ ├── JsonObject_Remove_Tests.cpp │ │ │ ├── JsonObject_Set_Tests.cpp │ │ │ ├── JsonObject_Subscript_Tests.cpp │ │ │ ├── JsonParser_Array_Tests.cpp │ │ │ ├── JsonParser_Nested_Tests.cpp │ │ │ ├── JsonParser_NestingLimit_Tests.cpp │ │ │ ├── JsonParser_Object_Tests.cpp │ │ │ ├── JsonParser_Variant_Tests.cpp │ │ │ ├── JsonVariant_As_Tests.cpp │ │ │ ├── JsonVariant_Comparison_Tests.cpp │ │ │ ├── JsonVariant_Copy_Tests.cpp │ │ │ ├── JsonVariant_Is_Tests.cpp │ │ │ ├── JsonVariant_PrintTo_Tests.cpp │ │ │ ├── JsonVariant_Storage_Tests.cpp │ │ │ ├── JsonVariant_Subscript_Tests.cpp │ │ │ ├── JsonVariant_Success_Tests.cpp │ │ │ ├── JsonVariant_Undefined_Tests.cpp │ │ │ ├── JsonWriter_WriteFloat_Tests.cpp │ │ │ ├── JsonWriter_WriteString_Tests.cpp │ │ │ ├── StaticJsonBuffer_Basic_Tests.cpp │ │ │ ├── StaticJsonBuffer_CreateArray_Tests.cpp │ │ │ ├── StaticJsonBuffer_CreateObject_Tests.cpp │ │ │ ├── StaticJsonBuffer_ParseArray_Tests.cpp │ │ │ ├── StaticJsonBuffer_ParseObject_Tests.cpp │ │ │ ├── StdStream.cpp │ │ │ ├── StringBuilderTests.cpp │ │ │ ├── String_Tests.cpp │ │ │ └── gtest.cmake │ │ └── third-party │ │ │ ├── cpplint │ │ │ └── cpplint.py │ │ │ └── gtest-1.7.0 │ │ │ ├── CHANGES │ │ │ ├── CMakeLists.txt │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── README │ │ │ ├── aclocal.m4 │ │ │ ├── build-aux │ │ │ ├── config.guess │ │ │ ├── config.h.in │ │ │ ├── config.sub │ │ │ ├── depcomp │ │ │ ├── install-sh │ │ │ ├── ltmain.sh │ │ │ └── missing │ │ │ ├── cmake │ │ │ └── internal_utils.cmake │ │ │ ├── codegear │ │ │ ├── gtest.cbproj │ │ │ ├── gtest.groupproj │ │ │ ├── gtest_all.cc │ │ │ ├── gtest_link.cc │ │ │ ├── gtest_main.cbproj │ │ │ └── gtest_unittest.cbproj │ │ │ ├── configure │ │ │ ├── configure.ac │ │ │ ├── fused-src │ │ │ └── gtest │ │ │ │ ├── gtest-all.cc │ │ │ │ ├── gtest.h │ │ │ │ └── gtest_main.cc │ │ │ ├── include │ │ │ └── gtest │ │ │ │ ├── gtest-death-test.h │ │ │ │ ├── gtest-message.h │ │ │ │ ├── gtest-param-test.h │ │ │ │ ├── gtest-param-test.h.pump │ │ │ │ ├── gtest-printers.h │ │ │ │ ├── gtest-spi.h │ │ │ │ ├── gtest-test-part.h │ │ │ │ ├── gtest-typed-test.h │ │ │ │ ├── gtest.h │ │ │ │ ├── gtest_pred_impl.h │ │ │ │ ├── gtest_prod.h │ │ │ │ └── internal │ │ │ │ ├── gtest-death-test-internal.h │ │ │ │ ├── gtest-filepath.h │ │ │ │ ├── gtest-internal.h │ │ │ │ ├── gtest-linked_ptr.h │ │ │ │ ├── gtest-param-util-generated.h │ │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ │ ├── gtest-param-util.h │ │ │ │ ├── gtest-port.h │ │ │ │ ├── gtest-string.h │ │ │ │ ├── gtest-tuple.h │ │ │ │ ├── gtest-tuple.h.pump │ │ │ │ ├── gtest-type-util.h │ │ │ │ └── gtest-type-util.h.pump │ │ │ ├── m4 │ │ │ ├── acx_pthread.m4 │ │ │ ├── gtest.m4 │ │ │ ├── libtool.m4 │ │ │ ├── ltoptions.m4 │ │ │ ├── ltsugar.m4 │ │ │ ├── ltversion.m4 │ │ │ └── lt~obsolete.m4 │ │ │ ├── make │ │ │ └── Makefile │ │ │ ├── msvc │ │ │ ├── gtest-md.sln │ │ │ ├── gtest-md.vcproj │ │ │ ├── gtest.sln │ │ │ ├── gtest.vcproj │ │ │ ├── gtest_main-md.vcproj │ │ │ ├── gtest_main.vcproj │ │ │ ├── gtest_prod_test-md.vcproj │ │ │ ├── gtest_prod_test.vcproj │ │ │ ├── gtest_unittest-md.vcproj │ │ │ └── gtest_unittest.vcproj │ │ │ ├── samples │ │ │ ├── prime_tables.h │ │ │ ├── sample1.cc │ │ │ ├── sample1.h │ │ │ ├── sample10_unittest.cc │ │ │ ├── sample1_unittest.cc │ │ │ ├── sample2.cc │ │ │ ├── sample2.h │ │ │ ├── sample2_unittest.cc │ │ │ ├── sample3-inl.h │ │ │ ├── sample3_unittest.cc │ │ │ ├── sample4.cc │ │ │ ├── sample4.h │ │ │ ├── sample4_unittest.cc │ │ │ ├── sample5_unittest.cc │ │ │ ├── sample6_unittest.cc │ │ │ ├── sample7_unittest.cc │ │ │ ├── sample8_unittest.cc │ │ │ └── sample9_unittest.cc │ │ │ ├── scripts │ │ │ ├── fuse_gtest_files.py │ │ │ ├── gen_gtest_pred_impl.py │ │ │ ├── gtest-config.in │ │ │ ├── pump.py │ │ │ └── test │ │ │ │ └── Makefile │ │ │ ├── src │ │ │ ├── gtest-all.cc │ │ │ ├── gtest-death-test.cc │ │ │ ├── gtest-filepath.cc │ │ │ ├── gtest-internal-inl.h │ │ │ ├── gtest-port.cc │ │ │ ├── gtest-printers.cc │ │ │ ├── gtest-test-part.cc │ │ │ ├── gtest-typed-test.cc │ │ │ ├── gtest.cc │ │ │ └── gtest_main.cc │ │ │ ├── test │ │ │ ├── gtest-death-test_ex_test.cc │ │ │ ├── gtest-death-test_test.cc │ │ │ ├── gtest-filepath_test.cc │ │ │ ├── gtest-linked_ptr_test.cc │ │ │ ├── gtest-listener_test.cc │ │ │ ├── gtest-message_test.cc │ │ │ ├── gtest-options_test.cc │ │ │ ├── gtest-param-test2_test.cc │ │ │ ├── gtest-param-test_test.cc │ │ │ ├── gtest-param-test_test.h │ │ │ ├── gtest-port_test.cc │ │ │ ├── gtest-printers_test.cc │ │ │ ├── gtest-test-part_test.cc │ │ │ ├── gtest-tuple_test.cc │ │ │ ├── gtest-typed-test2_test.cc │ │ │ ├── gtest-typed-test_test.cc │ │ │ ├── gtest-typed-test_test.h │ │ │ ├── gtest-unittest-api_test.cc │ │ │ ├── gtest_all_test.cc │ │ │ ├── gtest_break_on_failure_unittest.py │ │ │ ├── gtest_break_on_failure_unittest_.cc │ │ │ ├── gtest_catch_exceptions_test.py │ │ │ ├── gtest_catch_exceptions_test_.cc │ │ │ ├── gtest_color_test.py │ │ │ ├── gtest_color_test_.cc │ │ │ ├── gtest_env_var_test.py │ │ │ ├── gtest_env_var_test_.cc │ │ │ ├── gtest_environment_test.cc │ │ │ ├── gtest_filter_unittest.py │ │ │ ├── gtest_filter_unittest_.cc │ │ │ ├── gtest_help_test.py │ │ │ ├── gtest_help_test_.cc │ │ │ ├── gtest_list_tests_unittest.py │ │ │ ├── gtest_list_tests_unittest_.cc │ │ │ ├── gtest_main_unittest.cc │ │ │ ├── gtest_no_test_unittest.cc │ │ │ ├── gtest_output_test.py │ │ │ ├── gtest_output_test_.cc │ │ │ ├── gtest_output_test_golden_lin.txt │ │ │ ├── gtest_pred_impl_unittest.cc │ │ │ ├── gtest_premature_exit_test.cc │ │ │ ├── gtest_prod_test.cc │ │ │ ├── gtest_repeat_test.cc │ │ │ ├── gtest_shuffle_test.py │ │ │ ├── gtest_shuffle_test_.cc │ │ │ ├── gtest_sole_header_test.cc │ │ │ ├── gtest_stress_test.cc │ │ │ ├── gtest_test_utils.py │ │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ │ ├── gtest_throw_on_failure_test.py │ │ │ ├── gtest_throw_on_failure_test_.cc │ │ │ ├── gtest_uninitialized_test.py │ │ │ ├── gtest_uninitialized_test_.cc │ │ │ ├── gtest_unittest.cc │ │ │ ├── gtest_xml_outfile1_test_.cc │ │ │ ├── gtest_xml_outfile2_test_.cc │ │ │ ├── gtest_xml_outfiles_test.py │ │ │ ├── gtest_xml_output_unittest.py │ │ │ ├── gtest_xml_output_unittest_.cc │ │ │ ├── gtest_xml_test_utils.py │ │ │ ├── production.cc │ │ │ └── production.h │ │ │ └── xcode │ │ │ ├── Config │ │ │ ├── DebugProject.xcconfig │ │ │ ├── FrameworkTarget.xcconfig │ │ │ ├── General.xcconfig │ │ │ ├── ReleaseProject.xcconfig │ │ │ ├── StaticLibraryTarget.xcconfig │ │ │ └── TestTarget.xcconfig │ │ │ ├── Resources │ │ │ └── Info.plist │ │ │ ├── Samples │ │ │ └── FrameworkSample │ │ │ │ ├── Info.plist │ │ │ │ ├── WidgetFramework.xcodeproj │ │ │ │ └── project.pbxproj │ │ │ │ ├── runtests.sh │ │ │ │ ├── widget.cc │ │ │ │ ├── widget.h │ │ │ │ └── widget_test.cc │ │ │ ├── Scripts │ │ │ ├── runtests.sh │ │ │ └── versiongenerate.py │ │ │ └── gtest.xcodeproj │ │ │ └── project.pbxproj │ ├── BH1750 │ │ ├── BH1750.cpp │ │ ├── BH1750.h │ │ ├── README.md │ │ ├── examples │ │ │ └── BH1750test │ │ │ │ └── BH1750test.pde │ │ ├── keywords.txt │ │ └── library.json │ ├── DHT-sensor │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE.md │ │ │ └── PULL_REQUEST_TEMPLATE.md │ │ ├── DHT.cpp │ │ ├── DHT.h │ │ ├── README.md │ │ ├── examples │ │ │ ├── DHT_Unified_Sensor │ │ │ │ └── DHT_Unified_Sensor.ino │ │ │ └── DHTtester │ │ │ │ └── DHTtester.ino │ │ ├── keywords.txt │ │ └── library.properties │ ├── HTU21D │ │ ├── HTU21D.cpp │ │ ├── HTU21D.h │ │ ├── README.md │ │ ├── examples │ │ │ ├── HTU21D_Demo │ │ │ │ └── HTU21D_Demo.ino │ │ │ ├── HTU21D_Humidex │ │ │ │ └── HTU21D_Humidex.ino │ │ │ └── Si7021_Demo │ │ │ │ └── Si7021_Demo.ino │ │ └── keywords.txt │ ├── NTPClient │ │ ├── .travis.yml │ │ ├── CHANGELOG │ │ ├── NTPClient.cpp │ │ ├── NTPClient.h │ │ ├── README.md │ │ ├── examples │ │ │ ├── Advanced │ │ │ │ └── Advanced.ino │ │ │ └── Basic │ │ │ │ └── Basic.ino │ │ ├── keywords.txt │ │ ├── library.json │ │ └── library.properties │ ├── OneWire │ │ ├── OneWire.cpp │ │ ├── OneWire.h │ │ ├── examples │ │ │ ├── DS18x20_Temperature │ │ │ │ └── DS18x20_Temperature.pde │ │ │ ├── DS2408_Switch │ │ │ │ └── DS2408_Switch.pde │ │ │ └── DS250x_PROM │ │ │ │ └── DS250x_PROM.pde │ │ ├── keywords.txt │ │ ├── library.json │ │ └── library.properties │ ├── PZEM004T │ │ ├── .gitignore │ │ ├── PZEM004T.cpp │ │ ├── PZEM004T.h │ │ ├── README.md │ │ ├── examples │ │ │ ├── PZEMDisplay │ │ │ │ └── PZEMDisplay.ino │ │ │ └── PZEMHardSerial │ │ │ │ └── PZEMHardSerial.ino │ │ ├── keywords.txt │ │ └── library.properties │ ├── SimpleTimer │ │ ├── README.md │ │ ├── SimpleTimer.cpp │ │ └── SimpleTimer.h │ └── SparkFun_BME280 │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── examples │ │ ├── CSV_Output │ │ │ └── CSV_Output.ino │ │ ├── I2C_DeltaAltitude │ │ │ ├── CircularBuffer.cpp │ │ │ ├── CircularBuffer.h │ │ │ └── I2C_DeltaAltitude.ino │ │ ├── I2C_ReadAllData │ │ │ └── I2C_ReadAllData.ino │ │ ├── I2C_and_SPI_Multisensor │ │ │ └── I2C_and_SPI_Multisensor.ino │ │ └── SketchesWithLCD │ │ │ ├── LCD_DeltaAltitude │ │ │ ├── CircularBuffer.cpp │ │ │ ├── CircularBuffer.h │ │ │ └── LCD_DeltaAltitude.ino │ │ │ └── LCD_PressureTemperature │ │ │ └── LCD_PressureTemperature.ino │ │ ├── keywords.txt │ │ ├── library.properties │ │ ├── readme_picture.jpg │ │ └── src │ │ ├── SparkFunBME280.cpp │ │ └── SparkFunBME280.h ├── support.ino ├── user_config.h └── web.ino └── screenshots ├── Apins.png ├── HC-SR501.jpg ├── MP1584EN.jpg ├── OpenHab.png ├── OpenHab_ext.png ├── OpenHab_graph.png ├── PCB_bottom.png ├── PCB_top.png ├── PZEM ├── CuteCom.png ├── OpenHab_energy.png ├── OpenHab_home.png ├── pzem_status.png └── test_sample.jpg ├── Schema_LED.png ├── Schema_SSR.png ├── arduino-ide.png ├── board1.jpg ├── board2.jpg ├── board3.jpg ├── syslog.png ├── thumbs ├── PCB_bottom_th.png ├── PCB_top_th.png └── arduino-ide.png └── web ├── console.png ├── control.png ├── esp.png ├── logConf.png ├── menu.png ├── mqtt.png ├── ntp.png ├── sensors.png ├── status.png ├── statusDS.png ├── update.png └── wifi.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.bin 2 | -------------------------------------------------------------------------------- /Gerber/esp.dri: -------------------------------------------------------------------------------- 1 | Generated by EAGLE CAM Processor 7.5.0 2 | 3 | Drill Station Info File: C:/Users/User/Dropbox/Eagle/ESP-LED-Switch/esp.dri 4 | 5 | Date : 09.01.2016 18:01 6 | Drills : generated 7 | Device : Excellon drill station, coordinate format 2.5 inch 8 | 9 | Parameter settings: 10 | 11 | Tolerance Drill + : 0.00 % 12 | Tolerance Drill - : 0.00 % 13 | Rotate : no 14 | Mirror : no 15 | Optimize : yes 16 | Auto fit : yes 17 | OffsetX : 0inch 18 | OffsetY : 0inch 19 | Layers : Drills Holes 20 | 21 | Drill File Info: 22 | 23 | Data Mode : Absolute 24 | Units : 1/100000 Inch 25 | 26 | Drills used: 27 | 28 | Code Size used 29 | 30 | T01 0.0276inch 10 31 | T02 0.0315inch 44 32 | T03 0.0394inch 8 33 | T04 0.0400inch 72 34 | T05 0.0472inch 12 35 | 36 | Total number of drills: 146 37 | 38 | Plotfiles: 39 | 40 | C:/Users/User/Dropbox/Eagle/ESP-LED-Switch/esp.txt 41 | -------------------------------------------------------------------------------- /Gerber/esp.gko: -------------------------------------------------------------------------------- 1 | G75* 2 | %MOIN*% 3 | %OFA0B0*% 4 | %FSLAX25Y25*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10C,0.00000*% 11 | %ADD11C,0.01600*% 12 | D10* 13 | X0020400Y0046900D02* 14 | X0380200Y0046700D01* 15 | D11* 16 | X0019600Y0046500D02* 17 | X0019600Y0361500D01* 18 | X0380200Y0361500D01* 19 | X0380200Y0046700D01* 20 | X0019600Y0046500D01* 21 | X0019800Y0205100D02* 22 | X0054400Y0205100D01* 23 | X0063500Y0205200D02* 24 | X0190100Y0205200D01* 25 | X0199300Y0205100D02* 26 | X0264200Y0205100D01* 27 | X0272800Y0205100D02* 28 | X0343000Y0205100D01* 29 | X0351100Y0205100D02* 30 | X0380000Y0205100D01* 31 | X0233700Y0228600D02* 32 | X0233700Y0180500D01* 33 | X0233700Y0173400D02* 34 | X0233700Y0082600D01* 35 | X0233700Y0075600D02* 36 | X0233700Y0047400D01* 37 | X0233600Y0046700D01* 38 | X0233700Y0235700D02* 39 | X0233700Y0330300D01* 40 | X0233700Y0337100D02* 41 | X0233700Y0361400D01* 42 | M02* 43 | -------------------------------------------------------------------------------- /Gerber/esp.gpi: -------------------------------------------------------------------------------- 1 | Generated by EAGLE CAM Processor 7.5.0 2 | 3 | Photoplotter Info File: C:/Users/User/Dropbox/Eagle/ESP-LED-Switch/esp.gpi 4 | 5 | Date : 09.01.2016 18:01 6 | Plotfile : C:/Users/User/Dropbox/Eagle/ESP-LED-Switch/esp.gbs 7 | Apertures : generated: 8 | Device : Gerber RS-274-X photoplotter, coordinate format 2.5 inch 9 | 10 | Parameter settings: 11 | 12 | Emulate Apertures : no 13 | Tolerance Draw + : 0.00 % 14 | Tolerance Draw - : 0.00 % 15 | Tolerance Flash + : 0.00 % 16 | Tolerance Flash - : 0.00 % 17 | Rotate : no 18 | Mirror : no 19 | Optimize : yes 20 | Auto fit : yes 21 | OffsetX : 0inch 22 | OffsetY : 0inch 23 | 24 | Plotfile Info: 25 | 26 | Coordinate Format : 2.5 27 | Coordinate Units : Inch 28 | Data Mode : Absolute 29 | Zero Suppression : None 30 | End Of Block : * 31 | 32 | Apertures used: 33 | 34 | Code Shape Size used 35 | 36 | D10 round 0.0800inch 10 37 | D11 round 0.0740inch 24 38 | D12 draw 0.0640inch 72 39 | D13 square 0.0900inch 6 40 | D14 draw 0.0900inch 6 41 | D15 rectangle 0.0750inch x 0.0670inch 26 42 | D16 rectangle 0.0670inch x 0.0750inch 8 43 | D17 round 0.0634inch 8 44 | D18 round 0.0540inch 20 45 | 46 | -------------------------------------------------------------------------------- /OpenHab/PZEM/configurations/items/default.items: -------------------------------------------------------------------------------- 1 | Group All 2 | Group gPersistPzem (ALL) 3 | 4 | 5 | Number pzemVoltage_PzemFull "Voltage [%.0f V]" (gPersistPzem) 6 | Number pzemVoltage_PzemFull_Chart_Period "Период графика" 7 | 8 | Number pzemCurrent_PzemFull "Current [%.2f A]" (gPersistPzem) 9 | Number pzemCurrent_PzemFull_Chart_Period "Период графика" 10 | 11 | Number pzemPower_PzemFull "Power [%.2f kW]" (gPersistPzem) 12 | Number pzemPower_PzemFull_Chart_Period "Период графика" 13 | 14 | Number pzemEnergy_PzemFull "Energy [%.0f kWh]" 15 | 16 | Switch pzemReset_PzemFull "Reset Energy " -------------------------------------------------------------------------------- /OpenHab/PZEM/configurations/persistence/rrd4j.persist: -------------------------------------------------------------------------------- 1 | // persistence strategies have a name and a definition and are referred to in the "Items" section 2 | Strategies { 3 | // for rrd charts, we need a cron strategy 4 | everyDay : "0 0 0 * * ?" 5 | everyHour : "0 0 * * * ?" 6 | everyMinute : "0 * * * * ?" 7 | every5Minutes : "0 */5 * * * ?" 8 | } 9 | 10 | Items { 11 | gPersistPzem* : strategy = everyChange, restoreOnStartup 12 | } 13 | -------------------------------------------------------------------------------- /OpenHab/PZEM/configurations/rules/default.rules: -------------------------------------------------------------------------------- 1 | import org.openhab.core.library.types.* 2 | import org.openhab.core.persistence.* 3 | import org.openhab.model.script.actions.* 4 | import org.openhab.core.library.items.* 5 | 6 | var Timer pzemReset = null 7 | 8 | rule "Records last pzemVoltage_PzemFull update time" 9 | when 10 | Item pzemVoltage_PzemFull received update 11 | then 12 | postUpdate(pzemVoltage_PzemFull_LastUpdate, new DateTimeType()) 13 | end 14 | 15 | 16 | rule "pzemReset_PzemFull switch Off" 17 | when 18 | Item pzemReset_PzemFull received update 19 | then 20 | if (pzemReset_PzemFull.state == ON) { 21 | pzemReset = createTimer(now.plusSeconds(10)) [| 22 | sendCommand(pzemReset_PzemFull, OFF) 23 | ] 24 | } 25 | end -------------------------------------------------------------------------------- /OpenHab/PZEM/icons/current.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/OpenHab/PZEM/icons/current.png -------------------------------------------------------------------------------- /OpenHab/PZEM/icons/energy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/OpenHab/PZEM/icons/energy.png -------------------------------------------------------------------------------- /OpenHab/PZEM/icons/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/OpenHab/PZEM/icons/power.png -------------------------------------------------------------------------------- /OpenHab/PZEM/icons/voltage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/OpenHab/PZEM/icons/voltage.png -------------------------------------------------------------------------------- /OpenHab/configurations/items/room.items: -------------------------------------------------------------------------------- 1 | Group All 2 | Group gPersistMotionSensor (ALL) 3 | Group gPersistTemp (All) 4 | Group gPersistHumidity (All) 5 | Group gPersistLux (All) 6 | Group gPersistPressure (All) 7 | 8 | Number Temp_BedM "Температура [%.2f °C]" (gPersistTemp) 9 | Number Temp_BedM_Chart_Period "Период графика" 10 | 11 | Number Humidity_BedM "Влажность [%.2f %%]" (gPersistHumidity) 12 | Number Humidity_BedM_Chart_Period "Период графика" 13 | 14 | Number Lux_BedM "Освещенность [%d lux]" (gPersistLux) 15 | Number Lux_BedM_Chart_Period "Период графика" 16 | 17 | Number Pressure_BedM "Давление [%.2f mm]" (gPersistPressure) 18 | Number Pressure_BedM_Chart_Period "Период графика" 19 | 20 | Number LightType_BedM 21 | Number LightType2_BedM 22 | Number MotionSensorTimer_BedM 23 | Number MotionSensorTimer2_BedM 24 | 25 | Switch BedM_Settings "Info" 26 | DateTime Temp_BedM_LastUpdate "Temp Last Update [%1$ta %1$tR]" 27 | DateTime Humidity_BedM_LastUpdate "Humidity Last Update [%1$ta %1$tR]" 28 | DateTime Lux_BedM_LastUpdate "Lux Last Update [%1$ta %1$tR]" 29 | DateTime Pressure_BedM_LastUpdate "Pressure Last Update [%1$ta %1$tR]" 30 | DateTime Altitude_BedM_LastUpdate "Altitude Last Update [%1$ta %1$tR]" 31 | Number Version_BedM "Version [%.2f]" 32 | String IP_BedM "IP [%s]" 33 | String MAC_BedM "MAC [%s]" 34 | String Uptime_BedM "Uptime [%s]" 35 | Number FreeMemory_BedM "Free Memory [%d]" -------------------------------------------------------------------------------- /OpenHab/configurations/persistence/rrd4j.persist: -------------------------------------------------------------------------------- 1 | // persistence strategies have a name and a definition and are referred to in the "Items" section 2 | Strategies { 3 | // for rrd charts, we need a cron strategy 4 | everyDay : "0 0 0 * * ?" 5 | everyHour : "0 0 * * * ?" 6 | everyMinute : "0 * * * * ?" 7 | every5Minutes : "0 */5 * * * ?" 8 | } 9 | 10 | Items { 11 | gPersistMotionSensor* : strategy = everyChange, everyUpdate, everyMinute 12 | 13 | // let's only store temperature values in rrd 14 | gPersistTemp*,gPersistHumidity*,gPersistLux*,gPersistPressure* : strategy = everyMinute, restoreOnStartup 15 | } 16 | -------------------------------------------------------------------------------- /OpenHab/configurations/rules/room.rules: -------------------------------------------------------------------------------- 1 | import org.openhab.core.library.types.* 2 | import org.openhab.core.persistence.* 3 | import org.openhab.model.script.actions.* 4 | import org.openhab.core.library.items.* 5 | 6 | 7 | rule "Init Items" 8 | when 9 | System started 10 | then 11 | if (MotionSensorTimer_BedM.state == Uninitialized) { 12 | sendCommand(MotionSensorTimer_BedM, 5) 13 | postUpdate(MotionSensorTimer_BedM, 5) 14 | } 15 | if (MotionSensorTimer2_BedM.state == Uninitialized) { 16 | sendCommand(MotionSensorTimer2_BedM, 5) 17 | postUpdate(MotionSensorTimer2_BedM, 5) 18 | } 19 | if (LightType_BedM.state == Uninitialized) { 20 | sendCommand(LightType_BedM, 2) 21 | postUpdate(LightType_BedM, 2) 22 | } 23 | if (LightType2_BedM.state == Uninitialized) { 24 | sendCommand(LightType2_BedM, 2) 25 | postUpdate(LightType2_BedM, 2) 26 | } 27 | if (Version_BedM.state == Uninitialized) { 28 | sendCommand(Version_BedM, 0) 29 | postUpdate(Version_BedM, 0) 30 | } 31 | if (IP_BedM.state == Uninitialized) { 32 | sendCommand(IP_BedM, "0.0.0.0") 33 | postUpdate(IP_BedM, "0.0.0.0") 34 | } 35 | if (MAC_BedM.state == Uninitialized) { 36 | sendCommand(MAC_BedM, "ff:ff:ff:ff:ff:ff") 37 | postUpdate(MAC_BedM, "ff:ff:ff:ff:ff:ff") 38 | } 39 | end 40 | 41 | 42 | rule "Records last Temp_BedM update time" 43 | when 44 | Item Temp_BedM received update 45 | then 46 | postUpdate(Temp_BedM_LastUpdate, new DateTimeType()) 47 | end 48 | 49 | 50 | rule "Records last Humidity_BedM update time" 51 | when 52 | Item Humidity_BedM received update 53 | then 54 | postUpdate(Humidity_BedM_LastUpdate, new DateTimeType()) 55 | end 56 | 57 | 58 | rule "Records last Lux_BedM update time" 59 | when 60 | Item Lux_BedM received update 61 | then 62 | postUpdate(Lux_BedM_LastUpdate, new DateTimeType()) 63 | end 64 | 65 | rule "Records last Pressure_BedM update time" 66 | when 67 | Item Pressure_BedM received update 68 | then 69 | postUpdate(Pressure_BedM_LastUpdate, new DateTimeType()) 70 | end 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Wi-Fi Sensor 2 | 3 | Датчик температуры, влажности, давления, движения и освещенности на ESP-12F 4 | 5 | Для управления нагрузкой есть два варианта платы. Первый вариант для низковольтной нагрузки, в моем случае это светодиодные ленты. Второй вариант для высоковольтной нагрузки (220 вольт), используемое твёрдотельное реле выдерживает ток до 8 ампер. 6 | 7 | ![Board1](/screenshots/board1.jpg) 8 | 9 | ![Board2](/screenshots/board2.jpg) 10 | 11 | ![Board3](/screenshots/board3.jpg) 12 | 13 | 14 | Все датчики и Wi-Fi модуль работают от питания 3,3V. 15 | 16 | Плату заказывал по инструкции автора Vipeg [Ссылка](http://mysku.ru/blog/others/36157.html) , за что ему отдельное спасибо. 17 | 18 | #### Дополнительная инфорамация на [Wiki](https://github.com/kmaximv/Wi-Fi-Sensor/wiki) 19 | 20 | 21 | -------------------------------------------------------------------------------- /esp_sensor/data/bootstrap.min.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/data/bootstrap.min.css.gz -------------------------------------------------------------------------------- /esp_sensor/data/bootstrap.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/data/bootstrap.min.js.gz -------------------------------------------------------------------------------- /esp_sensor/data/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/data/favicon.ico -------------------------------------------------------------------------------- /esp_sensor/data/glyphicons.ttf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/data/glyphicons.ttf.gz -------------------------------------------------------------------------------- /esp_sensor/data/glyphicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/data/glyphicons.woff -------------------------------------------------------------------------------- /esp_sensor/data/glyphicons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/data/glyphicons.woff2 -------------------------------------------------------------------------------- /esp_sensor/data/jquery.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/data/jquery.min.js.gz -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.bts* 3 | -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | sudo: false 3 | before_install: 4 | - source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh) 5 | install: 6 | - arduino --install-library "Adafruit SleepyDog Library,Adafruit FONA Library,Adafruit CC3000 Library,Adafruit_WINC1500" 7 | script: 8 | - build_main_platforms 9 | notifications: 10 | email: 11 | on_success: change 12 | on_failure: change 13 | -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.due.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.due.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.leonardo.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.leonardo.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.uno.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.uno.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.zero.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_2subs_esp8266/.zero.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.due.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.due.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.leonardo.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.leonardo.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.uno.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.uno.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.zero.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/.zero.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/python_subscriber/mqtt_figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/python_subscriber/mqtt_figure.png -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_arbitrary_data/python_subscriber/requirements.txt: -------------------------------------------------------------------------------- 1 | paho-mqtt>=1.1 2 | -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.due.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.due.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.esp8266.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.esp8266.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.leonardo.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.leonardo.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.uno.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.uno.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.zero.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_cc3k/.zero.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.due.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.due.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.leonardo.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.leonardo.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.uno.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.uno.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.zero.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_esp8266/.zero.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_ethernet/.due.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_ethernet/.due.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_ethernet/.esp8266.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_ethernet/.esp8266.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_fona/.due.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_fona/.due.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_fona/.esp8266.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_fona/.esp8266.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_fona/fonahelper.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Adafruit_FONA.h" 4 | 5 | #define halt(s) { Serial.println(F( s )); while(1); } 6 | 7 | extern Adafruit_FONA fona; 8 | extern SoftwareSerial fonaSS; 9 | 10 | boolean FONAconnect(const __FlashStringHelper *apn, const __FlashStringHelper *username, const __FlashStringHelper *password) { 11 | Watchdog.reset(); 12 | 13 | Serial.println(F("Initializing FONA....(May take 3 seconds)")); 14 | 15 | fonaSS.begin(4800); // if you're using software serial 16 | 17 | if (! fona.begin(fonaSS)) { // can also try fona.begin(Serial1) 18 | Serial.println(F("Couldn't find FONA")); 19 | return false; 20 | } 21 | fonaSS.println("AT+CMEE=2"); 22 | Serial.println(F("FONA is OK")); 23 | Watchdog.reset(); 24 | Serial.println(F("Checking for network...")); 25 | while (fona.getNetworkStatus() != 1) { 26 | delay(500); 27 | } 28 | 29 | Watchdog.reset(); 30 | delay(5000); // wait a few seconds to stabilize connection 31 | Watchdog.reset(); 32 | 33 | fona.setGPRSNetworkSettings(apn, username, password); 34 | 35 | Serial.println(F("Disabling GPRS")); 36 | fona.enableGPRS(false); 37 | 38 | Watchdog.reset(); 39 | delay(5000); // wait a few seconds to stabilize connection 40 | Watchdog.reset(); 41 | 42 | Serial.println(F("Enabling GPRS")); 43 | if (!fona.enableGPRS(true)) { 44 | Serial.println(F("Failed to turn GPRS on")); 45 | return false; 46 | } 47 | Watchdog.reset(); 48 | 49 | return true; 50 | } 51 | -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.due.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.due.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.leonardo.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.leonardo.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.uno.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.uno.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.zero.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/Adafruit_MQTT/examples/mqtt_yun/.zero.test.skip -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/keywords.txt: -------------------------------------------------------------------------------- 1 | Adafruit_MQTT KEYWORD1 2 | Adafruit_MQTT_CC3000 KEYWORD1 3 | Adafruit_MQTT_FONA KEYWORD1 4 | Adafruit_MQTT_Client KEYWORD1 5 | Adafruit_MQTT_Publish KEYWORD1 6 | Adafruit_MQTT_Subscribe KEYWORD1 7 | connect KEYWORD2 8 | connectErrorString KEYWORD2 9 | disconnect KEYWORD2 10 | connected KEYWORD2 11 | will KEYWORD2 12 | publish KEYWORD2 13 | subscribe KEYWORD2 14 | unsubscribe KEYWORD2 15 | readSubscription KEYWORD2 16 | ping KEYWORD2 17 | setCallback KEYWORD2 18 | connectServer KEYWORD2 19 | disconnectServer KEYWORD2 20 | readPacket KEYWORD2 21 | sendPacket KEYWORD2 22 | -------------------------------------------------------------------------------- /esp_sensor/libraries/Adafruit_MQTT/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit MQTT Library 2 | version=0.16.1 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=MQTT library that supports the CC3000, FONA, ESP8266, Yun, and generic Arduino Client hardware. 6 | paragraph=Simple MQTT library that supports the bare minimum to publish and subscribe to topics. 7 | category=Communication 8 | url=https://github.com/adafruit/Adafruit_MQTT_Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | --------------------- 3 | 4 | Copyright © 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 5.7.0.{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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/examples/IndentedPrintExample/IndentedPrintExample.ino: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/examples/JsonServer/JsonServer.ino: -------------------------------------------------------------------------------- 1 | // Sample Arduino Json Web Server 2 | // Created by Benoit Blanchon. 3 | // Heavily inspired by "Web Server" from David A. Mellis and Tom Igoe 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; 10 | IPAddress ip(192, 168, 0, 177); 11 | EthernetServer server(80); 12 | 13 | bool readRequest(EthernetClient& client) { 14 | bool currentLineIsBlank = true; 15 | while (client.connected()) { 16 | if (client.available()) { 17 | char c = client.read(); 18 | if (c == '\n' && currentLineIsBlank) { 19 | return true; 20 | } else if (c == '\n') { 21 | currentLineIsBlank = true; 22 | } else if (c != '\r') { 23 | currentLineIsBlank = false; 24 | } 25 | } 26 | } 27 | return false; 28 | } 29 | 30 | JsonObject& prepareResponse(JsonBuffer& jsonBuffer) { 31 | JsonObject& root = jsonBuffer.createObject(); 32 | 33 | JsonArray& analogValues = root.createNestedArray("analog"); 34 | for (int pin = 0; pin < 6; pin++) { 35 | int value = analogRead(pin); 36 | analogValues.add(value); 37 | } 38 | 39 | JsonArray& digitalValues = root.createNestedArray("digital"); 40 | for (int pin = 0; pin < 14; pin++) { 41 | int value = digitalRead(pin); 42 | digitalValues.add(value); 43 | } 44 | 45 | return root; 46 | } 47 | 48 | void writeResponse(EthernetClient& client, JsonObject& json) { 49 | client.println("HTTP/1.1 200 OK"); 50 | client.println("Content-Type: application/json"); 51 | client.println("Connection: close"); 52 | client.println(); 53 | 54 | json.prettyPrintTo(client); 55 | } 56 | 57 | void setup() { 58 | Ethernet.begin(mac, ip); 59 | server.begin(); 60 | } 61 | 62 | void loop() { 63 | EthernetClient client = server.available(); 64 | if (client) { 65 | bool success = readRequest(client); 66 | if (success) { 67 | StaticJsonBuffer<500> jsonBuffer; 68 | JsonObject& json = prepareResponse(jsonBuffer); 69 | writeResponse(client, json); 70 | } 71 | delay(1); 72 | client.stop(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/examples/StringExample/StringExample.ino: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | // About 11 | // ----- 12 | // This example shows the different ways you can use String with ArduinoJson. 13 | // Please don't see this as an invitation to use String. 14 | // On the contrary, you should always use char[] when possible, it's much more 15 | // efficient in term of code size, speed and memory usage. 16 | 17 | void setup() { 18 | DynamicJsonBuffer jsonBuffer; 19 | 20 | // You can use a String as your JSON input. 21 | // WARNING: the content of the String will be duplicated in the JsonBuffer. 22 | String input = 23 | "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; 24 | JsonObject& root = jsonBuffer.parseObject(input); 25 | 26 | // You can use a String to get an element of a JsonObject 27 | // No duplication is done. 28 | long time = root[String("time")]; 29 | 30 | // You can use a String to set an element of a JsonObject 31 | // WARNING: the content of the String will be duplicated in the JsonBuffer. 32 | root[String("time")] = time; 33 | 34 | // You can get a String from a JsonObject or JsonArray: 35 | // No duplication is done, at least not in the JsonBuffer. 36 | String sensor = root[String("sensor")]; 37 | 38 | // You can set a String to a JsonObject or JsonArray: 39 | // WARNING: the content of the String will be duplicated in the JsonBuffer. 40 | root["sensor"] = sensor; 41 | 42 | // You can also concatenate strings 43 | // WARNING: the content of the String will be duplicated in the JsonBuffer. 44 | root[String("sen") + "sor"] = String("gp") + "s"; 45 | 46 | // Lastly, you can print the resulting JSON to a String 47 | String output; 48 | root.printTo(output); 49 | } 50 | 51 | void loop() { 52 | // not used in this example 53 | } 54 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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/StaticJsonBuffer.hpp" 14 | 15 | #include "ArduinoJson/Internals/JsonParser.ipp" 16 | #include "ArduinoJson/Internals/JsonSerializer.ipp" 17 | #include "ArduinoJson/JsonArray.ipp" 18 | #include "ArduinoJson/JsonBuffer.ipp" 19 | #include "ArduinoJson/JsonObject.ipp" 20 | #include "ArduinoJson/JsonVariant.ipp" 21 | 22 | using namespace ArduinoJson; 23 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/DynamicJsonBuffer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 "Internals/BlockJsonBuffer.hpp" 11 | 12 | namespace ArduinoJson { 13 | // Implements a JsonBuffer with dynamic memory allocation. 14 | // You are strongly encouraged to consider using StaticJsonBuffer which is much 15 | // more suitable for embedded systems. 16 | typedef Internals::BlockJsonBuffer 17 | DynamicJsonBuffer; 18 | } 19 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/Comments.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | inline const char *skipCStyleComment(const char *ptr) { 13 | ptr += 2; 14 | for (;;) { 15 | if (ptr[0] == '\0') return ptr; 16 | if (ptr[0] == '*' && ptr[1] == '/') return ptr + 2; 17 | ptr++; 18 | } 19 | } 20 | 21 | inline const char *skipCppStyleComment(const char *ptr) { 22 | ptr += 2; 23 | for (;;) { 24 | if (ptr[0] == '\0' || ptr[0] == '\n') return ptr; 25 | ptr++; 26 | } 27 | } 28 | 29 | inline const char *skipSpacesAndComments(const char *ptr) { 30 | for (;;) { 31 | switch (ptr[0]) { 32 | case ' ': 33 | case '\t': 34 | case '\r': 35 | case '\n': 36 | ptr++; 37 | continue; 38 | case '/': 39 | switch (ptr[1]) { 40 | case '*': 41 | ptr = skipCStyleComment(ptr); 42 | break; 43 | case '/': 44 | ptr = skipCppStyleComment(ptr); 45 | break; 46 | default: 47 | return ptr; 48 | } 49 | break; 50 | default: 51 | return ptr; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/DummyPrint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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) { return 1; } 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/DynamicStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 "StringFuncs.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 | StringFuncs::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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/Encoding.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/IndentedPrint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | // Decorator on top of Print to allow indented output. 16 | // This class is used by JsonPrintable::prettyPrintTo() but can also be used 17 | // for your own purpose, like logging. 18 | class IndentedPrint : public Print { 19 | public: 20 | explicit IndentedPrint(Print &p) : sink(&p) { 21 | level = 0; 22 | tabSize = 2; 23 | isNewLine = true; 24 | } 25 | 26 | virtual size_t write(uint8_t c) { 27 | size_t n = 0; 28 | if (isNewLine) n += writeTabs(); 29 | n += sink->write(c); 30 | isNewLine = c == '\n'; 31 | return n; 32 | } 33 | 34 | // Adds one level of indentation 35 | void indent() { 36 | if (level < MAX_LEVEL) level++; 37 | } 38 | 39 | // Removes one level of indentation 40 | void unindent() { 41 | if (level > 0) level--; 42 | } 43 | 44 | // Set the number of space printed for each level of indentation 45 | void setTabSize(uint8_t n) { 46 | if (n < MAX_TAB_SIZE) tabSize = n & MAX_TAB_SIZE; 47 | } 48 | 49 | private: 50 | Print *sink; 51 | uint8_t level : 4; 52 | uint8_t tabSize : 3; 53 | bool isNewLine : 1; 54 | 55 | size_t writeTabs() { 56 | size_t n = 0; 57 | for (int i = 0; i < level * tabSize; i++) n += sink->write(' '); 58 | return n; 59 | } 60 | 61 | static const int MAX_LEVEL = 15; // because it's only 4 bits 62 | static const int MAX_TAB_SIZE = 7; // because it's only 3 bits 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonBufferAllocated.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonFloat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonInteger.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonParser.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | // Parse JSON string to create JsonArrays and JsonObjects 17 | // This internal class is not indended to be used directly. 18 | // Instead, use JsonBuffer.parseArray() or .parseObject() 19 | class JsonParser { 20 | public: 21 | JsonParser(JsonBuffer *buffer, char *json, uint8_t nestingLimit) 22 | : _buffer(buffer), 23 | _readPtr(json ? json : ""), 24 | _writePtr(json), 25 | _nestingLimit(nestingLimit) {} 26 | 27 | JsonArray &parseArray(); 28 | JsonObject &parseObject(); 29 | 30 | JsonVariant parseVariant() { 31 | JsonVariant result; 32 | parseAnythingTo(&result); 33 | return result; 34 | } 35 | 36 | private: 37 | bool skip(char charToSkip); 38 | 39 | const char *parseString(); 40 | bool parseAnythingTo(JsonVariant *destination); 41 | FORCE_INLINE bool parseAnythingToUnsafe(JsonVariant *destination); 42 | 43 | inline bool parseArrayTo(JsonVariant *destination); 44 | inline bool parseObjectTo(JsonVariant *destination); 45 | inline bool parseStringTo(JsonVariant *destination); 46 | 47 | static inline bool isInRange(char c, char min, char max) { 48 | return min <= c && c <= max; 49 | } 50 | 51 | static inline bool isLetterOrNumber(char c) { 52 | return isInRange(c, '0', '9') || isInRange(c, 'a', 'z') || 53 | isInRange(c, 'A', 'Z') || c == '+' || c == '-' || c == '.'; 54 | } 55 | 56 | static inline bool isQuote(char c) { 57 | return c == '\'' || c == '\"'; 58 | } 59 | 60 | JsonBuffer *_buffer; 61 | const char *_readPtr; 62 | char *_writePtr; 63 | uint8_t _nestingLimit; 64 | }; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonSerializer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonVariantAs.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonVariantContent.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonVariantDefault.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/JsonVariantType.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/ListConstIterator.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 { return _node->content; } 22 | const T *operator->() { return &_node->content; } 23 | 24 | bool operator==(const ListConstIterator &other) const { 25 | return _node == other._node; 26 | } 27 | 28 | bool operator!=(const ListConstIterator &other) const { 29 | return _node != other._node; 30 | } 31 | 32 | ListConstIterator &operator++() { 33 | if (_node) _node = _node->next; 34 | return *this; 35 | } 36 | 37 | private: 38 | const ListNode *_node; 39 | }; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/ListIterator.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | #include "ListConstIterator.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 { return _node->content; } 23 | T *operator->() { return &_node->content; } 24 | 25 | bool operator==(const ListIterator &other) const { 26 | return _node == other._node; 27 | } 28 | 29 | bool operator!=(const ListIterator &other) const { 30 | return _node != other._node; 31 | } 32 | 33 | ListIterator &operator++() { 34 | if (_node) _node = _node->next; 35 | return *this; 36 | } 37 | 38 | operator ListConstIterator() const { return ListConstIterator(_node); } 39 | 40 | private: 41 | ListNode *_node; 42 | }; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/ListNode.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/Parse.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/ReferenceType.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 { return this != &other; } 23 | 24 | protected: 25 | ReferenceType() {} 26 | 27 | private: 28 | // copy constructor is private 29 | ReferenceType(const ReferenceType&); 30 | 31 | // copy operator is private 32 | ReferenceType& operator=(const ReferenceType&); 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/StaticStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/StreamPrintAdapter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Internals/ValueSetter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 "../TypeTraits/EnableIf.hpp" 13 | #include "StringFuncs.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 | } 42 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/JsonArray.ipp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 JsonVariant::JsonVariant(const JsonArray &array) { 17 | if (array.success()) { 18 | _type = Internals::JSON_ARRAY; 19 | _content.asArray = const_cast(&array); 20 | } else { 21 | _type = Internals::JSON_UNDEFINED; 22 | } 23 | } 24 | 25 | inline JsonVariant::JsonVariant(const JsonObject &object) { 26 | if (object.success()) { 27 | _type = Internals::JSON_OBJECT; 28 | _content.asObject = const_cast(&object); 29 | } else { 30 | _type = Internals::JSON_UNDEFINED; 31 | } 32 | } 33 | 34 | namespace Internals { 35 | template <> 36 | struct JsonVariantDefault { 37 | static JsonArray &get() { 38 | return JsonArray::invalid(); 39 | } 40 | }; 41 | } 42 | 43 | inline JsonArray &JsonVariant::asArray() const { 44 | if (_type == Internals::JSON_ARRAY) return *_content.asArray; 45 | return JsonArray::invalid(); 46 | } 47 | 48 | inline JsonArray &JsonArray::createNestedArray() { 49 | if (!_buffer) return JsonArray::invalid(); 50 | JsonArray &array = _buffer->createArray(); 51 | add(array); 52 | return array; 53 | } 54 | 55 | template 56 | inline JsonArray &JsonObject::createNestedArray(const TString &key) { 57 | if (!_buffer) return JsonArray::invalid(); 58 | JsonArray &array = _buffer->createArray(); 59 | set(key, array); 60 | return array; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/JsonBuffer.ipp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 "Internals/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 | 22 | inline ArduinoJson::JsonArray &ArduinoJson::JsonBuffer::parseArray( 23 | char *json, uint8_t nestingLimit) { 24 | Internals::JsonParser parser(this, json, nestingLimit); 25 | return parser.parseArray(); 26 | } 27 | 28 | inline ArduinoJson::JsonObject &ArduinoJson::JsonBuffer::parseObject( 29 | char *json, uint8_t nestingLimit) { 30 | Internals::JsonParser parser(this, json, nestingLimit); 31 | return parser.parseObject(); 32 | } 33 | 34 | inline ArduinoJson::JsonVariant ArduinoJson::JsonBuffer::parse( 35 | char *json, uint8_t nestingLimit) { 36 | Internals::JsonParser parser(this, json, nestingLimit); 37 | return parser.parseVariant(); 38 | } 39 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/JsonObject.ipp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | namespace Internals { 17 | template <> 18 | struct JsonVariantDefault { 19 | static JsonObject &get() { 20 | return JsonObject::invalid(); 21 | } 22 | }; 23 | } 24 | 25 | inline JsonObject &JsonVariant::asObject() const { 26 | if (_type == Internals::JSON_OBJECT) return *_content.asObject; 27 | return JsonObject::invalid(); 28 | } 29 | 30 | template 31 | inline JsonObject &JsonObject::createNestedObject(const TString &key) { 32 | if (!_buffer) return JsonObject::invalid(); 33 | JsonObject &object = _buffer->createObject(); 34 | set(key, object); 35 | return object; 36 | } 37 | 38 | inline JsonObject &JsonArray::createNestedObject() { 39 | if (!_buffer) return JsonObject::invalid(); 40 | JsonObject &object = _buffer->createObject(); 41 | add(object); 42 | return object; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/JsonPair.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Polyfills/attributes.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | #else 14 | #define FORCE_INLINE __attribute__((always_inline)) 15 | #define NO_INLINE __attribute__((noinline)) 16 | #endif 17 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Polyfills/normalize.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/Print.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/RawJson.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/StaticJsonBuffer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | #if defined(__clang__) 13 | #pragma clang diagnostic push 14 | #pragma clang diagnostic ignored "-Wnon-virtual-dtor" 15 | #elif defined(__GNUC__) 16 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 17 | #pragma GCC diagnostic push 18 | #endif 19 | #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" 20 | #endif 21 | 22 | namespace ArduinoJson { 23 | 24 | // Implements a JsonBuffer with fixed memory allocation. 25 | // The template paramenter CAPACITY specifies the capacity of the buffer in 26 | // bytes. 27 | template 28 | class StaticJsonBuffer : public JsonBuffer { 29 | public: 30 | explicit StaticJsonBuffer() : _size(0) {} 31 | 32 | size_t capacity() const { 33 | return CAPACITY; 34 | } 35 | size_t size() const { 36 | return _size; 37 | } 38 | 39 | virtual void* alloc(size_t bytes) { 40 | if (_size + bytes > CAPACITY) return NULL; 41 | void* p = &_buffer[_size]; 42 | _size += round_size_up(bytes); 43 | return p; 44 | } 45 | 46 | private: 47 | uint8_t _buffer[CAPACITY]; 48 | size_t _size; 49 | }; 50 | } 51 | 52 | #if defined(__clang__) 53 | #pragma clang diagnostic pop 54 | #elif defined(__GNUC__) 55 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 56 | #pragma GCC diagnostic pop 57 | #endif 58 | #endif 59 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/ConstRefOrConstPtr.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 ConstRefOrConstPtr { 16 | typedef const T& type; 17 | }; 18 | template 19 | struct ConstRefOrConstPtr { 20 | typedef const T* type; 21 | }; 22 | template 23 | struct ConstRefOrConstPtr { 24 | typedef const T* type; 25 | }; 26 | template 27 | struct ConstRefOrConstPtr { 28 | typedef const T* type; 29 | }; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/EnableIf.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsFloatingPoint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsSame.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsSignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/RemoveConst.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/include/ArduinoJson/TypeTraits/RemoveReference.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/keywords.txt: -------------------------------------------------------------------------------- 1 | JsonArray KEYWORD1 2 | JsonObject KEYWORD1 3 | JsonVariant KEYWORD1 4 | StaticJsonBuffer KEYWORD1 5 | add KEYWORD2 6 | createArray KEYWORD2 7 | createNestedArray KEYWORD2 8 | createNestedObject KEYWORD2 9 | createObject KEYWORD2 10 | parseArray KEYWORD2 11 | parseObject KEYWORD2 12 | prettyPrintTo KEYWORD2 13 | printTo KEYWORD2 14 | success KEYWORD2 15 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ArduinoJson", 3 | "keywords": "json, rest, http, web", 4 | "description": "An elegant and efficient JSON library for embedded systems", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/bblanchon/ArduinoJson.git" 8 | }, 9 | "version": "5.7.0", 10 | "authors": { 11 | "name": "Benoit Blanchon", 12 | "url": "http://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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/library.properties: -------------------------------------------------------------------------------- 1 | name=ArduinoJson 2 | version=5.7.0 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/scripts/build-arduino-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TAG=$(git describe) 4 | OUTPUT="ArduinoJson-$TAG.zip" 5 | 6 | cd $(dirname $0)/../.. 7 | 8 | # remove existing file 9 | rm -f $OUTPUT 10 | 11 | # create zip 12 | 7z a $OUTPUT \ 13 | ArduinoJson/CHANGELOG.md \ 14 | ArduinoJson/examples \ 15 | ArduinoJson/include \ 16 | ArduinoJson/keywords.txt \ 17 | ArduinoJson/library.properties \ 18 | ArduinoJson/LICENSE.md \ 19 | ArduinoJson/README.md \ 20 | ArduinoJson/ArduinoJson.h 21 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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$") -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/scripts/travis/cmake-osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | URL=https://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.tar.gz 4 | 5 | curl -sS $URL | tar xz -C /tmp --strip 1 6 | 7 | /tmp/CMake.app/Contents/bin/cmake . 8 | make 9 | make test 10 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/scripts/travis/cmake.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -eux 2 | 3 | URL=https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz 4 | 5 | curl -sS $URL | tar xz -C /tmp --strip 1 6 | 7 | /tmp/bin/cmake -DCMAKE_CXX_COMPILER=$CMAKE_CXX_COMPILER . 8 | make 9 | make test 10 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 10 | coveralls --exclude third-party --gcov-options '\-lp'; fi 11 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 JsonParserExample JsonGeneratorExample 8 | do 9 | platformio ci examples/$EXAMPLE/$EXAMPLE.ino -l '.' -b $BOARD 10 | done 11 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Benoit Blanchon 2014-2016 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(gtest.cmake) 9 | 10 | file(GLOB TESTS_FILES *.hpp *.cpp) 11 | 12 | if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") 13 | add_compile_options( 14 | -fno-exceptions 15 | -fno-rtti 16 | -pedantic 17 | -Wall 18 | -Wcast-align 19 | -Wcast-qual 20 | -Wconversion 21 | -Wctor-dtor-privacy 22 | -Wdisabled-optimization 23 | -Werror 24 | -Wextra 25 | -Wformat=2 26 | -Winit-self 27 | -Wmissing-include-dirs 28 | -Wparentheses 29 | -Wnon-virtual-dtor 30 | -Wold-style-cast 31 | -Woverloaded-virtual 32 | -Wredundant-decls 33 | -Wshadow 34 | -Wsign-promo 35 | -Wstrict-overflow=5 36 | -Wundef 37 | ) 38 | endif() 39 | 40 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") 41 | add_compile_options( 42 | -Wstrict-null-sentinel 43 | ) 44 | 45 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.5) 46 | add_compile_options(-Wlogical-op) # the flag exists in 4.4 but is buggy 47 | endif() 48 | 49 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6) 50 | add_compile_options(-Wnoexcept) 51 | endif() 52 | endif() 53 | 54 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") 55 | add_compile_options( 56 | -Wc++11-compat 57 | -Wdeprecated-register 58 | ) 59 | endif() 60 | 61 | if(MSVC) 62 | add_definitions(-D_CRT_SECURE_NO_WARNINGS) 63 | add_compile_options( 64 | /W4 # Set warning level 65 | /WX # Treats all compiler warnings as errors. 66 | ) 67 | endif() 68 | 69 | add_executable(ArduinoJsonTests ${TESTS_FILES}) 70 | target_include_directories(ArduinoJsonTests PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../include) 71 | target_link_libraries(ArduinoJsonTests gtest) 72 | 73 | add_test(ArduinoJsonTests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ArduinoJsonTests) 74 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/DynamicJsonBuffer_Array_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/DynamicJsonBuffer_Basic_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 DynamicJsonBuffer_Basic_Tests : public testing::Test { 12 | protected: 13 | DynamicJsonBuffer buffer; 14 | }; 15 | 16 | TEST_F(DynamicJsonBuffer_Basic_Tests, InitialSizeIsZero) { 17 | ASSERT_EQ(0, buffer.size()); 18 | } 19 | 20 | TEST_F(DynamicJsonBuffer_Basic_Tests, SizeIncreasesAfterAlloc) { 21 | buffer.alloc(1); 22 | ASSERT_LE(1U, buffer.size()); 23 | buffer.alloc(1); 24 | ASSERT_LE(2U, buffer.size()); 25 | } 26 | 27 | TEST_F(DynamicJsonBuffer_Basic_Tests, ReturnDifferentPointer) { 28 | void* p1 = buffer.alloc(1); 29 | void* p2 = buffer.alloc(2); 30 | ASSERT_NE(p1, p2); 31 | } 32 | 33 | TEST_F(DynamicJsonBuffer_Basic_Tests, Alignment) { 34 | size_t mask = sizeof(void*) - 1; 35 | 36 | for (size_t size = 1; size <= sizeof(void*); size++) { 37 | size_t addr = reinterpret_cast(buffer.alloc(1)); 38 | ASSERT_EQ(0, addr & mask); 39 | } 40 | } 41 | 42 | TEST_F(DynamicJsonBuffer_Basic_Tests, strdup) { 43 | char original[] = "hello"; 44 | char* copy = buffer.strdup(original); 45 | strcpy(original, "world"); 46 | ASSERT_STREQ("hello", copy); 47 | } 48 | 49 | TEST_F(DynamicJsonBuffer_Basic_Tests, strdup_givenNull) { 50 | const char* original = NULL; 51 | char* copy = buffer.strdup(original); 52 | ASSERT_EQ(NULL, copy); 53 | } 54 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/DynamicJsonBuffer_NoMemory_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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) { return NULL; } 14 | void deallocate(void*) {} 15 | }; 16 | 17 | class DynamicJsonBuffer_NoMemory_Tests : public ::testing::Test { 18 | protected: 19 | Internals::BlockJsonBuffer _jsonBuffer; 20 | }; 21 | 22 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, FixCodeCoverage) { 23 | // call this function to fix code coverage 24 | NoMemoryAllocator().deallocate(NULL); 25 | } 26 | 27 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, CreateArray) { 28 | ASSERT_FALSE(_jsonBuffer.createArray().success()); 29 | } 30 | 31 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, CreateObject) { 32 | ASSERT_FALSE(_jsonBuffer.createObject().success()); 33 | } 34 | 35 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, ParseArray) { 36 | char json[] = "[]"; 37 | ASSERT_FALSE(_jsonBuffer.parseArray(json).success()); 38 | } 39 | 40 | TEST_F(DynamicJsonBuffer_NoMemory_Tests, ParseObject) { 41 | char json[] = "{}"; 42 | ASSERT_FALSE(_jsonBuffer.parseObject(json).success()); 43 | } 44 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/DynamicJsonBuffer_Object_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/Issue10.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/Issue214.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/Issue34.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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) { test_with_value(1); } 27 | 28 | TEST_F(Issue34, uint8_t) { test_with_value(2); } 29 | 30 | TEST_F(Issue34, int16_t) { test_with_value(3); } 31 | 32 | TEST_F(Issue34, uint16_t) { test_with_value(4); } 33 | 34 | TEST_F(Issue34, int32_t) { test_with_value(5); } 35 | 36 | TEST_F(Issue34, uint32_t) { test_with_value(6); } 37 | 38 | TEST_F(Issue34, float) { test_with_value(7); } 39 | 40 | TEST_F(Issue34, double) { test_with_value(8); } 41 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/Issue90.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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) { ASSERT_FALSE(variant.is()); } 24 | 25 | TEST(SUITE, AsLong) { ASSERT_EQ(LONG_MAX, variant.as()); } 26 | 27 | TEST(SUITE, IsAString) { ASSERT_FALSE(variant.is()); } 28 | 29 | TEST(SUITE, AsString) { ASSERT_STREQ(superLong, variant.as()); } 30 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonArray_Basic_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonArray_CopyFrom_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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_CopyFrom_Tests, OneDimension) { 12 | DynamicJsonBuffer jsonBuffer; 13 | JsonArray& array = jsonBuffer.createArray(); 14 | char json[32]; 15 | int source[] = {1, 2, 3}; 16 | 17 | bool ok = array.copyFrom(source); 18 | ASSERT_TRUE(ok); 19 | 20 | array.printTo(json, sizeof(json)); 21 | ASSERT_STREQ("[1,2,3]", json); 22 | } 23 | 24 | TEST(JsonArray_CopyFrom_Tests, OneDimension_JsonBufferTooSmall) { 25 | const size_t SIZE = JSON_ARRAY_SIZE(2); 26 | StaticJsonBuffer jsonBuffer; 27 | JsonArray& array = jsonBuffer.createArray(); 28 | char json[32]; 29 | int source[] = {1, 2, 3}; 30 | 31 | bool ok = array.copyFrom(source); 32 | ASSERT_FALSE(ok); 33 | 34 | array.printTo(json, sizeof(json)); 35 | ASSERT_STREQ("[1,2]", json); 36 | } 37 | 38 | TEST(JsonArray_CopyFrom_Tests, TwoDimensions) { 39 | DynamicJsonBuffer jsonBuffer; 40 | JsonArray& array = jsonBuffer.createArray(); 41 | char json[32]; 42 | int source[][3] = {{1, 2, 3}, {4, 5, 6}}; 43 | 44 | bool ok = array.copyFrom(source); 45 | ASSERT_TRUE(ok); 46 | 47 | array.printTo(json, sizeof(json)); 48 | ASSERT_STREQ("[[1,2,3],[4,5,6]]", json); 49 | } 50 | 51 | TEST(JsonArray_CopyFrom_Tests, TwoDimensions_JsonBufferTooSmall) { 52 | const size_t SIZE = 53 | JSON_ARRAY_SIZE(2) + JSON_ARRAY_SIZE(3) + JSON_ARRAY_SIZE(2); 54 | StaticJsonBuffer jsonBuffer; 55 | JsonArray& array = jsonBuffer.createArray(); 56 | char json[32]; 57 | int source[][3] = {{1, 2, 3}, {4, 5, 6}}; 58 | 59 | bool ok = array.copyFrom(source); 60 | ASSERT_FALSE(ok); 61 | 62 | array.printTo(json, sizeof(json)); 63 | ASSERT_STREQ("[[1,2,3],[4,5]]", json); 64 | } 65 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonArray_CopyTo_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonArray_Invalid_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonArray_Iterator_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonArray_PrettyPrintTo_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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_PrettyPrintTo_Tests : public testing::Test { 12 | public: 13 | JsonArray_PrettyPrintTo_Tests() : array(jsonBuffer.createArray()) {} 14 | 15 | protected: 16 | DynamicJsonBuffer jsonBuffer; 17 | JsonArray& array; 18 | 19 | void outputMustBe(const char* expected) { 20 | char actual[256]; 21 | 22 | size_t actualLen = array.prettyPrintTo(actual, sizeof(actual)); 23 | size_t measuredLen = array.measurePrettyLength(); 24 | 25 | EXPECT_STREQ(expected, actual); 26 | EXPECT_EQ(strlen(expected), actualLen); 27 | EXPECT_EQ(strlen(expected), measuredLen); 28 | } 29 | }; 30 | 31 | TEST_F(JsonArray_PrettyPrintTo_Tests, Empty) { outputMustBe("[]"); } 32 | 33 | TEST_F(JsonArray_PrettyPrintTo_Tests, OneElement) { 34 | array.add(1); 35 | 36 | outputMustBe( 37 | "[\r\n" 38 | " 1\r\n" 39 | "]"); 40 | } 41 | 42 | TEST_F(JsonArray_PrettyPrintTo_Tests, TwoElements) { 43 | array.add(1); 44 | array.add(2); 45 | 46 | outputMustBe( 47 | "[\r\n" 48 | " 1,\r\n" 49 | " 2\r\n" 50 | "]"); 51 | } 52 | 53 | TEST_F(JsonArray_PrettyPrintTo_Tests, EmptyNestedArrays) { 54 | array.createNestedArray(); 55 | array.createNestedArray(); 56 | 57 | outputMustBe( 58 | "[\r\n" 59 | " [],\r\n" 60 | " []\r\n" 61 | "]"); 62 | } 63 | 64 | TEST_F(JsonArray_PrettyPrintTo_Tests, NestedArrays) { 65 | JsonArray& nested1 = array.createNestedArray(); 66 | nested1.add(1); 67 | nested1.add(2); 68 | 69 | JsonObject& nested2 = array.createNestedObject(); 70 | nested2["key"] = 3; 71 | 72 | outputMustBe( 73 | "[\r\n" 74 | " [\r\n" 75 | " 1,\r\n" 76 | " 2\r\n" 77 | " ],\r\n" 78 | " {\r\n" 79 | " \"key\": 3\r\n" 80 | " }\r\n" 81 | "]"); 82 | } 83 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonArray_Remove_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonObject_Basic_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonObject_ContainsKey_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonObject_Get_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonObject_Invalid_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonObject_Iterator_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonObject_Remove_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonParser_Nested_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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(JsonParser_Nested_Tests, ArrayNestedInObject) { 12 | DynamicJsonBuffer jsonBuffer; 13 | char jsonString[] = " { \"ab\" : [ 1 , 2 ] , \"cd\" : [ 3 , 4 ] } "; 14 | 15 | JsonObject &object = jsonBuffer.parseObject(jsonString); 16 | JsonArray &array1 = object["ab"]; 17 | const JsonArray &array2 = object["cd"]; 18 | JsonArray &array3 = object["ef"]; 19 | 20 | ASSERT_TRUE(object.success()); 21 | 22 | ASSERT_TRUE(array1.success()); 23 | ASSERT_TRUE(array2.success()); 24 | ASSERT_FALSE(array3.success()); 25 | 26 | ASSERT_EQ(2, array1.size()); 27 | ASSERT_EQ(2, array2.size()); 28 | ASSERT_EQ(0, array3.size()); 29 | 30 | EXPECT_EQ(1, array1[0].as()); 31 | EXPECT_EQ(2, array1[1].as()); 32 | 33 | EXPECT_EQ(3, array2[0].as()); 34 | EXPECT_EQ(4, array2[1].as()); 35 | 36 | EXPECT_EQ(0, array3[0].as()); 37 | } 38 | 39 | TEST(JsonParser_Nested_Tests, ObjectNestedInArray) { 40 | DynamicJsonBuffer jsonBuffer; 41 | char jsonString[] = 42 | " [ { \"a\" : 1 , \"b\" : 2 } , { \"c\" : 3 , \"d\" : 4 } ] "; 43 | 44 | JsonArray &array = jsonBuffer.parseArray(jsonString); 45 | JsonObject &object1 = array[0]; 46 | const JsonObject &object2 = array[1]; 47 | JsonObject &object3 = array[2]; 48 | 49 | ASSERT_TRUE(array.success()); 50 | 51 | ASSERT_TRUE(object1.success()); 52 | ASSERT_TRUE(object2.success()); 53 | ASSERT_FALSE(object3.success()); 54 | 55 | ASSERT_EQ(2, object1.size()); 56 | ASSERT_EQ(2, object2.size()); 57 | ASSERT_EQ(0, object3.size()); 58 | 59 | EXPECT_EQ(1, object1["a"].as()); 60 | EXPECT_EQ(2, object1["b"].as()); 61 | EXPECT_EQ(3, object2["c"].as()); 62 | EXPECT_EQ(4, object2["d"].as()); 63 | EXPECT_EQ(0, object3["e"].as()); 64 | } 65 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonVariant_Copy_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 JsonVariant_Copy_Tests : public ::testing::Test { 12 | protected: 13 | DynamicJsonBuffer _jsonBuffer; 14 | JsonVariant _variant1; 15 | JsonVariant _variant2; 16 | }; 17 | 18 | TEST_F(JsonVariant_Copy_Tests, IntegersAreCopiedByValue) { 19 | _variant1 = 123; 20 | _variant2 = _variant1; 21 | _variant1 = 456; 22 | 23 | EXPECT_EQ(123, _variant2.as()); 24 | } 25 | 26 | TEST_F(JsonVariant_Copy_Tests, DoublesAreCopiedByValue) { 27 | _variant1 = 123.45; 28 | _variant2 = _variant1; 29 | _variant1 = 456.78; 30 | 31 | EXPECT_EQ(123.45, _variant2.as()); 32 | } 33 | 34 | TEST_F(JsonVariant_Copy_Tests, BooleansAreCopiedByValue) { 35 | _variant1 = true; 36 | _variant2 = _variant1; 37 | _variant1 = false; 38 | 39 | EXPECT_TRUE(_variant2.as()); 40 | } 41 | 42 | TEST_F(JsonVariant_Copy_Tests, StringsAreCopiedByValue) { 43 | _variant1 = "hello"; 44 | _variant2 = _variant1; 45 | _variant1 = "world"; 46 | 47 | EXPECT_STREQ("hello", _variant2.as()); 48 | } 49 | 50 | TEST_F(JsonVariant_Copy_Tests, ObjectsAreCopiedByReference) { 51 | JsonObject &object = _jsonBuffer.createObject(); 52 | 53 | _variant1 = object; 54 | 55 | object["hello"] = "world"; 56 | 57 | EXPECT_EQ(1, _variant1.asObject().size()); 58 | } 59 | 60 | TEST_F(JsonVariant_Copy_Tests, ArraysAreCopiedByReference) { 61 | JsonArray &array = _jsonBuffer.createArray(); 62 | 63 | _variant1 = array; 64 | 65 | array.add("world"); 66 | 67 | EXPECT_EQ(1, _variant1.asArray().size()); 68 | } 69 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonVariant_Subscript_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 JsonVariant_Subscript_Tests : public ::testing::Test { 12 | protected: 13 | DynamicJsonBuffer _jsonBuffer; 14 | JsonVariant _variant; 15 | }; 16 | 17 | TEST_F(JsonVariant_Subscript_Tests, Array) { 18 | JsonArray &array = _jsonBuffer.createArray(); 19 | array.add("element at index 0"); 20 | array.add("element at index 1"); 21 | 22 | _variant = array; 23 | 24 | EXPECT_EQ(2, _variant.size()); 25 | EXPECT_STREQ("element at index 0", _variant[0].asString()); 26 | EXPECT_STREQ("element at index 1", _variant[1].asString()); 27 | EXPECT_FALSE(_variant[-1].success()); 28 | EXPECT_FALSE(_variant[3].success()); 29 | EXPECT_FALSE(_variant["0"].success()); 30 | } 31 | 32 | TEST_F(JsonVariant_Subscript_Tests, Object) { 33 | JsonObject &object = _jsonBuffer.createObject(); 34 | object["a"] = "element at key \"a\""; 35 | object["b"] = "element at key \"b\""; 36 | 37 | _variant = object; 38 | 39 | EXPECT_EQ(2, _variant.size()); 40 | EXPECT_STREQ("element at key \"a\"", _variant["a"].asString()); 41 | EXPECT_STREQ("element at key \"b\"", _variant["b"].asString()); 42 | EXPECT_FALSE(_variant["c"].success()); 43 | EXPECT_FALSE(_variant[0].success()); 44 | } 45 | 46 | TEST_F(JsonVariant_Subscript_Tests, Undefined) { 47 | _variant = JsonVariant(); 48 | EXPECT_EQ(0, _variant.size()); 49 | EXPECT_FALSE(_variant["0"].success()); 50 | EXPECT_FALSE(_variant[0].success()); 51 | } 52 | 53 | TEST_F(JsonVariant_Subscript_Tests, String) { 54 | _variant = "hello world"; 55 | EXPECT_EQ(0, _variant.size()); 56 | EXPECT_FALSE(_variant["0"].success()); 57 | EXPECT_FALSE(_variant[0].success()); 58 | } 59 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonVariant_Success_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/JsonVariant_Undefined_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 JsonVariant_Undefined_Tests : public ::testing::Test { 12 | protected: 13 | JsonVariant variant; 14 | }; 15 | 16 | TEST_F(JsonVariant_Undefined_Tests, AsLongReturns0) { 17 | EXPECT_EQ(0, variant.as()); 18 | } 19 | 20 | TEST_F(JsonVariant_Undefined_Tests, AsUnsignedReturns0) { 21 | EXPECT_EQ(0, variant.as()); 22 | } 23 | 24 | TEST_F(JsonVariant_Undefined_Tests, AsStringReturnsNull) { 25 | EXPECT_EQ(0, variant.asString()); 26 | } 27 | 28 | TEST_F(JsonVariant_Undefined_Tests, AsDoubleReturns0) { 29 | EXPECT_EQ(0, variant.as()); 30 | } 31 | 32 | TEST_F(JsonVariant_Undefined_Tests, AsBoolReturnsFalse) { 33 | EXPECT_FALSE(variant.as()); 34 | } 35 | 36 | TEST_F(JsonVariant_Undefined_Tests, AsArrayReturnInvalid) { 37 | EXPECT_EQ(JsonArray::invalid(), variant.as()); 38 | } 39 | 40 | TEST_F(JsonVariant_Undefined_Tests, AsConstArrayReturnInvalid) { 41 | EXPECT_EQ(JsonArray::invalid(), variant.as()); 42 | } 43 | 44 | TEST_F(JsonVariant_Undefined_Tests, AsObjectReturnInvalid) { 45 | EXPECT_EQ(JsonObject::invalid(), variant.as()); 46 | } 47 | 48 | TEST_F(JsonVariant_Undefined_Tests, AsConstObjectReturnInvalid) { 49 | EXPECT_EQ(JsonObject::invalid(), variant.as()); 50 | } 51 | 52 | TEST_F(JsonVariant_Undefined_Tests, AsArrayWrapperReturnInvalid) { 53 | EXPECT_EQ(JsonArray::invalid(), variant.asArray()); 54 | } 55 | 56 | TEST_F(JsonVariant_Undefined_Tests, AsObjectWrapperReturnInvalid) { 57 | EXPECT_EQ(JsonObject::invalid(), variant.asObject()); 58 | } 59 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/StaticJsonBuffer_Basic_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 StaticJsonBuffer_Basic_Tests : public testing::Test { 12 | protected: 13 | StaticJsonBuffer<64> buffer; 14 | }; 15 | 16 | TEST_F(StaticJsonBuffer_Basic_Tests, CapacityMatchTemplateParameter) { 17 | ASSERT_EQ(64, buffer.capacity()); 18 | } 19 | 20 | TEST_F(StaticJsonBuffer_Basic_Tests, InitialSizeIsZero) { 21 | ASSERT_EQ(0, buffer.size()); 22 | } 23 | 24 | TEST_F(StaticJsonBuffer_Basic_Tests, GrowsAfterAlloc) { 25 | buffer.alloc(1); 26 | ASSERT_LE(1U, buffer.size()); 27 | buffer.alloc(1); 28 | ASSERT_LE(2U, buffer.size()); 29 | } 30 | 31 | TEST_F(StaticJsonBuffer_Basic_Tests, DoesntGrowWhenFull) { 32 | buffer.alloc(64); 33 | buffer.alloc(1); 34 | ASSERT_EQ(64, buffer.size()); 35 | } 36 | 37 | TEST_F(StaticJsonBuffer_Basic_Tests, DoesntGrowWhenTooSmall) { 38 | buffer.alloc(65); 39 | ASSERT_EQ(0, buffer.size()); 40 | } 41 | 42 | TEST_F(StaticJsonBuffer_Basic_Tests, ReturnsNonNull) { 43 | void *p = buffer.alloc(64); 44 | ASSERT_NE(static_cast(0), p); 45 | } 46 | 47 | TEST_F(StaticJsonBuffer_Basic_Tests, ReturnsNullWhenFull) { 48 | buffer.alloc(64); 49 | void *p = buffer.alloc(1); 50 | ASSERT_EQ(NULL, p); 51 | } 52 | 53 | TEST_F(StaticJsonBuffer_Basic_Tests, ReturnsNullWhenTooSmall) { 54 | void *p = buffer.alloc(65); 55 | ASSERT_EQ(NULL, p); 56 | } 57 | 58 | TEST_F(StaticJsonBuffer_Basic_Tests, Alignment) { 59 | size_t mask = sizeof(void *) - 1; 60 | 61 | for (size_t size = 1; size <= sizeof(void *); size++) { 62 | size_t addr = reinterpret_cast(buffer.alloc(1)); 63 | ASSERT_EQ(0, addr & mask); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/StaticJsonBuffer_CreateArray_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/StaticJsonBuffer_CreateObject_Tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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_CreateObject_Tests, GrowsWithObject) { 12 | StaticJsonBuffer buffer; 13 | 14 | JsonObject &obj = buffer.createObject(); 15 | ASSERT_EQ(JSON_OBJECT_SIZE(0), buffer.size()); 16 | 17 | obj["hello"]; 18 | ASSERT_EQ(JSON_OBJECT_SIZE(0), buffer.size()); 19 | 20 | obj["hello"] = 1; 21 | ASSERT_EQ(JSON_OBJECT_SIZE(1), buffer.size()); 22 | 23 | obj["world"] = 2; 24 | ASSERT_EQ(JSON_OBJECT_SIZE(2), buffer.size()); 25 | 26 | obj["world"] = 3; // <- same key, should not grow 27 | ASSERT_EQ(JSON_OBJECT_SIZE(2), buffer.size()); 28 | } 29 | 30 | TEST(StaticJsonBuffer_CreateObject_Tests, SucceedWhenBigEnough) { 31 | StaticJsonBuffer buffer; 32 | 33 | JsonObject &object = buffer.createObject(); 34 | ASSERT_TRUE(object.success()); 35 | } 36 | 37 | TEST(StaticJsonBuffer_CreateObject_Tests, FailsWhenTooSmall) { 38 | StaticJsonBuffer buffer; 39 | 40 | JsonObject &object = buffer.createObject(); 41 | ASSERT_FALSE(object.success()); 42 | } 43 | 44 | TEST(StaticJsonBuffer_CreateObject_Tests, ObjectDoesntGrowWhenFull) { 45 | StaticJsonBuffer buffer; 46 | 47 | JsonObject &obj = buffer.createObject(); 48 | obj["hello"] = 1; 49 | obj["world"] = 2; 50 | 51 | ASSERT_EQ(JSON_OBJECT_SIZE(1), buffer.size()); 52 | ASSERT_EQ(1, obj.size()); 53 | 54 | char json[64]; 55 | obj.printTo(json, sizeof(json)); 56 | ASSERT_STREQ("{\"hello\":1}", json); 57 | } 58 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/StdStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | TEST(StdStream, JsonVariantFalse) { 13 | std::ostringstream os; 14 | JsonVariant variant = false; 15 | os << variant; 16 | ASSERT_EQ("false", os.str()); 17 | } 18 | 19 | TEST(StdStream, JsonVariantString) { 20 | std::ostringstream os; 21 | JsonVariant variant = "coucou"; 22 | os << variant; 23 | ASSERT_EQ("\"coucou\"", os.str()); 24 | } 25 | 26 | TEST(StdStream, JsonObject) { 27 | std::ostringstream os; 28 | DynamicJsonBuffer jsonBuffer; 29 | JsonObject& object = jsonBuffer.createObject(); 30 | object["key"] = "value"; 31 | os << object; 32 | ASSERT_EQ("{\"key\":\"value\"}", os.str()); 33 | } 34 | 35 | TEST(StdStream, JsonObjectSubscript) { 36 | std::ostringstream os; 37 | DynamicJsonBuffer jsonBuffer; 38 | JsonObject& object = jsonBuffer.createObject(); 39 | object["key"] = "value"; 40 | os << object["key"]; 41 | ASSERT_EQ("\"value\"", os.str()); 42 | } 43 | 44 | TEST(StdStream, JsonArray) { 45 | std::ostringstream os; 46 | DynamicJsonBuffer jsonBuffer; 47 | JsonArray& array = jsonBuffer.createArray(); 48 | array.add("value"); 49 | os << array; 50 | ASSERT_EQ("[\"value\"]", os.str()); 51 | } 52 | 53 | TEST(StdStream, JsonArraySubscript) { 54 | std::ostringstream os; 55 | DynamicJsonBuffer jsonBuffer; 56 | JsonArray& array = jsonBuffer.createArray(); 57 | array.add("value"); 58 | os << array[0]; 59 | ASSERT_EQ("\"value\"", os.str()); 60 | } 61 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/test/StringBuilderTests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 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 | using namespace ArduinoJson::Internals; 12 | 13 | class StringBuilderTests : public testing::Test { 14 | protected: 15 | virtual void SetUp() { 16 | _stringBuilder = new StaticStringBuilder(_buffer, sizeof(_buffer)); 17 | } 18 | 19 | virtual void TearDown() { delete _stringBuilder; } 20 | 21 | void print(const char *value) { _returnValue = _stringBuilder->print(value); } 22 | 23 | void outputMustBe(const char *expected) { EXPECT_STREQ(expected, _buffer); } 24 | 25 | void resultMustBe(size_t expected) { EXPECT_EQ(expected, _returnValue); } 26 | 27 | private: 28 | char _buffer[20]; 29 | Print *_stringBuilder; 30 | size_t _returnValue; 31 | }; 32 | 33 | TEST_F(StringBuilderTests, InitialState) { outputMustBe(""); } 34 | 35 | TEST_F(StringBuilderTests, OverCapacity) { 36 | print("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); 37 | resultMustBe(19); 38 | 39 | print("ABC"); 40 | resultMustBe(0); 41 | 42 | outputMustBe("ABCDEFGHIJKLMNOPQRS"); 43 | } 44 | 45 | TEST_F(StringBuilderTests, EmptyString) { 46 | print(""); 47 | resultMustBe(0); 48 | outputMustBe(""); 49 | } 50 | 51 | TEST_F(StringBuilderTests, OneString) { 52 | print("ABCD"); 53 | resultMustBe(4); 54 | outputMustBe("ABCD"); 55 | } 56 | 57 | TEST_F(StringBuilderTests, TwoStrings) { 58 | print("ABCD"); 59 | resultMustBe(4); 60 | 61 | print("EFGH"); 62 | resultMustBe(4); 63 | 64 | outputMustBe("ABCDEFGH"); 65 | } 66 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/build-aux/config.h.in: -------------------------------------------------------------------------------- 1 | /* build-aux/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define if you have POSIX threads libraries and header files. */ 13 | #undef HAVE_PTHREAD 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDINT_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDLIB_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRINGS_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRING_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_STAT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_TYPES_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_UNISTD_H 35 | 36 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 37 | */ 38 | #undef LT_OBJDIR 39 | 40 | /* Name of package */ 41 | #undef PACKAGE 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #undef PACKAGE_BUGREPORT 45 | 46 | /* Define to the full name of this package. */ 47 | #undef PACKAGE_NAME 48 | 49 | /* Define to the full name and version of this package. */ 50 | #undef PACKAGE_STRING 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #undef PACKAGE_TARNAME 54 | 55 | /* Define to the home page for this package. */ 56 | #undef PACKAGE_URL 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to necessary symbol if this constant uses a non-standard name on 62 | your system. */ 63 | #undef PTHREAD_CREATE_JOINABLE 64 | 65 | /* Define to 1 if you have the ANSI C header files. */ 66 | #undef STDC_HEADERS 67 | 68 | /* Version number of package */ 69 | #undef VERSION 70 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/codegear/gtest_all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, 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 | // 30 | // Author: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // C++Builder's IDE cannot build a static library from files with hyphens 35 | // in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 . 36 | // This file serves as a workaround. 37 | 38 | #include "src/gtest-all.cc" 39 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/fused-src/gtest/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, 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 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE1_H_ 35 | #define GTEST_SAMPLES_SAMPLE1_H_ 36 | 37 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 38 | int Factorial(int n); 39 | 40 | // Returns true iff n is a prime number. 41 | bool IsPrime(int n); 42 | 43 | #endif // GTEST_SAMPLES_SAMPLE1_H_ 44 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/samples/sample4.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include 35 | 36 | #include "sample4.h" 37 | 38 | // Returns the current counter value, and increments it. 39 | int Counter::Increment() { 40 | return counter_++; 41 | } 42 | 43 | // Prints the current counter value to STDOUT. 44 | void Counter::Print() const { 45 | printf("%d", counter_); 46 | } 47 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | #include "sample4.h" 34 | 35 | // Tests the Increment() method. 36 | TEST(Counter, Increment) { 37 | Counter c; 38 | 39 | // EXPECT_EQ() evaluates its arguments exactly once, so they 40 | // can have side effects. 41 | 42 | EXPECT_EQ(0, c.Increment()); 43 | EXPECT_EQ(1, c.Increment()); 44 | EXPECT_EQ(2, c.Increment()); 45 | } 46 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/scripts/test/Makefile: -------------------------------------------------------------------------------- 1 | # A Makefile for fusing Google Test and building a sample test against it. 2 | # 3 | # SYNOPSIS: 4 | # 5 | # make [all] - makes everything. 6 | # make TARGET - makes the given target. 7 | # make check - makes everything and runs the built sample test. 8 | # make clean - removes all files generated by make. 9 | 10 | # Points to the root of fused Google Test, relative to where this file is. 11 | FUSED_GTEST_DIR = output 12 | 13 | # Paths to the fused gtest files. 14 | FUSED_GTEST_H = $(FUSED_GTEST_DIR)/gtest/gtest.h 15 | FUSED_GTEST_ALL_CC = $(FUSED_GTEST_DIR)/gtest/gtest-all.cc 16 | 17 | # Where to find the sample test. 18 | SAMPLE_DIR = ../../samples 19 | 20 | # Where to find gtest_main.cc. 21 | GTEST_MAIN_CC = ../../src/gtest_main.cc 22 | 23 | # Flags passed to the preprocessor. 24 | # We have no idea here whether pthreads is available in the system, so 25 | # disable its use. 26 | CPPFLAGS += -I$(FUSED_GTEST_DIR) -DGTEST_HAS_PTHREAD=0 27 | 28 | # Flags passed to the C++ compiler. 29 | CXXFLAGS += -g 30 | 31 | all : sample1_unittest 32 | 33 | check : all 34 | ./sample1_unittest 35 | 36 | clean : 37 | rm -rf $(FUSED_GTEST_DIR) sample1_unittest *.o 38 | 39 | $(FUSED_GTEST_H) : 40 | ../fuse_gtest_files.py $(FUSED_GTEST_DIR) 41 | 42 | $(FUSED_GTEST_ALL_CC) : 43 | ../fuse_gtest_files.py $(FUSED_GTEST_DIR) 44 | 45 | gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GTEST_ALL_CC) 46 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GTEST_DIR)/gtest/gtest-all.cc 47 | 48 | gtest_main.o : $(FUSED_GTEST_H) $(GTEST_MAIN_CC) 49 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_MAIN_CC) 50 | 51 | sample1.o : $(SAMPLE_DIR)/sample1.cc $(SAMPLE_DIR)/sample1.h 52 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1.cc 53 | 54 | sample1_unittest.o : $(SAMPLE_DIR)/sample1_unittest.cc \ 55 | $(SAMPLE_DIR)/sample1.h $(FUSED_GTEST_H) 56 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1_unittest.cc 57 | 58 | sample1_unittest : sample1.o sample1_unittest.o gtest-all.o gtest_main.o 59 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ 60 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, 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 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | // Tests that we don't have to define main() when we link to 35 | // gtest_main instead of gtest. 36 | 37 | namespace { 38 | 39 | TEST(GTestMainTest, ShouldSucceed) { 40 | } 41 | 42 | } // namespace 43 | 44 | // We are using the main() function defined in src/gtest_main.cc, so 45 | // we don't define it here. 46 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/test/gtest_uninitialized_test_.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | TEST(DummyTest, Dummy) { 35 | // This test doesn't verify anything. We just need it to create a 36 | // realistic stage for testing the behavior of Google Test when 37 | // RUN_ALL_TESTS() is called without testing::InitGoogleTest() being 38 | // called first. 39 | } 40 | 41 | int main() { 42 | return RUN_ALL_TESTS(); 43 | } 44 | -------------------------------------------------------------------------------- /esp_sensor/libraries/ArduinoJson/third-party/gtest-1.7.0/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // This is part of the unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "production.h" 35 | 36 | PrivateCode::PrivateCode() : x_(0) {} 37 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/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 | -------------------------------------------------------------------------------- /esp_sensor/libraries/BH1750/BH1750.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This is a library for the BH1750FVI Digital Light Sensor 4 | breakout board. 5 | 6 | The board uses I2C for communication. 2 pins are required to 7 | interface to the device. 8 | 9 | Datasheet: 10 | http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf 11 | 12 | Written by Christopher Laws, March, 2013. 13 | 14 | */ 15 | 16 | #ifndef BH1750_h 17 | #define BH1750_h 18 | 19 | #if (ARDUINO >= 100) 20 | #include 21 | #else 22 | #include 23 | #endif 24 | #include "Wire.h" 25 | 26 | #define BH1750_DEBUG 0 27 | 28 | #define BH1750_I2CADDR 0x23 29 | 30 | // No active state 31 | #define BH1750_POWER_DOWN 0x00 32 | 33 | // Wating for measurment command 34 | #define BH1750_POWER_ON 0x01 35 | 36 | // Reset data register value - not accepted in POWER_DOWN mode 37 | #define BH1750_RESET 0x07 38 | 39 | // Start measurement at 1lx resolution. Measurement time is approx 120ms. 40 | #define BH1750_CONTINUOUS_HIGH_RES_MODE 0x10 41 | 42 | // Start measurement at 0.5lx resolution. Measurement time is approx 120ms. 43 | #define BH1750_CONTINUOUS_HIGH_RES_MODE_2 0x11 44 | 45 | // Start measurement at 4lx resolution. Measurement time is approx 16ms. 46 | #define BH1750_CONTINUOUS_LOW_RES_MODE 0x13 47 | 48 | // Start measurement at 1lx resolution. Measurement time is approx 120ms. 49 | // Device is automatically set to Power Down after measurement. 50 | #define BH1750_ONE_TIME_HIGH_RES_MODE 0x20 51 | 52 | // Start measurement at 0.5lx resolution. Measurement time is approx 120ms. 53 | // Device is automatically set to Power Down after measurement. 54 | #define BH1750_ONE_TIME_HIGH_RES_MODE_2 0x21 55 | 56 | // Start measurement at 1lx resolution. Measurement time is approx 120ms. 57 | // Device is automatically set to Power Down after measurement. 58 | #define BH1750_ONE_TIME_LOW_RES_MODE 0x23 59 | 60 | class BH1750 { 61 | public: 62 | BH1750(); 63 | void begin(uint8_t mode = BH1750_CONTINUOUS_HIGH_RES_MODE); 64 | void configure(uint8_t mode); 65 | uint16_t readLightLevel(void); 66 | 67 | private: 68 | void write8(uint8_t data); 69 | 70 | }; 71 | 72 | #endif -------------------------------------------------------------------------------- /esp_sensor/libraries/BH1750/README.md: -------------------------------------------------------------------------------- 1 | BH1750 2 | ====== 3 | 4 | An Arduino library for digital light sensor breakout boards containing the BH1750FVI IC. 5 | 6 | The board uses I2C for communication. 7 | 8 | 2 pins are required to interface to the device. 9 | 10 | Datasheet for the light sensor: 11 | http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf 12 | 13 | 14 | To download, click the ZIP button above. Extract the zip file and rename the uncompressed folder to BH1750. Check that it contains BH1750.cpp and BH1750.h, keywords.txt. 15 | 16 | Place the BH1750 library folder your <arduinosketchfolder>/libraries/ folder. Restart the IDE. 17 | 18 | 19 | Example usage: 20 | ```c 21 | /* 22 | 23 | Example of BH1750 library usage. 24 | 25 | This example initalises the BH1750 object using the default 26 | high resolution mode and then makes a light level reading every second. 27 | 28 | Connection: 29 | VCC-5v 30 | GND-GND 31 | SCL-SCL(analog pin 5) 32 | SDA-SDA(analog pin 4) 33 | ADD-NC or GND 34 | 35 | */ 36 | 37 | #include 38 | #include 39 | 40 | 41 | BH1750 lightMeter; 42 | 43 | 44 | void setup(){ 45 | Serial.begin(9600); 46 | lightMeter.begin(); 47 | Serial.println("Running..."); 48 | } 49 | 50 | 51 | void loop() { 52 | uint16_t lux = lightMeter.readLightLevel(); 53 | Serial.print("Light: "); 54 | Serial.print(lux); 55 | Serial.println(" lx"); 56 | delay(1000); 57 | } 58 | ``` 59 | -------------------------------------------------------------------------------- /esp_sensor/libraries/BH1750/examples/BH1750test/BH1750test.pde: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Example of BH1750 library usage. 4 | 5 | This example initalises the BH1750 object using the default 6 | high resolution mode and then makes a light level reading every second. 7 | 8 | Connection: 9 | VCC-5v 10 | GND-GND 11 | SCL-SCL(analog pin 5) 12 | SDA-SDA(analog pin 4) 13 | ADD-NC or GND 14 | 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | 21 | BH1750 lightMeter; 22 | 23 | 24 | void setup(){ 25 | Serial.begin(9600); 26 | lightMeter.begin(); 27 | Serial.println("Running..."); 28 | } 29 | 30 | 31 | void loop() { 32 | uint16_t lux = lightMeter.readLightLevel(); 33 | Serial.print("Light: "); 34 | Serial.print(lux); 35 | Serial.println(" lx"); 36 | delay(1000); 37 | } -------------------------------------------------------------------------------- /esp_sensor/libraries/BH1750/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For BH1750 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | BH1750 KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | configure KEYWORD2 17 | readLightLevel KEYWORD2 18 | 19 | 20 | ####################################### 21 | # Instances (KEYWORD2) 22 | ####################################### 23 | 24 | 25 | ####################################### 26 | # Constants (LITERAL1) 27 | ####################################### -------------------------------------------------------------------------------- /esp_sensor/libraries/BH1750/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BH1750", 3 | "keywords": "light, sensor", 4 | "description": "Digital light sensor breakout boards containing the BH1750FVI IC", 5 | "repository": 6 | { 7 | "type": "git", 8 | "url": "https://github.com/claws/BH1750.git" 9 | }, 10 | "frameworks": "arduino", 11 | "platforms": "atmelavr" 12 | } 13 | -------------------------------------------------------------------------------- /esp_sensor/libraries/DHT-sensor/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /esp_sensor/libraries/DHT-sensor/DHT.h: -------------------------------------------------------------------------------- 1 | /* DHT library 2 | 3 | MIT license 4 | written by Adafruit Industries 5 | */ 6 | #ifndef DHT_H 7 | #define DHT_H 8 | 9 | #if ARDUINO >= 100 10 | #include "Arduino.h" 11 | #else 12 | #include "WProgram.h" 13 | #endif 14 | 15 | 16 | // Uncomment to enable printing out nice debug messages. 17 | //#define DHT_DEBUG 18 | 19 | // Define where debug output will be printed. 20 | #define DEBUG_PRINTER Serial 21 | 22 | // Setup debug printing macros. 23 | #ifdef DHT_DEBUG 24 | #define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); } 25 | #define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); } 26 | #else 27 | #define DEBUG_PRINT(...) {} 28 | #define DEBUG_PRINTLN(...) {} 29 | #endif 30 | 31 | // Define types of sensors. 32 | #define DHT11 11 33 | #define DHT22 22 34 | #define DHT21 21 35 | #define AM2301 21 36 | 37 | 38 | class DHT { 39 | public: 40 | DHT(uint8_t pin, uint8_t type, uint8_t count=6); 41 | void begin(void); 42 | float readTemperature(bool S=false, bool force=false); 43 | float convertCtoF(float); 44 | float convertFtoC(float); 45 | float computeHeatIndex(float temperature, float percentHumidity, bool isFahrenheit=true); 46 | float readHumidity(bool force=false); 47 | boolean read(bool force=false); 48 | 49 | private: 50 | uint8_t data[5]; 51 | uint8_t _pin, _type; 52 | #ifdef __AVR 53 | // Use direct GPIO access on an 8-bit AVR so keep track of the port and bitmask 54 | // for the digital pin connected to the DHT. Other platforms will use digitalRead. 55 | uint8_t _bit, _port; 56 | #endif 57 | uint32_t _lastreadtime, _maxcycles; 58 | bool _lastresult; 59 | 60 | uint32_t expectPulse(bool level); 61 | 62 | }; 63 | 64 | class InterruptLock { 65 | public: 66 | InterruptLock() { 67 | noInterrupts(); 68 | } 69 | ~InterruptLock() { 70 | interrupts(); 71 | } 72 | 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /esp_sensor/libraries/DHT-sensor/README.md: -------------------------------------------------------------------------------- 1 | This is an Arduino library for the DHT series of low cost temperature/humidity sensors. 2 | 3 | Tutorial: https://learn.adafruit.com/dht 4 | 5 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder DHT. Check that the DHT folder contains DHT.cpp and DHT.h. Place the DHT library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE. 6 | 7 | # Adafruit DHT Humidity & Temperature Unified Sensor Library 8 | 9 | This library also includes an optional class for the 10 | [DHT humidity and temperature sensor](https://learn.adafruit.com/dht/overview) 11 | which is designed to work with the [Adafruit unified sensor library](https://learn.adafruit.com/using-the-adafruit-unified-sensor-driver/introduction). 12 | 13 | You must have the following Arduino libraries installed to use this class: 14 | 15 | - [Adafruit Unified Sensor Library](https://github.com/adafruit/Adafruit_Sensor) 16 | -------------------------------------------------------------------------------- /esp_sensor/libraries/DHT-sensor/keywords.txt: -------------------------------------------------------------------------------- 1 | ########################################### 2 | # Syntax Coloring Map For DHT-sensor-library 3 | ########################################### 4 | 5 | ########################################### 6 | # Datatypes (KEYWORD1) 7 | ########################################### 8 | 9 | DHT KEYWORD1 10 | 11 | ########################################### 12 | # Methods and Functions (KEYWORD2) 13 | ########################################### 14 | 15 | begin KEYWORD2 16 | readTemperature KEYWORD2 17 | convertCtoF KEYWORD2 18 | convertFtoC KEYWORD2 19 | computeHeatIndex KEYWORD2 20 | readHumidity KEYWORD2 21 | read KEYWORD2 22 | 23 | -------------------------------------------------------------------------------- /esp_sensor/libraries/DHT-sensor/library.properties: -------------------------------------------------------------------------------- 1 | name=DHT sensor library 2 | version=1.3.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors 6 | paragraph=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors 7 | category=Sensors 8 | url=https://github.com/adafruit/DHT-sensor-library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /esp_sensor/libraries/HTU21D/README.md: -------------------------------------------------------------------------------- 1 | This is an Arduino library for SHT21, HTU21D & Si70xx Digital Humidity and Temperature Sensor 2 | 3 | Supports all sensors features: 4 | 5 | - read Humidity for SHT21, HTU21D or Compensated Humidity for Si70xx 6 | - calculate Compensated Humidity for SHT21, HTU21D 7 | - read Temperature for SHT21, HTU21D, Si70xx or retrive Temperature value after RH measurement for Si70xx 8 | - soft Reset 9 | - check Battery Status 10 | - turn ON/OFF build-in Heater 11 | - read FW version 12 | - read sensor ID 13 | -------------------------------------------------------------------------------- /esp_sensor/libraries/HTU21D/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Datatypes (KEYWORD1) 3 | ####################################### 4 | 5 | HTU21D KEYWORD1 6 | 7 | ####################################### 8 | # Methods and Functions (KEYWORD2) 9 | ####################################### 10 | 11 | begin KEYWORD2 12 | readHumidity KEYWORD2 13 | readCompensatedHumidity KEYWORD2 14 | readTemperatureAfterRH KEYWORD2 15 | readTemperature KEYWORD2 16 | setResolution KEYWORD2 17 | 18 | softReset KEYWORD2 19 | batteryStatus KEYWORD2 20 | setHeater KEYWORD2 21 | readFirmwareVersion KEYWORD2 22 | readDeviceID KEYWORD2 23 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | sudo: false 3 | before_install: 4 | - source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh) 5 | script: 6 | - build_platform esp8266 7 | notifications: 8 | email: 9 | on_success: change 10 | on_failure: change 11 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/CHANGELOG: -------------------------------------------------------------------------------- 1 | NTPClient 3.1.0 - 2016.05.31 2 | 3 | * Added functions for changing the timeOffset and updateInterval later. Thanks @SirUli 4 | 5 | NTPClient 3.0.0 - 2016.04.19 6 | 7 | * Constructors now require UDP instance argument, to add support for non-ESP8266 boards 8 | * Added optional begin API to override default local port 9 | * Added end API to close UDP socket 10 | * Changed return type of update and forceUpdate APIs to bool, and return success or failure 11 | * Change return type of getDay, getHours, getMinutes, and getSeconds to int 12 | 13 | Older 14 | 15 | * Changes not recorded 16 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/README.md: -------------------------------------------------------------------------------- 1 | # NTPClient 2 | 3 | [![Build Status](https://travis-ci.org/arduino-libraries/NTPClient.svg?branch=master)](https://travis-ci.org/arduino-libraries/NTPClient) 4 | 5 | Connect to a NTP server, here is how: 6 | 7 | ```cpp 8 | #include 9 | // change next line to use with another board/shield 10 | #include 11 | //#include // for WiFi shield 12 | //#include // for WiFi 101 shield or MKR1000 13 | #include 14 | 15 | const char *ssid = ""; 16 | const char *password = ""; 17 | 18 | WiFiUDP ntpUDP; 19 | 20 | // By default 'time.nist.gov' is used with 60 seconds update interval and 21 | // no offset 22 | NTPClient timeClient(ntpUDP); 23 | 24 | // You can specify the time server pool and the offset, (in seconds) 25 | // additionaly you can specify the update interval (in milliseconds). 26 | // NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000); 27 | 28 | void setup(){ 29 | Serial.begin(115200); 30 | WiFi.begin(ssid, password); 31 | 32 | while ( WiFi.status() != WL_CONNECTED ) { 33 | delay ( 500 ); 34 | Serial.print ( "." ); 35 | } 36 | 37 | timeClient.begin(); 38 | } 39 | 40 | void loop() { 41 | timeClient.update(); 42 | 43 | Serial.println(timeClient.getFormattedTime()); 44 | 45 | delay(1000); 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/examples/Advanced/Advanced.ino: -------------------------------------------------------------------------------- 1 | #include 2 | // change next line to use with another board/shield 3 | #include 4 | //#include // for WiFi shield 5 | //#include // for WiFi 101 shield or MKR1000 6 | #include 7 | 8 | const char *ssid = ""; 9 | const char *password = ""; 10 | 11 | WiFiUDP ntpUDP; 12 | 13 | // You can specify the time server pool and the offset (in seconds, can be 14 | // changed later with setTimeOffset() ). Additionaly you can specify the 15 | // update interval (in milliseconds, can be changed using setUpdateInterval() ). 16 | NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000); 17 | 18 | void setup(){ 19 | Serial.begin(115200); 20 | 21 | WiFi.begin(ssid, password); 22 | 23 | while ( WiFi.status() != WL_CONNECTED ) { 24 | delay ( 500 ); 25 | Serial.print ( "." ); 26 | } 27 | 28 | timeClient.begin(); 29 | } 30 | 31 | void loop() { 32 | timeClient.update(); 33 | 34 | Serial.println(timeClient.getFormattedTime()); 35 | 36 | delay(1000); 37 | } 38 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/examples/Basic/Basic.ino: -------------------------------------------------------------------------------- 1 | #include 2 | // change next line to use with another board/shield 3 | #include 4 | //#include // for WiFi shield 5 | //#include // for WiFi 101 shield or MKR1000 6 | #include 7 | 8 | const char *ssid = ""; 9 | const char *password = ""; 10 | 11 | WiFiUDP ntpUDP; 12 | NTPClient timeClient(ntpUDP); 13 | 14 | void setup(){ 15 | Serial.begin(115200); 16 | 17 | WiFi.begin(ssid, password); 18 | 19 | while ( WiFi.status() != WL_CONNECTED ) { 20 | delay ( 500 ); 21 | Serial.print ( "." ); 22 | } 23 | 24 | timeClient.begin(); 25 | } 26 | 27 | void loop() { 28 | timeClient.update(); 29 | 30 | Serial.println(timeClient.getFormattedTime()); 31 | 32 | delay(1000); 33 | } 34 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Datatypes (KEYWORD1) 3 | ####################################### 4 | 5 | NTPClient KEYWORD1 6 | 7 | ####################################### 8 | # Methods and Functions (KEYWORD2) 9 | ####################################### 10 | 11 | begin KEYWORD2 12 | end KEYWORD2 13 | update KEYWORD2 14 | forceUpdate KEYWORD2 15 | getDay KEYWORD2 16 | getHours KEYWORD2 17 | getMinutes KEYWORD2 18 | getSeconds KEYWORD2 19 | getFormattedTime KEYWORD2 20 | getEpochTime KEYWORD2 21 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NTPClient", 3 | "keywords": "ntp, client, time", 4 | "description": "A NTPClient to connect to a time server", 5 | "authors": 6 | [ 7 | { 8 | "name": "Fabrice Weinberg", 9 | "email": "fabrice@weinberg.me" 10 | }, 11 | { 12 | "name": "Sandeep Mistry", 13 | "email": "s.mistry@arduino.cc" 14 | } 15 | ], 16 | "repository": 17 | { 18 | "type": "git", 19 | "url": "https://github.com/arduino-libraries/NTPClient.git" 20 | }, 21 | "version": "3.1.0", 22 | "frameworks": "arduino", 23 | "platforms": "espressif" 24 | } 25 | -------------------------------------------------------------------------------- /esp_sensor/libraries/NTPClient/library.properties: -------------------------------------------------------------------------------- 1 | name=NTPClient 2 | version=3.1.0 3 | author=Fabrice Weinberg 4 | maintainer=Fabrice Weinberg 5 | sentence=An NTPClient to connect to a time server 6 | paragraph=Get time from a NTP server and keep it in sync. 7 | category=Timing 8 | url=https://github.com/arduino-libraries/NTPClient 9 | architectures=* 10 | -------------------------------------------------------------------------------- /esp_sensor/libraries/OneWire/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For OneWire 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | OneWire KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | reset KEYWORD2 16 | write_bit KEYWORD2 17 | read_bit KEYWORD2 18 | write KEYWORD2 19 | write_bytes KEYWORD2 20 | read KEYWORD2 21 | read_bytes KEYWORD2 22 | select KEYWORD2 23 | skip KEYWORD2 24 | depower KEYWORD2 25 | reset_search KEYWORD2 26 | search KEYWORD2 27 | crc8 KEYWORD2 28 | crc16 KEYWORD2 29 | check_crc16 KEYWORD2 30 | 31 | ####################################### 32 | # Instances (KEYWORD2) 33 | ####################################### 34 | 35 | 36 | ####################################### 37 | # Constants (LITERAL1) 38 | ####################################### 39 | -------------------------------------------------------------------------------- /esp_sensor/libraries/OneWire/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OneWire", 3 | "frameworks": "Arduino", 4 | "keywords": "onewire, 1-wire, bus, sensor, temperature, ibutton", 5 | "description": "Control 1-Wire protocol (DS18S20, DS18B20, DS2408 and etc)", 6 | "authors": 7 | [ 8 | { 9 | "name": "Paul Stoffregen", 10 | "email": "paul@pjrc.com", 11 | "url": "http://www.pjrc.com", 12 | "maintainer": true 13 | }, 14 | { 15 | "name": "Jim Studt" 16 | }, 17 | { 18 | "name": "Tom Pollard", 19 | "email": "pollard@alum.mit.edu" 20 | }, 21 | { 22 | "name": "Derek Yerger" 23 | }, 24 | { 25 | "name": "Josh Larios" 26 | }, 27 | { 28 | "name": "Robin James" 29 | }, 30 | { 31 | "name": "Glenn Trewitt" 32 | }, 33 | { 34 | "name": "Jason Dangel", 35 | "email": "dangel.jason AT gmail.com" 36 | }, 37 | { 38 | "name": "Guillermo Lovato" 39 | }, 40 | { 41 | "name": "Ken Butcher" 42 | }, 43 | { 44 | "name": "Mark Tillotson" 45 | }, 46 | { 47 | "name": "Bertrik Sikken" 48 | }, 49 | { 50 | "name": "Scott Roberts" 51 | } 52 | ], 53 | "repository": 54 | { 55 | "type": "git", 56 | "url": "https://github.com/PaulStoffregen/OneWire" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /esp_sensor/libraries/OneWire/library.properties: -------------------------------------------------------------------------------- 1 | name=OneWire 2 | version=2.3.2 3 | author=Jim Studt, Tom Pollard, Robin James, Glenn Trewitt, Jason Dangel, Guillermo Lovato, Paul Stoffregen, Scott Roberts, Bertrik Sikken, Mark Tillotson, Ken Butcher, Roger Clark, Love Nystrom 4 | maintainer=Paul Stoffregen 5 | sentence=Access 1-wire temperature sensors, memory and other chips. 6 | paragraph= 7 | category=Communication 8 | url=http://www.pjrc.com/teensy/td_libs_OneWire.html 9 | architectures=* 10 | 11 | -------------------------------------------------------------------------------- /esp_sensor/libraries/PZEM004T/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | -------------------------------------------------------------------------------- /esp_sensor/libraries/PZEM004T/PZEM004T.h: -------------------------------------------------------------------------------- 1 | #ifndef PZEM004T_H 2 | #define PZEM004T_H 3 | 4 | #if defined(ARDUINO) && ARDUINO >= 100 5 | #include "Arduino.h" 6 | #else 7 | #include "WProgram.h" 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | struct PZEMCommand { 14 | uint8_t command; 15 | uint8_t addr[4]; 16 | uint8_t data; 17 | uint8_t crc; 18 | }; 19 | 20 | class PZEM004T 21 | { 22 | public: 23 | PZEM004T(uint8_t receivePin, uint8_t transmitPin); 24 | PZEM004T(HardwareSerial *port); 25 | ~PZEM004T(); 26 | 27 | void setReadTimeout(unsigned long msec); 28 | unsigned long readTimeout() {return _readTimeOut;} 29 | 30 | float voltage(const IPAddress &addr); 31 | float current(const IPAddress &addr); 32 | float power(const IPAddress &addr); 33 | float energy(const IPAddress &addr); 34 | 35 | bool setAddress(const IPAddress &newAddr); 36 | bool setPowerAlarm(const IPAddress &addr, uint8_t threshold); 37 | 38 | private: 39 | Stream *serial; 40 | 41 | unsigned long _readTimeOut; 42 | bool _isSoft; 43 | 44 | void send(const IPAddress &addr, uint8_t cmd, uint8_t data = 0); 45 | bool recieve(uint8_t resp, uint8_t *data = 0); 46 | 47 | uint8_t crc(uint8_t *data, uint8_t sz); 48 | }; 49 | 50 | #endif // PZEM004T_H 51 | -------------------------------------------------------------------------------- /esp_sensor/libraries/PZEM004T/examples/PZEMDisplay/PZEMDisplay.ino: -------------------------------------------------------------------------------- 1 | #include // Arduino IDE <1.6.6 2 | #include 3 | 4 | PZEM004T pzem(10,11); // RX,TX 5 | IPAddress ip(192,168,1,1); 6 | 7 | void setup() { 8 | Serial.begin(9600); 9 | pzem.setAddress(ip); 10 | } 11 | 12 | void loop() { 13 | float v = pzem.voltage(ip); 14 | if (v < 0.0) v = 0.0; 15 | Serial.print(v);Serial.print("V; "); 16 | 17 | float i = pzem.current(ip); 18 | if(i >= 0.0){ Serial.print(i);Serial.print("A; "); } 19 | 20 | float p = pzem.power(ip); 21 | if(p >= 0.0){ Serial.print(p);Serial.print("W; "); } 22 | 23 | float e = pzem.energy(ip); 24 | if(e >= 0.0){ Serial.print(e);Serial.print("Wh; "); } 25 | 26 | Serial.println(); 27 | 28 | // delay(1000); 29 | } 30 | -------------------------------------------------------------------------------- /esp_sensor/libraries/PZEM004T/examples/PZEMHardSerial/PZEMHardSerial.ino: -------------------------------------------------------------------------------- 1 | #include // Arduino IDE <1.6.6 2 | #include 3 | 4 | PZEM004T pzem(&Serial1); 5 | IPAddress ip(192,168,1,1); 6 | 7 | void setup() { 8 | Serial.begin(9600); 9 | pzem.setAddress(ip); 10 | } 11 | 12 | void loop() { 13 | float v = pzem.voltage(ip); 14 | if (v < 0.0) v = 0.0; 15 | Serial.print(v);Serial.print("V; "); 16 | 17 | float i = pzem.current(ip); 18 | if(i >= 0.0){ Serial.print(i);Serial.print("A; "); } 19 | 20 | float p = pzem.power(ip); 21 | if(p >= 0.0){ Serial.print(p);Serial.print("W; "); } 22 | 23 | float e = pzem.energy(ip); 24 | if(e >= 0.0){ Serial.print(e);Serial.print("Wh; "); } 25 | 26 | Serial.println(); 27 | 28 | // delay(1000); 29 | } 30 | -------------------------------------------------------------------------------- /esp_sensor/libraries/PZEM004T/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Datatypes (KEYWORD1) 3 | ####################################### 4 | 5 | PZEM004T KEYWORD1 6 | 7 | ####################################### 8 | # Methods and Functions (KEYWORD2) 9 | ####################################### 10 | 11 | voltage KEYWORD2 12 | current KEYWORD2 13 | power KEYWORD2 14 | energy KEYWORD2 15 | setAddress KEYWORD2 16 | setPowerAlarm KEYWORD2 17 | 18 | ####################################### 19 | # Constants (LITERAL1) 20 | ####################################### 21 | 22 | -------------------------------------------------------------------------------- /esp_sensor/libraries/PZEM004T/library.properties: -------------------------------------------------------------------------------- 1 | name=PZEM004T 2 | version=1.0 3 | author=Oleg Sokolov 4 | maintainer= 5 | sentence=Enables communication Peacefair PZEM-004T Energy monitor 6 | paragraph=Enables communication Peacefair PZEM-004T Energy monitor 7 | category=Sensors 8 | url=https://github.com/olehs/PZEM004T 9 | architectures=* 10 | 11 | -------------------------------------------------------------------------------- /esp_sensor/libraries/SimpleTimer/README.md: -------------------------------------------------------------------------------- 1 | # SimpleTimer for Arduino 2 | 3 | This is a fork of the SimpleTimer library from Marcello Romani (http://playground.arduino.cc/Code/SimpleTimer). Sadly there is no original repository to apply pull requests. 4 | 5 | ## Additional Features 6 | 7 | * Support lambda-expressions / std::function callbacks 8 | -------------------------------------------------------------------------------- /esp_sensor/libraries/SparkFun_BME280/examples/I2C_DeltaAltitude/CircularBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef CIRCULARBUFFER_H 2 | #define CIRCULARBUFFER_H 3 | #include 4 | 5 | //****************************************************************************// 6 | // 7 | // Circular Buffer 8 | // 9 | //****************************************************************************// 10 | 11 | //Class CircularBuffer is int16_t 12 | //Does not care about over-running real data ( if request is outside length's bounds ). 13 | //For example, the underlying machine writes [48], [49], [0], [1] ... 14 | 15 | class CircularBuffer 16 | { 17 | public: 18 | CircularBuffer( uint16_t inputSize ); 19 | ~CircularBuffer(); 20 | float getElement( uint16_t ); //zero is the push location 21 | void pushElement( float ); 22 | float averageLast( uint16_t ); 23 | uint16_t recordLength( void ); 24 | private: 25 | uint16_t cBufferSize; 26 | float *cBufferData; 27 | int16_t cBufferLastPtr; 28 | uint8_t cBufferElementsUsed; 29 | }; 30 | 31 | 32 | 33 | #endif // CIRCULARBUFFER_H -------------------------------------------------------------------------------- /esp_sensor/libraries/SparkFun_BME280/examples/SketchesWithLCD/LCD_DeltaAltitude/CircularBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef CIRCULARBUFFER_H 2 | #define CIRCULARBUFFER_H 3 | #include 4 | 5 | //****************************************************************************// 6 | // 7 | // Circular Buffer 8 | // 9 | //****************************************************************************// 10 | 11 | //Class CircularBuffer is int16_t 12 | //Does not care about over-running real data ( if request is outside length's bounds ). 13 | //For example, the underlying machine writes [48], [49], [0], [1] ... 14 | 15 | class CircularBuffer 16 | { 17 | public: 18 | CircularBuffer( uint16_t inputSize ); 19 | ~CircularBuffer(); 20 | float getElement( uint16_t ); //zero is the push location 21 | void pushElement( float ); 22 | float averageLast( uint16_t ); 23 | uint16_t recordLength( void ); 24 | private: 25 | uint16_t cBufferSize; 26 | float *cBufferData; 27 | int16_t cBufferLastPtr; 28 | uint8_t cBufferElementsUsed; 29 | }; 30 | 31 | 32 | 33 | #endif // CIRCULARBUFFER_H -------------------------------------------------------------------------------- /esp_sensor/libraries/SparkFun_BME280/library.properties: -------------------------------------------------------------------------------- 1 | name=SparkFun BME280 2 | version=1.0.0 3 | author=Marshall Taylor 4 | maintainer=SparkFun Electronics 5 | sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor 6 | paragraph=See code for comments. 7 | category=Sensors 8 | url=https://github.com/sparkfun/SparkFun_BME280_Arduino_Library 9 | architectures=* -------------------------------------------------------------------------------- /esp_sensor/libraries/SparkFun_BME280/readme_picture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/esp_sensor/libraries/SparkFun_BME280/readme_picture.jpg -------------------------------------------------------------------------------- /screenshots/Apins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/Apins.png -------------------------------------------------------------------------------- /screenshots/HC-SR501.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/HC-SR501.jpg -------------------------------------------------------------------------------- /screenshots/MP1584EN.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/MP1584EN.jpg -------------------------------------------------------------------------------- /screenshots/OpenHab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/OpenHab.png -------------------------------------------------------------------------------- /screenshots/OpenHab_ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/OpenHab_ext.png -------------------------------------------------------------------------------- /screenshots/OpenHab_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/OpenHab_graph.png -------------------------------------------------------------------------------- /screenshots/PCB_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/PCB_bottom.png -------------------------------------------------------------------------------- /screenshots/PCB_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/PCB_top.png -------------------------------------------------------------------------------- /screenshots/PZEM/CuteCom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/PZEM/CuteCom.png -------------------------------------------------------------------------------- /screenshots/PZEM/OpenHab_energy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/PZEM/OpenHab_energy.png -------------------------------------------------------------------------------- /screenshots/PZEM/OpenHab_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/PZEM/OpenHab_home.png -------------------------------------------------------------------------------- /screenshots/PZEM/pzem_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/PZEM/pzem_status.png -------------------------------------------------------------------------------- /screenshots/PZEM/test_sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/PZEM/test_sample.jpg -------------------------------------------------------------------------------- /screenshots/Schema_LED.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/Schema_LED.png -------------------------------------------------------------------------------- /screenshots/Schema_SSR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/Schema_SSR.png -------------------------------------------------------------------------------- /screenshots/arduino-ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/arduino-ide.png -------------------------------------------------------------------------------- /screenshots/board1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/board1.jpg -------------------------------------------------------------------------------- /screenshots/board2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/board2.jpg -------------------------------------------------------------------------------- /screenshots/board3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/board3.jpg -------------------------------------------------------------------------------- /screenshots/syslog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/syslog.png -------------------------------------------------------------------------------- /screenshots/thumbs/PCB_bottom_th.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/thumbs/PCB_bottom_th.png -------------------------------------------------------------------------------- /screenshots/thumbs/PCB_top_th.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/thumbs/PCB_top_th.png -------------------------------------------------------------------------------- /screenshots/thumbs/arduino-ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/thumbs/arduino-ide.png -------------------------------------------------------------------------------- /screenshots/web/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/console.png -------------------------------------------------------------------------------- /screenshots/web/control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/control.png -------------------------------------------------------------------------------- /screenshots/web/esp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/esp.png -------------------------------------------------------------------------------- /screenshots/web/logConf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/logConf.png -------------------------------------------------------------------------------- /screenshots/web/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/menu.png -------------------------------------------------------------------------------- /screenshots/web/mqtt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/mqtt.png -------------------------------------------------------------------------------- /screenshots/web/ntp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/ntp.png -------------------------------------------------------------------------------- /screenshots/web/sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/sensors.png -------------------------------------------------------------------------------- /screenshots/web/status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/status.png -------------------------------------------------------------------------------- /screenshots/web/statusDS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/statusDS.png -------------------------------------------------------------------------------- /screenshots/web/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/update.png -------------------------------------------------------------------------------- /screenshots/web/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kmaximv/Wi-Fi-Sensor/cc6ab1a56dc0f4a46374258a804f6e8f132c158b/screenshots/web/wifi.png --------------------------------------------------------------------------------