├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── MakeFile ├── README.md ├── bin ├── firmware_1.0.16.bin └── spiffs_1.0.16.bin ├── data ├── config │ ├── activeStatus.json │ ├── apSettings.json │ ├── boilSettings.json │ ├── brewSettings.json │ ├── mashSettings.json │ ├── ntpSettings.json │ ├── otaSettings.json │ └── wifiSettings.json └── www │ ├── app │ ├── icon.png │ ├── logo.png │ └── manifest.json │ ├── css │ ├── 2.0af1.c.css │ └── roboto.css │ ├── favicon.ico │ ├── fonts │ ├── ro-li.w2 │ ├── ro-me.w2 │ └── ro-re.w2 │ ├── index.html │ └── js │ ├── 0.20a3.js.gz │ ├── 1.b351.js.gz │ └── 2.60b4.js.gz ├── interface ├── .env.development ├── .env.production ├── build │ ├── app │ │ ├── icon.png │ │ └── manifest.json │ ├── css │ │ └── roboto.css │ ├── favicon.ico │ ├── fonts │ │ ├── ro-li.w2 │ │ ├── ro-me.w2 │ │ └── ro-re.w2 │ └── index.html ├── config-overrides.js ├── package-lock.json ├── package.json ├── public │ ├── app │ │ ├── icon.png │ │ ├── logo.png │ │ └── manifest.json │ ├── css │ │ └── roboto.css │ ├── favicon.ico │ ├── fonts │ │ ├── ro-li.w2 │ │ ├── ro-me.w2 │ │ └── ro-re.w2 │ └── index.html └── src │ ├── App.js │ ├── AppRouting.js │ ├── components │ ├── BrewStatusGadget.js │ ├── Chronometer.js │ ├── ConfirmDialog.js │ ├── IntText.js │ ├── MenuAppBar.js │ ├── PasswordValidator.js │ ├── RestComponent.js │ ├── SectionContent.js │ ├── SnackbarNotification.js │ ├── SortableList.js │ ├── Tracking.js │ └── Utils.js │ ├── constants │ ├── Endpoints.js │ ├── Highlight.js │ ├── NTPStatus.js │ ├── TimeFormat.js │ ├── WiFiAPModes.js │ ├── WiFiConnectionStatus.js │ └── WiFiSecurityModes.js │ ├── containers │ ├── APConfiguration.js │ ├── APSettings.js │ ├── APStatus.js │ ├── About.js │ ├── AboutContainer.js │ ├── BoilSettings.js │ ├── Brew.js │ ├── BrewConfiguration.js │ ├── BrewDayConfiguration.js │ ├── BrewSettings.js │ ├── MashSettings.js │ ├── NTPConfiguration.js │ ├── NTPSettings.js │ ├── NTPStatus.js │ ├── OTAConfiguration.js │ ├── OTASettings.js │ ├── WiFiConfiguration.js │ ├── WiFiNetworkScanner.js │ ├── WiFiSettings.js │ └── WiFiStatus.js │ ├── forms │ ├── APSettingsForm.js │ ├── BrewSettingsForm.js │ ├── MashBoilSettingsForm.js │ ├── NTPSettingsForm.js │ ├── OTASettingsForm.js │ ├── WiFiNetworkSelector.js │ └── WiFiSettingsForm.js │ ├── history.js │ ├── index.js │ ├── language │ ├── de-DE.json │ ├── en.json │ ├── es-ES.json │ ├── he-IL.json │ ├── pt-BR.json │ └── ru-RU.json │ ├── style │ └── BrewStyle.js │ └── validators │ ├── isHostname.js │ ├── isIP.js │ ├── optional.js │ └── or.js ├── lib ├── ArduinoJson_ID64 │ ├── .clang-format │ ├── .gitattributes │ ├── .github │ │ └── ISSUE_TEMPLATE.md │ ├── .gitignore │ ├── .library.json │ ├── .mbedignore │ ├── .travis.yml │ ├── ArduinoJson.h │ ├── CHANGELOG.md │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── LICENSE.md │ ├── README.md │ ├── SUPPORT.md │ ├── appveyor.yml │ ├── banner.svg │ ├── examples │ │ ├── JsonConfigFile │ │ │ └── JsonConfigFile.ino │ │ ├── JsonGeneratorExample │ │ │ └── JsonGeneratorExample.ino │ │ ├── JsonHttpClient │ │ │ └── JsonHttpClient.ino │ │ ├── JsonParserExample │ │ │ └── JsonParserExample.ino │ │ ├── JsonServer │ │ │ └── JsonServer.ino │ │ ├── JsonUdpBeacon │ │ │ └── JsonUdpBeacon.ino │ │ ├── MsgPackParser │ │ │ └── MsgPackParser.ino │ │ ├── ProgmemExample │ │ │ └── ProgmemExample.ino │ │ └── StringExample │ │ │ └── StringExample.ino │ ├── keywords.txt │ ├── library.json │ ├── library.properties │ └── src │ │ ├── ArduinoJson.h │ │ ├── ArduinoJson.hpp │ │ └── ArduinoJson │ │ ├── Array │ │ ├── ArrayFunctions.hpp │ │ ├── ArrayImpl.hpp │ │ ├── ArrayIterator.hpp │ │ ├── ArrayRef.hpp │ │ ├── ArrayShortcuts.hpp │ │ ├── ElementProxy.hpp │ │ └── Utilities.hpp │ │ ├── Collection │ │ ├── CollectionData.hpp │ │ └── CollectionImpl.hpp │ │ ├── Configuration.hpp │ │ ├── Deserialization │ │ ├── ArduinoStreamReader.hpp │ │ ├── CharPointerReader.hpp │ │ ├── DeserializationError.hpp │ │ ├── FlashStringReader.hpp │ │ ├── IteratorReader.hpp │ │ ├── NestingLimit.hpp │ │ ├── StdStreamReader.hpp │ │ └── deserialize.hpp │ │ ├── Document │ │ ├── BasicJsonDocument.hpp │ │ ├── DynamicJsonDocument.hpp │ │ ├── JsonDocument.hpp │ │ └── StaticJsonDocument.hpp │ │ ├── Json │ │ ├── EscapeSequence.hpp │ │ ├── JsonDeserializer.hpp │ │ ├── JsonSerializer.hpp │ │ ├── PrettyJsonSerializer.hpp │ │ ├── TextFormatter.hpp │ │ └── Utf8.hpp │ │ ├── Memory │ │ ├── Alignment.hpp │ │ ├── MemoryPool.hpp │ │ ├── StringBuilder.hpp │ │ └── StringSlot.hpp │ │ ├── Misc │ │ ├── SerializedValue.hpp │ │ └── Visitable.hpp │ │ ├── MsgPack │ │ ├── MsgPackDeserializer.hpp │ │ ├── MsgPackSerializer.hpp │ │ ├── endianess.hpp │ │ └── ieee754.hpp │ │ ├── Namespace.hpp │ │ ├── Numbers │ │ ├── Float.hpp │ │ ├── FloatParts.hpp │ │ ├── FloatTraits.hpp │ │ ├── Integer.hpp │ │ ├── convertNumber.hpp │ │ ├── parseFloat.hpp │ │ ├── parseInteger.hpp │ │ └── parseNumber.hpp │ │ ├── Object │ │ ├── MemberProxy.hpp │ │ ├── ObjectFunctions.hpp │ │ ├── ObjectImpl.hpp │ │ ├── ObjectIterator.hpp │ │ ├── ObjectRef.hpp │ │ ├── ObjectShortcuts.hpp │ │ └── Pair.hpp │ │ ├── Operators │ │ ├── VariantCasts.hpp │ │ ├── VariantComparisons.hpp │ │ ├── VariantOperators.hpp │ │ ├── VariantOr.hpp │ │ └── VariantShortcuts.hpp │ │ ├── Polyfills │ │ ├── alias_cast.hpp │ │ ├── assert.hpp │ │ ├── attributes.hpp │ │ ├── ctype.hpp │ │ ├── gsl │ │ │ └── not_null.hpp │ │ ├── limits.hpp │ │ ├── math.hpp │ │ ├── mpl │ │ │ └── max.hpp │ │ ├── safe_strcmp.hpp │ │ ├── type_traits.hpp │ │ ├── type_traits │ │ │ ├── conditional.hpp │ │ │ ├── enable_if.hpp │ │ │ ├── integral_constant.hpp │ │ │ ├── is_array.hpp │ │ │ ├── is_base_of.hpp │ │ │ ├── is_const.hpp │ │ │ ├── is_floating_point.hpp │ │ │ ├── is_integral.hpp │ │ │ ├── is_same.hpp │ │ │ ├── is_signed.hpp │ │ │ ├── is_unsigned.hpp │ │ │ ├── make_unsigned.hpp │ │ │ ├── remove_const.hpp │ │ │ ├── remove_reference.hpp │ │ │ └── type_identity.hpp │ │ └── utility.hpp │ │ ├── Serialization │ │ ├── DummyWriter.hpp │ │ ├── DynamicStringWriter.hpp │ │ ├── StaticStringWriter.hpp │ │ ├── StreamWriter.hpp │ │ ├── measure.hpp │ │ └── serialize.hpp │ │ ├── StringStorage │ │ ├── StringCopier.hpp │ │ ├── StringMover.hpp │ │ └── StringStorage.hpp │ │ ├── Strings │ │ ├── ArduinoStringAdapter.hpp │ │ ├── ConstRamStringAdapter.hpp │ │ ├── FlashStringAdapter.hpp │ │ ├── RamStringAdapter.hpp │ │ ├── SizedFlashStringAdapter.hpp │ │ ├── SizedRamStringAdapter.hpp │ │ ├── StlStringAdapter.hpp │ │ ├── String.hpp │ │ └── StringAdapters.hpp │ │ ├── Variant │ │ ├── SlotFunctions.hpp │ │ ├── VariantAs.hpp │ │ ├── VariantAsImpl.hpp │ │ ├── VariantContent.hpp │ │ ├── VariantData.hpp │ │ ├── VariantFunctions.hpp │ │ ├── VariantImpl.hpp │ │ ├── VariantRef.hpp │ │ ├── VariantSlot.hpp │ │ └── VariantTo.hpp │ │ ├── compatibility.hpp │ │ └── version.hpp ├── AsyncTCP_ID1826 │ ├── .library.json │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── component.mk │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── AsyncTCP.cpp │ │ └── AsyncTCP.h │ └── travis │ │ └── common.sh ├── DallasTemp │ ├── .gitignore │ ├── DallasTemperature.cpp │ ├── DallasTemperature.h │ ├── README.md │ ├── examples │ │ ├── Alarm │ │ │ └── Alarm.pde │ │ ├── AlarmHandler │ │ │ └── AlarmHandler.pde │ │ ├── Multibus_simple │ │ │ └── Multibus_simple.ino │ │ ├── Multiple │ │ │ └── Multiple.pde │ │ ├── SetUserData │ │ │ └── SetUserData.ino │ │ ├── Simple │ │ │ └── Simple.pde │ │ ├── Single │ │ │ └── Single.pde │ │ ├── Tester │ │ │ └── Tester.pde │ │ ├── TwoPin_DS18B20 │ │ │ └── TwoPin_DS18B20.ino │ │ ├── UserDataDemo │ │ │ └── UserDataDemo.ino │ │ ├── UserDataWriteBatch │ │ │ └── UserDataWriteBatch.ino │ │ ├── WaitForConversion │ │ │ └── WaitForConversion.pde │ │ ├── WaitForConversion2 │ │ │ └── WaitForConversion2.pde │ │ └── oneWireSearch │ │ │ └── oneWireSearch.ino │ ├── keywords.txt │ ├── library.json │ └── library.properties ├── ESP Async WebServer_ID306 │ ├── .library.json │ ├── .travis.yml │ ├── README.md │ ├── component.mk │ ├── examples │ │ ├── ESP_AsyncFSBrowser │ │ │ ├── .esp31b.skip │ │ │ ├── ESP_AsyncFSBrowser.ino │ │ │ └── data │ │ │ │ ├── .exclude.files │ │ │ │ ├── ace.js.gz │ │ │ │ ├── ext-searchbox.js.gz │ │ │ │ ├── favicon.ico │ │ │ │ ├── index.htm │ │ │ │ ├── mode-css.js.gz │ │ │ │ ├── mode-html.js.gz │ │ │ │ ├── mode-javascript.js.gz │ │ │ │ └── worker-html.js.gz │ │ └── simple_server │ │ │ └── simple_server.ino │ ├── keywords.txt │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── AsyncEventSource.cpp │ │ ├── AsyncEventSource.h │ │ ├── AsyncJson.h │ │ ├── AsyncWebSocket.cpp │ │ ├── AsyncWebSocket.h │ │ ├── ESPAsyncWebServer.h │ │ ├── SPIFFSEditor.cpp │ │ ├── SPIFFSEditor.h │ │ ├── StringArray.h │ │ ├── WebAuthentication.cpp │ │ ├── WebAuthentication.h │ │ ├── WebHandlerImpl.h │ │ ├── WebHandlers.cpp │ │ ├── WebRequest.cpp │ │ ├── WebResponseImpl.h │ │ ├── WebResponses.cpp │ │ ├── WebServer.cpp │ │ └── edit.htm │ └── travis │ │ └── common.sh ├── ESPAsyncTCP_ID305 │ ├── .gitignore │ ├── .library.json │ ├── .travis.yml │ ├── LICENSE.txt │ ├── README.md │ ├── examples │ │ ├── ClientServer │ │ │ ├── Client │ │ │ │ ├── Client.ino │ │ │ │ └── config.h │ │ │ └── Server │ │ │ │ ├── Server.ino │ │ │ │ └── config.h │ │ └── SyncClient │ │ │ ├── .esp31b.skip │ │ │ └── SyncClient.ino │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── AsyncPrinter.cpp │ │ ├── AsyncPrinter.h │ │ ├── ESPAsyncTCP.cpp │ │ ├── ESPAsyncTCP.h │ │ ├── ESPAsyncTCPbuffer.cpp │ │ ├── ESPAsyncTCPbuffer.h │ │ ├── SyncClient.cpp │ │ ├── SyncClient.h │ │ ├── async_config.h │ │ ├── tcp_axtls.c │ │ └── tcp_axtls.h │ ├── ssl │ │ ├── gen_server_cert.sh │ │ ├── server.cer │ │ └── server.key │ └── travis │ │ └── common.sh ├── LiquidCrystal_I2C_ID576 │ ├── .library.json │ ├── LiquidCrystal_I2C.cpp │ ├── LiquidCrystal_I2C.h │ ├── README.md │ ├── examples │ │ ├── CustomChars │ │ │ └── CustomChars.pde │ │ ├── HelloWorld │ │ │ └── HelloWorld.pde │ │ └── SerialDisplay │ │ │ └── SerialDisplay.pde │ ├── keywords.txt │ ├── library.json │ └── library.properties ├── NtpClientLib_ID727 │ ├── .gitattributes │ ├── .gitignore │ ├── .library.json │ ├── Diagrama de estados.graphml │ ├── LICENSE.md │ ├── README.md │ ├── examples │ │ ├── NTPClientAvr │ │ │ └── NTPClientAvr.ino │ │ ├── NTPClientBasic │ │ │ └── NTPClientBasic.ino │ │ ├── NTPClientESP32 │ │ │ └── NTPClientESP32.ino │ │ ├── NTPClientESP8266 │ │ │ └── NTPClientESP8266.ino │ │ └── NTPClientMKR1000 │ │ │ └── NTPClientMKR1000.ino │ ├── library.json │ ├── library.properties │ └── src │ │ ├── NTPClientLib.cpp │ │ └── NtpClientLib.h ├── OneWire │ ├── OneWire.cpp │ ├── OneWire.h │ ├── docs │ │ └── issue_template.md │ ├── examples │ │ ├── DS18x20_Temperature │ │ │ └── DS18x20_Temperature.pde │ │ ├── DS2408_Switch │ │ │ └── DS2408_Switch.pde │ │ └── DS250x_PROM │ │ │ └── DS250x_PROM.pde │ ├── keywords.txt │ ├── library.json │ ├── library.properties │ └── util │ │ ├── OneWire_direct_gpio.h │ │ └── OneWire_direct_regtype.h ├── OneWire_ID1 │ ├── .library.json │ ├── 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 │ └── util │ │ ├── OneWire_direct_gpio.h │ │ └── OneWire_direct_regtype.h ├── PCF8574_ESP-master │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── pcf8574_arduinomicro │ │ │ └── pcf8574_arduinomicro.ino │ │ ├── pcf8574_attiny85_digispark │ │ │ └── pcf8574_attiny85_digispark.ino │ │ ├── pcf8574_esp8266 │ │ │ └── pcf8574_esp8266.ino │ │ └── pcf8574_stm32f1 │ │ │ └── pcf8574_stm32f1.ino │ ├── keywords.txt │ ├── library.properties │ ├── pcf8574_esp.cpp │ └── pcf8574_esp.h ├── PID_AutoTune_v0 │ ├── Examples │ │ └── AutoTune_Example │ │ │ └── AutoTune_Example.pde │ ├── PID_AutoTune_v0.cpp │ └── PID_AutoTune_v0.h ├── PID_Lib │ ├── PID_v1.cpp │ ├── PID_v1.h │ ├── README.txt │ ├── examples │ │ ├── PID_AdaptiveTunings │ │ │ └── PID_AdaptiveTunings.ino │ │ ├── PID_Basic │ │ │ └── PID_Basic.ino │ │ ├── PID_PonM │ │ │ └── PID_PonM.ino │ │ └── PID_RelayOutput │ │ │ └── PID_RelayOutput.ino │ ├── keywords.txt │ ├── library.json │ └── library.properties ├── Timer │ ├── DateStrings.cpp │ ├── Readme.md │ ├── Time.cpp │ ├── TimeLib.h │ ├── docs │ │ └── issue_template.md │ ├── examples │ │ ├── Processing │ │ │ └── SyncArduinoClock │ │ │ │ ├── SyncArduinoClock.pde │ │ │ │ └── readme.txt │ │ ├── TimeArduinoDue │ │ │ └── TimeArduinoDue.ino │ │ ├── TimeGPS │ │ │ └── TimeGPS.ino │ │ ├── TimeNTP │ │ │ └── TimeNTP.ino │ │ ├── TimeNTP_ENC28J60 │ │ │ └── TimeNTP_ENC28J60.ino │ │ ├── TimeNTP_ESP8266WiFi │ │ │ └── TimeNTP_ESP8266WiFi.ino │ │ ├── TimeRTC │ │ │ └── TimeRTC.ino │ │ ├── TimeRTCLog │ │ │ └── TimeRTCLog.ino │ │ ├── TimeRTCSet │ │ │ └── TimeRTCSet.ino │ │ ├── TimeSerial │ │ │ └── TimeSerial.ino │ │ ├── TimeSerialDateStrings │ │ │ └── TimeSerialDateStrings.ino │ │ └── TimeTeensy3 │ │ │ └── TimeTeensy3.ino │ ├── keywords.txt │ ├── library.json │ └── library.properties └── esp8266-react │ ├── APSettingsService.cpp │ ├── APSettingsService.h │ ├── APStatus.cpp │ ├── APStatus.h │ ├── ArduinoJsonJWT.cpp │ ├── ArduinoJsonJWT.h │ ├── AsyncArduinoJson6.h │ ├── AsyncJsonRequestWebHandler.h │ ├── AsyncJsonWebHandler.h │ ├── AuthenticationService.cpp │ ├── AuthenticationService.h │ ├── NTPStatus.cpp │ ├── NTPStatus.h │ ├── OTASettingsService.cpp │ ├── OTASettingsService.h │ ├── SecurityManager.cpp │ ├── SecurityManager.h │ ├── SecuritySettingsService.cpp │ ├── SecuritySettingsService.h │ ├── SettingsPersistence.h │ ├── SettingsService.h │ ├── SimpleService.h │ ├── SystemStatus.cpp │ ├── SystemStatus.h │ ├── WiFiScanner.cpp │ ├── WiFiScanner.h │ ├── WiFiSettingsService.cpp │ ├── WiFiSettingsService.h │ ├── WiFiStatus.cpp │ └── WiFiStatus.h ├── pio_upload.py ├── platformio.ini ├── set_version.py ├── src ├── ActiveStatus.cpp ├── ActiveStatus.h ├── BoilKettleHeaterService.cpp ├── BoilKettleHeaterService.h ├── BoilService.cpp ├── BoilService.h ├── BoilSettingsService.cpp ├── BoilSettingsService.h ├── BrewListService.h ├── BrewService.cpp ├── BrewService.h ├── BrewSettingsService.cpp ├── BrewSettingsService.h ├── Buzzer.cpp ├── Buzzer.h ├── HeaterService.h ├── KeyButton.h ├── Keyboard.cpp ├── Keyboard.h ├── Lcd.cpp ├── Lcd.h ├── MashKettleHeaterService.cpp ├── MashKettleHeaterService.h ├── MashService.cpp ├── MashService.h ├── MashSettingsService.cpp ├── MashSettingsService.h ├── NTPSettingsService.cpp ├── NTPSettingsService.h ├── Pump.cpp ├── Pump.h ├── SpargeKettleHeaterService.cpp ├── SpargeKettleHeaterService.h ├── TemperatureService.cpp ├── TemperatureService.h ├── enum.h └── main.cpp └── timelib_fix.py /.gitignore: -------------------------------------------------------------------------------- 1 | .pioenvs 2 | .piolibdeps 3 | platformio.ini 4 | .clang_complete 5 | .gcc-flags.json 6 | *Thumbs.db 7 | /interface/build 8 | /interface/node_modules 9 | .vscode 10 | .pio 11 | .vscode/ipch/ 12 | .vscode/.browse.c_cpp.db* 13 | .vscode/c_cpp_properties.json 14 | .vscode/launch.json 15 | node_modules/ 16 | data/config/wifiSettings.json 17 | interface/.env.development 18 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2019 Bruno Leitão 2 | All rights reserved. 3 | This project is free to use. It's permitted to modify for personal use. 4 | It's not permitted to distribute the modified project. Modification can be 5 | distributed via the official BrewUNO release only. It's not permitted to distribute 6 | in a commercial way without permission. 7 | 8 | THE PROJECT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 9 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 11 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 12 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 13 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 14 | PROJECT OR THE USE OR OTHER DEALINGS IN THE PROJECT. 15 | -------------------------------------------------------------------------------- /MakeFile: -------------------------------------------------------------------------------- 1 | .PHONY : push build pull push release setversion 2 | 3 | build: | pull 4 | platformio run 5 | cd interface;npm install;npm run build 6 | platformio run -v -t buildfs 7 | 8 | uploadfs: 9 | platformio run -t uploadfs 10 | 11 | uploadfw: 12 | platformio run -t upload 13 | 14 | monitor: 15 | platformio device monitor 16 | 17 | upload: | build 18 | platformio run -t uploadfs 19 | platformio run -t upload 20 | 21 | publish: 22 | rm -rf bin/ 23 | mkdir bin/ 24 | cp .pio/build/esp12e/firmware.bin bin/firmware_$(version).bin 25 | cp .pio/build/esp12e/spiffs.bin bin/spiffs_$(version).bin 26 | 27 | pull: 28 | git pull 29 | 30 | push: 31 | git add . 32 | git commit -am '$(message)' 33 | git push 34 | 35 | setversion: 36 | python set_version.py $(version) 37 | 38 | release: | build publish setversion push -------------------------------------------------------------------------------- /bin/firmware_1.0.16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/bin/firmware_1.0.16.bin -------------------------------------------------------------------------------- /bin/spiffs_1.0.16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/bin/spiffs_1.0.16.bin -------------------------------------------------------------------------------- /data/config/activeStatus.json: -------------------------------------------------------------------------------- 1 | { 2 | "active_step": 0, 3 | "active_mash_step_index": -1, 4 | "active_boil_step_index": "", 5 | "boil_time": 0, 6 | "boil_target_temperature": 0, 7 | "start_time": 0, 8 | "end_time": 0, 9 | "time_now": 0, 10 | "target_temperature": 0, 11 | "brew_started": false, 12 | "recirculation": false, 13 | "boil_power_percentage": 0 14 | } -------------------------------------------------------------------------------- /data/config/apSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "provision_mode": 1, 3 | "ssid": "BrewUNO", 4 | "password": "brew-uno" 5 | } 6 | -------------------------------------------------------------------------------- /data/config/boilSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "st": [ 3 | { 4 | "n": "1stHopBitter", 5 | "tm": 60, 6 | "a": 10 7 | }, 8 | { 9 | "n": "2ndHopFlavor", 10 | "tm": 30, 11 | "a": 20 12 | }, 13 | { 14 | "n": "3rtHopAroma", 15 | "tm": 15, 16 | "a": 30 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /data/config/brewSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "lg": "en", 3 | "bpp": 100, 4 | "btemp": 99.1, 5 | "bt": 60, 6 | "kP": 1100, 7 | "kI": 3.5, 8 | "kD": 0, 9 | "pri": 300, 10 | "prt": 60, 11 | "mhp": 66, 12 | "es": false, 13 | "st": 75, 14 | "spp": 100, 15 | "ps": 0.5, 16 | "mso": 0, 17 | "sso": 0, 18 | "bso": 0, 19 | "tu": "C", 20 | "ip": false, 21 | "pa": 0 22 | } -------------------------------------------------------------------------------- /data/config/mashSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "st": [ 3 | { 4 | "n": "PreMash", 5 | "t": 52, 6 | "tm": 1, 7 | "r": true, 8 | "sl": false, 9 | "ho": true, 10 | "fp": true 11 | }, 12 | { 13 | "n": "MashIn", 14 | "t": 50, 15 | "tm": 0, 16 | "r": false, 17 | "sl": true, 18 | "ho": false, 19 | "fp": false 20 | }, 21 | { 22 | "n": "MashOne", 23 | "t": 50, 24 | "tm": 35, 25 | "r": true, 26 | "sl": false, 27 | "ho": true, 28 | "fp": false 29 | }, 30 | { 31 | "n": "MashTwo", 32 | "t": 64, 33 | "tm": 55, 34 | "r": true, 35 | "sl": true, 36 | "ho": true, 37 | "fp": false 38 | }, 39 | { 40 | "n": "MashOut", 41 | "t": 78, 42 | "tm": 5, 43 | "r": true, 44 | "sl": true, 45 | "ho": true, 46 | "fp": false 47 | } 48 | ] 49 | } -------------------------------------------------------------------------------- /data/config/ntpSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"a.st1.ntp.br", 3 | "interval":3600 4 | } 5 | -------------------------------------------------------------------------------- /data/config/otaSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "enabled": false, 3 | "port": 8266, 4 | "password": "brewuno" 5 | } -------------------------------------------------------------------------------- /data/config/wifiSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ssid": "ssid", 3 | "password": "password", 4 | "hostname": "BrewUNO", 5 | "static_ip_config": false 6 | } 7 | -------------------------------------------------------------------------------- /data/www/app/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/app/icon.png -------------------------------------------------------------------------------- /data/www/app/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/app/logo.png -------------------------------------------------------------------------------- /data/www/app/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"BrewUNO", 3 | "icons":[ 4 | { 5 | "src":"/app/icon.png", 6 | "sizes":"48x48 72x72 96x96 128x128 256x256" 7 | } 8 | ], 9 | "start_url":"/", 10 | "display":"fullscreen", 11 | "orientation":"any" 12 | } 13 | -------------------------------------------------------------------------------- /data/www/css/roboto.css: -------------------------------------------------------------------------------- 1 | /* Just supporting latin due to size constrains on the esp chip */ 2 | @font-face { 3 | font-family: 'Roboto'; 4 | font-style: normal; 5 | font-weight: 300; 6 | src: local('Roboto Light'), local('Roboto-Light'), url(../fonts/ro-li.w2) format('woff2'); 7 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 8 | } 9 | @font-face { 10 | font-family: 'Roboto'; 11 | font-style: normal; 12 | font-weight: 400; 13 | src: local('Roboto'), local('Roboto-Regular'), url(../fonts/ro-re.w2) format('woff2'); 14 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 15 | } 16 | @font-face { 17 | font-family: 'Roboto'; 18 | font-style: normal; 19 | font-weight: 500; 20 | src: local('Roboto Medium'), local('Roboto-Medium'), url(../fonts/ro-me.w2) format('woff2'); 21 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 22 | } -------------------------------------------------------------------------------- /data/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/favicon.ico -------------------------------------------------------------------------------- /data/www/fonts/ro-li.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/fonts/ro-li.w2 -------------------------------------------------------------------------------- /data/www/fonts/ro-me.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/fonts/ro-me.w2 -------------------------------------------------------------------------------- /data/www/fonts/ro-re.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/fonts/ro-re.w2 -------------------------------------------------------------------------------- /data/www/index.html: -------------------------------------------------------------------------------- 1 | BrewUNO
-------------------------------------------------------------------------------- /data/www/js/0.20a3.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/js/0.20a3.js.gz -------------------------------------------------------------------------------- /data/www/js/1.b351.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/js/1.b351.js.gz -------------------------------------------------------------------------------- /data/www/js/2.60b4.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/data/www/js/2.60b4.js.gz -------------------------------------------------------------------------------- /interface/.env.development: -------------------------------------------------------------------------------- 1 | REACT_APP_ENDPOINT_ROOT=http://192.168.15.20/rest/ -------------------------------------------------------------------------------- /interface/.env.production: -------------------------------------------------------------------------------- 1 | REACT_APP_ENDPOINT_ROOT=/rest/ 2 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /interface/build/app/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/build/app/icon.png -------------------------------------------------------------------------------- /interface/build/app/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"BrewUNO", 3 | "icons":[ 4 | { 5 | "src":"/app/icon.png", 6 | "sizes":"48x48 72x72 96x96 128x128 256x256" 7 | } 8 | ], 9 | "start_url":"/", 10 | "display":"fullscreen", 11 | "orientation":"any" 12 | } 13 | -------------------------------------------------------------------------------- /interface/build/css/roboto.css: -------------------------------------------------------------------------------- 1 | /* Just supporting latin due to size constrains on the esp chip */ 2 | @font-face { 3 | font-family: 'Roboto'; 4 | font-style: normal; 5 | font-weight: 300; 6 | src: local('Roboto Light'), local('Roboto-Light'), url(../fonts/ro-li.w2) format('woff2'); 7 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 8 | } 9 | @font-face { 10 | font-family: 'Roboto'; 11 | font-style: normal; 12 | font-weight: 400; 13 | src: local('Roboto'), local('Roboto-Regular'), url(../fonts/ro-re.w2) format('woff2'); 14 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 15 | } 16 | @font-face { 17 | font-family: 'Roboto'; 18 | font-style: normal; 19 | font-weight: 500; 20 | src: local('Roboto Medium'), local('Roboto-Medium'), url(../fonts/ro-me.w2) format('woff2'); 21 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 22 | } -------------------------------------------------------------------------------- /interface/build/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/build/favicon.ico -------------------------------------------------------------------------------- /interface/build/fonts/ro-li.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/build/fonts/ro-li.w2 -------------------------------------------------------------------------------- /interface/build/fonts/ro-me.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/build/fonts/ro-me.w2 -------------------------------------------------------------------------------- /interface/build/fonts/ro-re.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/build/fonts/ro-re.w2 -------------------------------------------------------------------------------- /interface/build/index.html: -------------------------------------------------------------------------------- 1 | BrewUNO
-------------------------------------------------------------------------------- /interface/config-overrides.js: -------------------------------------------------------------------------------- 1 | const ManifestPlugin = require('webpack-manifest-plugin'); 2 | const WorkboxWebpackPlugin = require('workbox-webpack-plugin'); 3 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 4 | const CompressionPlugin = require("compression-webpack-plugin"); 5 | 6 | const path = require('path'); 7 | const fs = require('fs'); 8 | 9 | module.exports = function override(config, env) { 10 | if (env === "production") { 11 | // rename the ouput file, we need it's path to be short, for SPIFFS 12 | config.output.filename = 'js/[id].[chunkhash:4].js'; 13 | config.output.chunkFilename = 'js/[id].[chunkhash:4].js'; 14 | 15 | // take out the manifest and service worker plugins 16 | config.plugins = config.plugins.filter(plugin => !(plugin instanceof ManifestPlugin)); 17 | config.plugins = config.plugins.filter(plugin => !(plugin instanceof WorkboxWebpackPlugin.GenerateSW)); 18 | 19 | // shorten css filenames 20 | const miniCssExtractPlugin = config.plugins.find((plugin) => plugin instanceof MiniCssExtractPlugin); 21 | miniCssExtractPlugin.options.filename = "css/[id].[contenthash:4].css"; 22 | miniCssExtractPlugin.options.chunkFilename = "css/[id].[contenthash:4].c.css"; 23 | 24 | // add compression plugin, compress javascript 25 | config.plugins.push(new CompressionPlugin({ 26 | filename: "[path].gz[query]", 27 | algorithm: "gzip", 28 | test: /\.(js)$/, 29 | deleteOriginalAssets: true 30 | })); 31 | } 32 | return config; 33 | } 34 | -------------------------------------------------------------------------------- /interface/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BrewUNO", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@material-ui/core": "^3.9.3", 7 | "@material-ui/icons": "^3.0.2", 8 | "@material-ui/lab": "^3.0.0-alpha.30", 9 | "compression-webpack-plugin": "^2.0.0", 10 | "i18n-react": "^0.7.0", 11 | "js-cookie": "^2.2.1", 12 | "material-ui-popup-state": "^1.4.0", 13 | "moment": "^2.24.0", 14 | "notistack": "^0.8.6", 15 | "npm": "^6.9.0", 16 | "prop-types": "^15.7.2", 17 | "rc-progress": "^2.5.1", 18 | "rc-slider": "^8.6.13", 19 | "react": "^16.8.6", 20 | "react-copy-to-clipboard": "^5.0.1", 21 | "react-dom": "^16.8.6", 22 | "react-form-validator-core": "^0.6.2", 23 | "react-ga": "^2.7.0", 24 | "react-input-mask": "^2.0.4", 25 | "react-jss": "^8.6.1", 26 | "react-material-ui-form-validator": "^2.0.7", 27 | "react-router": "^5.0.0", 28 | "react-router-dom": "^5.0.0", 29 | "react-scripts": "2.1.8", 30 | "react-sortable-hoc": "^0.8.4", 31 | "recharts": "^1.4.2" 32 | }, 33 | "scripts": { 34 | "start": "react-app-rewired start", 35 | "build": "react-app-rewired build && rm -rf ../data/www && cp -r build ../data/www", 36 | "test": "react-app-rewired test --env=jsdom", 37 | "eject": "react-scripts eject" 38 | }, 39 | "devDependencies": { 40 | "react-app-rewired": "^2.1.1" 41 | }, 42 | "browserslist": [ 43 | ">0.2%", 44 | "not dead", 45 | "not ie <= 11", 46 | "not op_mini all" 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /interface/public/app/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/public/app/icon.png -------------------------------------------------------------------------------- /interface/public/app/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/public/app/logo.png -------------------------------------------------------------------------------- /interface/public/app/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"BrewUNO", 3 | "icons":[ 4 | { 5 | "src":"/app/icon.png", 6 | "sizes":"48x48 72x72 96x96 128x128 256x256" 7 | } 8 | ], 9 | "start_url":"/", 10 | "display":"fullscreen", 11 | "orientation":"any" 12 | } 13 | -------------------------------------------------------------------------------- /interface/public/css/roboto.css: -------------------------------------------------------------------------------- 1 | /* Just supporting latin due to size constrains on the esp chip */ 2 | @font-face { 3 | font-family: 'Roboto'; 4 | font-style: normal; 5 | font-weight: 300; 6 | src: local('Roboto Light'), local('Roboto-Light'), url(../fonts/ro-li.w2) format('woff2'); 7 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 8 | } 9 | @font-face { 10 | font-family: 'Roboto'; 11 | font-style: normal; 12 | font-weight: 400; 13 | src: local('Roboto'), local('Roboto-Regular'), url(../fonts/ro-re.w2) format('woff2'); 14 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 15 | } 16 | @font-face { 17 | font-family: 'Roboto'; 18 | font-style: normal; 19 | font-weight: 500; 20 | src: local('Roboto Medium'), local('Roboto-Medium'), url(../fonts/ro-me.w2) format('woff2'); 21 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215; 22 | } -------------------------------------------------------------------------------- /interface/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/public/favicon.ico -------------------------------------------------------------------------------- /interface/public/fonts/ro-li.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/public/fonts/ro-li.w2 -------------------------------------------------------------------------------- /interface/public/fonts/ro-me.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/public/fonts/ro-me.w2 -------------------------------------------------------------------------------- /interface/public/fonts/ro-re.w2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uncodead/BrewUNO/f895a56c0af6b048f1ecd24e9000a6d0eda910ec/interface/public/fonts/ro-re.w2 -------------------------------------------------------------------------------- /interface/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | BrewUNO 9 | 10 | 11 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /interface/src/AppRouting.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import { Route, Redirect, Switch } from 'react-router'; 4 | 5 | // containers 6 | import WiFiConfiguration from './containers/WiFiConfiguration'; 7 | import NTPConfiguration from './containers/NTPConfiguration'; 8 | import OTAConfiguration from './containers/OTAConfiguration'; 9 | import APConfiguration from './containers/APConfiguration'; 10 | import BrewConfiguration from './containers/BrewConfiguration'; 11 | import BrewDayConfiguration from './containers/BrewDayConfiguration'; 12 | import AboutContainer from './containers/AboutContainer'; 13 | 14 | class AppRouting extends Component { 15 | render() { 16 | return ( 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | ) 28 | } 29 | } 30 | 31 | export default AppRouting; 32 | -------------------------------------------------------------------------------- /interface/src/components/IntText.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import T from 'i18n-react'; 3 | import en from "../language/en.json" 4 | import deDE from "../language/de-DE.json" 5 | import ptBR from "../language/pt-BR.json" 6 | import ruRU from "../language/ru-RU.json" 7 | import esES from "../language/es-ES.json" 8 | 9 | class IntText extends Component { 10 | constructor(props) { 11 | super(props) 12 | } 13 | 14 | SetText(lang) { 15 | switch (lang) { 16 | case "pt-BR": 17 | T.setTexts(ptBR) 18 | break 19 | case "de-DE": 20 | T.setTexts(deDE); 21 | break 22 | case "en": 23 | T.setTexts(en); 24 | break 25 | case "ru-RU": 26 | T.setTexts(ruRU); 27 | break 28 | case "es-ES": 29 | T.setTexts(esES); 30 | break 31 | default: 32 | T.setTexts(en) 33 | break 34 | } 35 | this.forceUpdate() 36 | } 37 | 38 | render() { 39 | return ( 40 | 41 | {this.props.spaceBefore ? ' ' : null} 42 | 43 | {this.props.spaceAfter ? ' ' : null} 44 | 45 | ) 46 | } 47 | } 48 | 49 | export default IntText; -------------------------------------------------------------------------------- /interface/src/components/SectionContent.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | import Paper from '@material-ui/core/Paper'; 5 | import { withStyles } from '@material-ui/core/styles'; 6 | import Typography from '@material-ui/core/Typography'; 7 | 8 | const styles = theme => ({ 9 | content: { 10 | padding: theme.spacing.unit * 1.5, 11 | margin: theme.spacing.unit * 1.5, 12 | minWidth: 350, 13 | } 14 | 15 | }); 16 | 17 | function SectionContent(props) { 18 | const { children, classes, title } = props; 19 | return ( 20 |
21 | {title != '' ? 22 | 23 | 24 | {title} 25 | 26 | 27 | : null} 28 | 29 | {children} 30 | 31 | 32 |
33 | ); 34 | } 35 | 36 | SectionContent.propTypes = { 37 | classes: PropTypes.object.isRequired, 38 | children: PropTypes.oneOfType([ 39 | PropTypes.arrayOf(PropTypes.node), 40 | PropTypes.node 41 | ]).isRequired, 42 | title: PropTypes.string.isRequired 43 | }; 44 | 45 | export default withStyles(styles)(SectionContent); 46 | -------------------------------------------------------------------------------- /interface/src/components/Tracking.js: -------------------------------------------------------------------------------- 1 | import ReactGA from 'react-ga'; 2 | 3 | export const initGA = (trackingID) => { 4 | ReactGA.initialize(trackingID); 5 | } 6 | 7 | export const PageView = () => { 8 | ReactGA.pageview(window.location.pathname + 9 | window.location.search); 10 | } 11 | 12 | /** 13 | * Event - Add custom tracking event. 14 | * @param {string} category 15 | * @param {string} action 16 | * @param {string} label 17 | */ 18 | export const Event = (category, action, label) => { 19 | ReactGA.event({ 20 | category: category, 21 | action: action, 22 | label: label 23 | }); 24 | }; -------------------------------------------------------------------------------- /interface/src/components/Utils.js: -------------------------------------------------------------------------------- 1 | export const getDateTime = (seconds) => { 2 | var date = new Date(0); 3 | date.setUTCSeconds(seconds); 4 | return date; 5 | } 6 | 7 | export const pad = (n, width, z) => { 8 | z = z || '0'; 9 | n = n + ''; 10 | return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; 11 | } 12 | 13 | export const ExecuteRestCall = (url, method, callback, callbackError, props) => { 14 | fetch(url, { 15 | method: method, 16 | headers: { 17 | 'Accept': 'application/json', 18 | 'Content-Type': 'application/json', 19 | }, 20 | }).then(response => { 21 | if (response.ok) { 22 | response.json() 23 | .catch(() => { 24 | if (props != undefined && props.enqueueSnackbar != undefined) 25 | props.enqueueSnackbar("Invalid json result", { variant: 'error', autoHideDuration: 2000, }); 26 | }) 27 | .then(json => callback(json)); 28 | return; 29 | } 30 | if (props != undefined && props.enqueueSnackbar != undefined) 31 | response.json().then(json => props.enqueueSnackbar(json.message, { variant: 'info', autoHideDuration: 2000, })); 32 | }).catch(error => { 33 | if (props != undefined && props.enqueueSnackbar != undefined) 34 | props.enqueueSnackbar("Problem getting resource: " + error.message, { variant: 'error', autoHideDuration: 2000, }); 35 | if (callbackError) { 36 | callbackError() 37 | } 38 | }); 39 | } -------------------------------------------------------------------------------- /interface/src/constants/Highlight.js: -------------------------------------------------------------------------------- 1 | export const IDLE = "idle"; 2 | export const SUCCESS = "success"; 3 | export const ERROR = "error"; 4 | export const WARN = "warn"; 5 | -------------------------------------------------------------------------------- /interface/src/constants/NTPStatus.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import * as Highlight from '../constants/Highlight'; 3 | import IntText from '../components/IntText' 4 | 5 | export const NTP_TIME_NOT_SET = 0; 6 | export const NTP_TIME_NEEDS_SYNC = 1; 7 | export const NTP_TIME_SET = 2; 8 | 9 | export const isSynchronized = ntpStatus => ntpStatus && (ntpStatus.status === NTP_TIME_NEEDS_SYNC || ntpStatus.status === NTP_TIME_SET); 10 | 11 | export const ntpStatusHighlight = ntpStatus => { 12 | switch (ntpStatus.status) { 13 | case NTP_TIME_SET: 14 | return Highlight.SUCCESS; 15 | case NTP_TIME_NEEDS_SYNC: 16 | return Highlight.WARN; 17 | case NTP_TIME_NOT_SET: 18 | default: 19 | return Highlight.ERROR; 20 | } 21 | } 22 | 23 | export const ntpStatus = ntpStatus => { 24 | switch (ntpStatus.status) { 25 | case NTP_TIME_SET: 26 | return ; 27 | case NTP_TIME_NEEDS_SYNC: 28 | return ; 29 | case NTP_TIME_NOT_SET: 30 | return ; 31 | default: 32 | return ; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /interface/src/constants/TimeFormat.js: -------------------------------------------------------------------------------- 1 | import moment from 'moment'; 2 | 3 | export const TIME_AND_DATE = 'DD/MM/YYYY HH:mm:ss'; 4 | export const unixTimeToTimeAndDate = unixTime => moment.unix(unixTime).format(TIME_AND_DATE); 5 | -------------------------------------------------------------------------------- /interface/src/constants/WiFiAPModes.js: -------------------------------------------------------------------------------- 1 | export const WIFI_AP_MODE_ALWAYS = 0; 2 | export const WIFI_AP_MODE_DISCONNECTED = 1; 3 | export const WIFI_AP_NEVER = 2; 4 | 5 | export const isAPEnabled = apMode => apMode === WIFI_AP_MODE_ALWAYS || apMode === WIFI_AP_MODE_DISCONNECTED; 6 | -------------------------------------------------------------------------------- /interface/src/constants/WiFiConnectionStatus.js: -------------------------------------------------------------------------------- 1 | import * as Highlight from '../constants/Highlight'; 2 | 3 | export const WIFI_STATUS_IDLE = 0; 4 | export const WIFI_STATUS_NO_SSID_AVAIL = 1; 5 | export const WIFI_STATUS_CONNECTED = 3; 6 | export const WIFI_STATUS_CONNECT_FAILED = 4; 7 | export const WIFI_STATUS_CONNECTION_LOST = 5; 8 | export const WIFI_STATUS_DISCONNECTED = 6; 9 | 10 | export const isConnected = wifiStatus => wifiStatus && wifiStatus.status === WIFI_STATUS_CONNECTED; 11 | 12 | export const connectionStatusHighlight = wifiStatus => { 13 | switch (wifiStatus.status){ 14 | case WIFI_STATUS_IDLE: 15 | case WIFI_STATUS_DISCONNECTED: 16 | return Highlight.IDLE; 17 | case WIFI_STATUS_CONNECTED: 18 | return Highlight.SUCCESS; 19 | case WIFI_STATUS_CONNECT_FAILED: 20 | case WIFI_STATUS_CONNECTION_LOST: 21 | return Highlight.ERROR; 22 | default: 23 | return Highlight.WARN; 24 | } 25 | } 26 | 27 | export const connectionStatus = wifiStatus => { 28 | switch (wifiStatus.status){ 29 | case WIFI_STATUS_IDLE: 30 | return "Idle"; 31 | case WIFI_STATUS_NO_SSID_AVAIL: 32 | return "No SSID Available"; 33 | case WIFI_STATUS_CONNECTED: 34 | return "Connected"; 35 | case WIFI_STATUS_CONNECT_FAILED: 36 | return "Connection Failed"; 37 | case WIFI_STATUS_CONNECTION_LOST: 38 | return "Connection Lost"; 39 | case WIFI_STATUS_DISCONNECTED: 40 | return "Disconnected"; 41 | default: 42 | return "Unknown"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /interface/src/constants/WiFiSecurityModes.js: -------------------------------------------------------------------------------- 1 | export const WIFI_AUTH_OPEN = 0; 2 | export const WIFI_AUTH_WEP = 1; 3 | export const WIFI_AUTH_WEP_PSK = 2; 4 | export const WIFI_AUTH_WEP2_PSK = 3; 5 | export const WIFI_AUTH_WPA_WPA2_PSK = 4; 6 | export const WIFI_AUTH_WPA2_ENTERPRISE = 5; 7 | 8 | export const isNetworkOpen = selectedNetwork => selectedNetwork && selectedNetwork.encryption_type === WIFI_AUTH_OPEN; 9 | 10 | export const networkSecurityMode = selectedNetwork => { 11 | switch (selectedNetwork.encryption_type){ 12 | case WIFI_AUTH_WEP: 13 | case WIFI_AUTH_WEP_PSK: 14 | return "WEP"; 15 | case WIFI_AUTH_WEP2_PSK: 16 | return "WEP2"; 17 | case WIFI_AUTH_WPA_WPA2_PSK: 18 | return "WPA/WEP2"; 19 | case WIFI_AUTH_WPA2_ENTERPRISE: 20 | return "WEP2 Enterprise"; 21 | case WIFI_AUTH_OPEN: 22 | return "None"; 23 | default: 24 | return "Unknown"; 25 | } 26 | } -------------------------------------------------------------------------------- /interface/src/containers/APConfiguration.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import Tabs from '@material-ui/core/Tabs'; 3 | import Tab from '@material-ui/core/Tab'; 4 | import MenuAppBar from '../components/MenuAppBar'; 5 | import APSettings from './APSettings'; 6 | import APStatus from './APStatus'; 7 | import { PageView, initGA, Event } from '../components/Tracking' 8 | 9 | class APConfiguration extends Component { 10 | 11 | constructor(props) { 12 | super(props); 13 | this.state = { 14 | selectedTab: "apStatus", 15 | selectedNetwork: null 16 | }; 17 | } 18 | 19 | componentDidMount() { 20 | initGA('UA-149477072-2'); 21 | PageView(); 22 | } 23 | 24 | handleTabChange = (event, selectedTab) => { 25 | this.setState({ selectedTab }); 26 | }; 27 | 28 | render() { 29 | const { selectedTab } = this.state; 30 | return ( 31 | 32 | 33 | 34 | 35 | 36 | {selectedTab === "apStatus" && } 37 | {selectedTab === "apSettings" && } 38 | 39 | ) 40 | } 41 | } 42 | 43 | export default APConfiguration; 44 | -------------------------------------------------------------------------------- /interface/src/containers/APSettings.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import { AP_SETTINGS_ENDPOINT } from '../constants/Endpoints'; 4 | import { restComponent } from '../components/RestComponent'; 5 | import SectionContent from '../components/SectionContent'; 6 | import APSettingsForm from '../forms/APSettingsForm'; 7 | 8 | import IntText from '../components/IntText' 9 | 10 | class APSettings extends Component { 11 | 12 | componentDidMount() { 13 | this.props.loadData(); 14 | } 15 | 16 | render() { 17 | const { data, fetched, errorMessage } = this.props; 18 | return ( 19 | }> 20 | 28 | 29 | ) 30 | } 31 | 32 | } 33 | 34 | export default restComponent(AP_SETTINGS_ENDPOINT, APSettings); 35 | -------------------------------------------------------------------------------- /interface/src/containers/AboutContainer.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import MenuAppBar from '../components/MenuAppBar'; 3 | import About from './About' 4 | import { PageView, initGA, Event } from '../components/Tracking' 5 | import IntText from '../components/IntText' 6 | 7 | class AboutContainer extends Component { 8 | constructor() { 9 | super(); 10 | } 11 | 12 | componentDidMount() { 13 | initGA('UA-149477072-2'); 14 | PageView(); 15 | } 16 | 17 | render() { 18 | const { data, fetched, errorMessage } = this.props; 19 | return ( 20 | }> 21 | 22 | 23 | ) 24 | } 25 | } 26 | 27 | export default AboutContainer 28 | -------------------------------------------------------------------------------- /interface/src/containers/BrewDayConfiguration.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import MenuAppBar from '../components/MenuAppBar'; 3 | import Brew from './Brew' 4 | import { PageView, initGA, Event } from '../components/Tracking' 5 | 6 | class BrewConfiguration extends Component { 7 | constructor() { 8 | super(); 9 | } 10 | 11 | componentDidMount() { 12 | initGA('UA-149477072-2'); 13 | PageView(); 14 | } 15 | 16 | render() { 17 | return ( 18 | 19 | 20 | 21 | ) 22 | } 23 | } 24 | 25 | export default BrewConfiguration 26 | -------------------------------------------------------------------------------- /interface/src/containers/NTPConfiguration.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import MenuAppBar from '../components/MenuAppBar'; 3 | import NTPSettings from './NTPSettings'; 4 | import NTPStatus from './NTPStatus'; 5 | import Tabs from '@material-ui/core/Tabs'; 6 | import Tab from '@material-ui/core/Tab'; 7 | import IntText from '../components/IntText' 8 | import { PageView, initGA, Event } from '../components/Tracking' 9 | 10 | class NTPConfiguration extends Component { 11 | 12 | constructor(props) { 13 | super(props); 14 | this.state = { 15 | selectedTab: "ntpStatus" 16 | }; 17 | } 18 | 19 | componentDidMount() { 20 | initGA('UA-149477072-2'); 21 | PageView(); 22 | } 23 | 24 | handleTabChange = (event, selectedTab) => { 25 | this.setState({ selectedTab }); 26 | }; 27 | 28 | render() { 29 | const { selectedTab } = this.state; 30 | return ( 31 | }> 32 | 33 | } /> 34 | } /> 35 | 36 | {selectedTab === "ntpStatus" && } 37 | {selectedTab === "ntpSettings" && } 38 | 39 | ) 40 | } 41 | } 42 | 43 | export default NTPConfiguration 44 | -------------------------------------------------------------------------------- /interface/src/containers/NTPSettings.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import { NTP_SETTINGS_ENDPOINT } from '../constants/Endpoints'; 4 | import { restComponent } from '../components/RestComponent'; 5 | import SectionContent from '../components/SectionContent'; 6 | import NTPSettingsForm from '../forms/NTPSettingsForm'; 7 | 8 | import IntText from '../components/IntText' 9 | 10 | class NTPSettings extends Component { 11 | 12 | componentDidMount() { 13 | this.props.loadData(); 14 | } 15 | 16 | render() { 17 | const { data, fetched, errorMessage } = this.props; 18 | return ( 19 | }> 20 | 28 | 29 | ) 30 | } 31 | 32 | } 33 | 34 | export default restComponent(NTP_SETTINGS_ENDPOINT, NTPSettings); 35 | -------------------------------------------------------------------------------- /interface/src/containers/OTAConfiguration.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import MenuAppBar from '../components/MenuAppBar'; 3 | import OTASettings from './OTASettings'; 4 | import { PageView, initGA, Event } from '../components/Tracking' 5 | import IntText from '../components/IntText' 6 | 7 | class OTAConfiguration extends Component { 8 | componentDidMount() { 9 | initGA('UA-149477072-2'); 10 | PageView(); 11 | } 12 | 13 | render() { 14 | return ( 15 | }> 16 | 17 | 18 | ) 19 | } 20 | } 21 | 22 | export default OTAConfiguration 23 | -------------------------------------------------------------------------------- /interface/src/containers/OTASettings.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import { OTA_SETTINGS_ENDPOINT } from '../constants/Endpoints'; 4 | import {restComponent} from '../components/RestComponent'; 5 | import SectionContent from '../components/SectionContent'; 6 | import OTASettingsForm from '../forms/OTASettingsForm'; 7 | 8 | import IntText from '../components/IntText' 9 | 10 | class OTASettings extends Component { 11 | 12 | componentDidMount() { 13 | this.props.loadData(); 14 | } 15 | 16 | render() { 17 | const { data, fetched, errorMessage } = this.props; 18 | return ( 19 | }> 20 | 29 | 30 | ) 31 | } 32 | 33 | } 34 | 35 | export default restComponent(OTA_SETTINGS_ENDPOINT, OTASettings); 36 | -------------------------------------------------------------------------------- /interface/src/history.js: -------------------------------------------------------------------------------- 1 | import { createBrowserHistory } from 'history'; 2 | 3 | export default createBrowserHistory({ 4 | /* pass a configuration object here if needed */ 5 | }) 6 | -------------------------------------------------------------------------------- /interface/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from 'react-dom'; 3 | import history from './history'; 4 | import { Router, Route, Redirect, Switch } from 'react-router'; 5 | import App from './App'; 6 | 7 | render(( 8 | 9 | 10 | 11 | 12 | 13 | 14 | ), document.getElementById("root")) 15 | -------------------------------------------------------------------------------- /interface/src/style/BrewStyle.js: -------------------------------------------------------------------------------- 1 | const BrewStyles = theme => ({ 2 | loadingSettings: { 3 | margin: theme.spacing.unit, 4 | }, 5 | loadingSettingsDetails: { 6 | margin: theme.spacing.unit * 4, 7 | textAlign: "center" 8 | }, 9 | button: { 10 | margin: theme.spacing.unit * 0.45, 11 | padding: theme.spacing.unit * 0.7, 12 | }, 13 | button_icons: { 14 | marginRight: theme.spacing.unit * 0, 15 | padding: 0, 16 | }, 17 | button_pump: { 18 | marginRight: theme.spacing.unit * 0.33, 19 | padding: 0, 20 | }, 21 | button_pop: { 22 | marginRight: theme.spacing.unit * 0.5, 23 | padding: 2, 24 | }, 25 | input: { 26 | display: 'none', 27 | }, 28 | gadgetCard: { 29 | background: "#303030", 30 | }, 31 | slider: { 32 | padding: '22px 0px', 33 | }, 34 | sliderThumb: { 35 | background: '#fff', 36 | }, 37 | trackBefore: { 38 | background: '#536dfe', 39 | }, 40 | trackAfter: { 41 | background: '#fff', 42 | }, 43 | brewSettingsCard: { 44 | background: "#303030", 45 | }, 46 | chartCard: { 47 | background: "#262626", 48 | }, 49 | pumpColor1: { 50 | color: "#447bd6", 51 | }, 52 | pumpColor2: { 53 | color: "#5c94f2", 54 | }, 55 | }); 56 | 57 | export default BrewStyles; -------------------------------------------------------------------------------- /interface/src/validators/isHostname.js: -------------------------------------------------------------------------------- 1 | const hostnameLengthRegex = /^.{0,32}$/ 2 | const hostnamePatternRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/ 3 | 4 | export default function isHostname(hostname) { 5 | return hostnameLengthRegex.test(hostname) && hostnamePatternRegex.test(hostname); 6 | } 7 | -------------------------------------------------------------------------------- /interface/src/validators/isIP.js: -------------------------------------------------------------------------------- 1 | const ipAddressRegexp = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ 2 | 3 | export default function isIp(ipAddress) { 4 | return ipAddressRegexp.test(ipAddress); 5 | } -------------------------------------------------------------------------------- /interface/src/validators/optional.js: -------------------------------------------------------------------------------- 1 | export default validator => value => !value || validator(value); -------------------------------------------------------------------------------- /interface/src/validators/or.js: -------------------------------------------------------------------------------- 1 | export default (validator1, validator2) => value => validator1(value) || validator2(value); 2 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/.clang-format: -------------------------------------------------------------------------------- 1 | # http://clang.llvm.org/docs/ClangFormatStyleOptions.html 2 | 3 | BasedOnStyle: Google 4 | Standard: Cpp03 5 | AllowShortFunctionsOnASingleLine: Empty 6 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.idea 3 | /build 4 | /bin 5 | /lib 6 | /sftp-config.json 7 | .tags 8 | .tags_sorted_by_file 9 | /fuzzing/*_fuzzer 10 | /fuzzing/*_fuzzer.options 11 | /fuzzing/*_fuzzer_seed_corpus.zip 12 | .vs/ 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/.library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ArduinoJson", 3 | "keywords": [ 4 | "json", 5 | "rest", 6 | "http", 7 | "web" 8 | ], 9 | "description": "An elegant and efficient JSON library for embedded systems", 10 | "homepage": "https://arduinojson.org/?utm_source=meta&utm_medium=library.json", 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/bblanchon/ArduinoJson.git" 14 | }, 15 | "version": "6.11.0", 16 | "authors": [ 17 | { 18 | "email": null, 19 | "url": "https://blog.benoitblanchon.fr", 20 | "maintainer": false, 21 | "name": "Benoit Blanchon" 22 | } 23 | ], 24 | "frameworks": [ 25 | "arduino" 26 | ], 27 | "platforms": [ 28 | "atmelavr", 29 | "atmelsam", 30 | "espressif32", 31 | "espressif8266", 32 | "infineonxmc", 33 | "intel_arc32", 34 | "kendryte210", 35 | "microchippic32", 36 | "nordicnrf51", 37 | "nordicnrf52", 38 | "ststm32", 39 | "ststm8", 40 | "teensy", 41 | "timsp430" 42 | ], 43 | "export": { 44 | "exclude": [ 45 | "fuzzing", 46 | "scripts", 47 | "test", 48 | "third-party" 49 | ] 50 | }, 51 | "id": 64 52 | } -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/.mbedignore: -------------------------------------------------------------------------------- 1 | .github/ 2 | examples/ 3 | fuzzing/ 4 | scripts/ 5 | test/ 6 | third-party/ 7 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #include "src/ArduinoJson.h" 6 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ArduinoJson - arduinojson.org 2 | # Copyright Benoit Blanchon 2014-2019 3 | # MIT License 4 | 5 | cmake_minimum_required(VERSION 3.0) 6 | project(ArduinoJson) 7 | 8 | enable_testing() 9 | 10 | add_definitions(-DARDUINOJSON_DEBUG) 11 | if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") 12 | add_compile_options(-g -O0) 13 | endif() 14 | 15 | if(${COVERAGE}) 16 | set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage") 17 | endif() 18 | 19 | include_directories(${CMAKE_CURRENT_LIST_DIR}/src) 20 | add_subdirectory(third-party/catch) 21 | add_subdirectory(test) 22 | add_subdirectory(fuzzing) 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution to ArduinoJson 2 | 3 | First, thank you for taking the time to contribute to this project. 4 | 5 | You can submit changes via GitHub Pull Requests. 6 | 7 | Please: 8 | 9 | 1. Unit test every change in behavior 10 | 2. Use clang-format in "file" mode to format the code 11 | 3. Consider using the Continuous Integration (Travis and AppVeyor) 12 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | --------------------- 3 | 4 | Copyright © 2014-2019 Benoit BLANCHON 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # ArduinoJson Support 2 | 3 | First off, thank you very much for using ArduinoJson. 4 | 5 | We'll be very happy to help you, but first please read the following. 6 | 7 | ## Before asking for help 8 | 9 | 1. Read the [FAQ](https://arduinojson.org/faq/?utm_source=github&utm_medium=support) 10 | 2. Search in the [API Reference](https://arduinojson.org/api/?utm_source=github&utm_medium=support) 11 | 12 | If you did not find the answer, please create a [new issue on GitHub](https://github.com/bblanchon/ArduinoJson/issues/new). 13 | 14 | It is OK to add a comment to a currently opened issue, but please avoid adding comments to a closed issue. 15 | 16 | ## Before hitting the Submit button 17 | 18 | Please provide all the relevant information: 19 | 20 | * Good title 21 | * Short description of the problem 22 | * Target platform 23 | * Compiler model and version 24 | * [MVCE](https://stackoverflow.com/help/mcve) 25 | * Compiler output 26 | 27 | Good questions get fast answers! 28 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 6.11.0.{build} 2 | environment: 3 | matrix: 4 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 5 | CMAKE_GENERATOR: Visual Studio 15 2017 6 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 7 | CMAKE_GENERATOR: Visual Studio 14 2015 8 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 9 | CMAKE_GENERATOR: Visual Studio 12 2013 10 | - CMAKE_GENERATOR: Visual Studio 11 2012 11 | - CMAKE_GENERATOR: Visual Studio 10 2010 12 | - CMAKE_GENERATOR: MinGW Makefiles 13 | configuration: Debug 14 | before_build: 15 | - set PATH=C:\MinGW\bin;%PATH:C:\Program Files\Git\usr\bin;=% # Workaround for CMake not wanting sh.exe on PATH for MinGW 16 | - cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%CMAKE_GENERATOR%" . 17 | build_script: 18 | - cmake --build . --config %CONFIGURATION% 19 | test_script: 20 | - ctest -C %CONFIGURATION% --output-on-failure . 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/keywords.txt: -------------------------------------------------------------------------------- 1 | # Macros 2 | JSON_ARRAY_SIZE KEYWORD2 3 | JSON_OBJECT_SIZE KEYWORD2 4 | JSON_STRING_SIZE KEYWORD2 5 | 6 | # Free functions 7 | deserializeJson KEYWORD2 8 | deserializeMsgPack KEYWORD2 9 | serialized KEYWORD2 10 | serializeJson KEYWORD2 11 | serializeJsonPretty KEYWORD2 12 | serializeMsgPack KEYWORD2 13 | 14 | # Methods 15 | add KEYWORD2 16 | as KEYWORD2 17 | createNestedArray KEYWORD2 18 | createNestedObject KEYWORD2 19 | get KEYWORD2 20 | set KEYWORD2 21 | to KEYWORD2 22 | 23 | # Type names 24 | DeserializationError KEYWORD1 DATA_TYPE 25 | DynamicJsonDocument KEYWORD1 DATA_TYPE 26 | JsonArray KEYWORD1 DATA_TYPE 27 | JsonArrayConst KEYWORD1 DATA_TYPE 28 | JsonFloat KEYWORD1 DATA_TYPE 29 | JsonInteger KEYWORD1 DATA_TYPE 30 | JsonObject KEYWORD1 DATA_TYPE 31 | JsonObjectConst KEYWORD1 DATA_TYPE 32 | JsonString KEYWORD1 DATA_TYPE 33 | JsonUInt KEYWORD1 DATA_TYPE 34 | JsonVariant KEYWORD1 DATA_TYPE 35 | JsonVariantConst KEYWORD1 DATA_TYPE 36 | StaticJsonDocument KEYWORD1 DATA_TYPE 37 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ArduinoJson", 3 | "keywords": "json, rest, http, web", 4 | "description": "An elegant and efficient JSON library for embedded systems", 5 | "homepage": "https://arduinojson.org/?utm_source=meta&utm_medium=library.json", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/bblanchon/ArduinoJson.git" 9 | }, 10 | "version": "6.11.0", 11 | "authors": { 12 | "name": "Benoit Blanchon", 13 | "url": "https://blog.benoitblanchon.fr" 14 | }, 15 | "exclude": [ 16 | "fuzzing", 17 | "scripts", 18 | "test", 19 | "third-party" 20 | ], 21 | "frameworks": "arduino", 22 | "platforms": "*" 23 | } 24 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/library.properties: -------------------------------------------------------------------------------- 1 | name=ArduinoJson 2 | version=6.11.0 3 | author=Benoit Blanchon 4 | maintainer=Benoit Blanchon 5 | sentence=An efficient and elegant JSON library for Arduino. 6 | paragraph=ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation. 7 | category=Data Processing 8 | url=https://arduinojson.org/?utm_source=meta&utm_medium=library.properties 9 | architectures=* 10 | repository=https://github.com/bblanchon/ArduinoJson.git 11 | license=MIT 12 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef __cplusplus 8 | 9 | #include "ArduinoJson.hpp" 10 | 11 | using namespace ArduinoJson; 12 | 13 | #else 14 | 15 | #error ArduinoJson requires a C++ compiler, please change file extension to .cc or .cpp 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Array/ArrayFunctions.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Collection/CollectionData.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | inline VariantData *arrayAdd(CollectionData *arr, MemoryPool *pool) { 12 | return arr ? arr->add(pool) : 0; 13 | } 14 | 15 | template 16 | inline void arrayAccept(const CollectionData *arr, Visitor &visitor) { 17 | if (arr) 18 | visitor.visitArray(*arr); 19 | else 20 | visitor.visitNull(); 21 | } 22 | 23 | inline bool arrayEquals(const CollectionData *lhs, const CollectionData *rhs) { 24 | if (lhs == rhs) return true; 25 | if (!lhs || !rhs) return false; 26 | 27 | return lhs->equalsArray(*rhs); 28 | } 29 | } // namespace ARDUINOJSON_NAMESPACE 30 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Array/ArrayImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Object/ObjectRef.hpp" 8 | #include "ArrayRef.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | template 13 | inline ArrayRef ArrayShortcuts::createNestedArray() const { 14 | return impl()->addElement().template to(); 15 | } 16 | 17 | template 18 | inline ObjectRef ArrayShortcuts::createNestedObject() const { 19 | return impl()->addElement().template to(); 20 | } 21 | 22 | } // namespace ARDUINOJSON_NAMESPACE 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Array/ArrayShortcuts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/attributes.hpp" 8 | #include "../Polyfills/type_traits.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | // Forward declarations. 12 | template 13 | class ElementProxy; 14 | 15 | template 16 | class ArrayShortcuts { 17 | public: 18 | // Returns the element at specified index if the variant is an array. 19 | FORCE_INLINE ElementProxy operator[](size_t index) const; 20 | 21 | FORCE_INLINE ObjectRef createNestedObject() const; 22 | 23 | FORCE_INLINE ArrayRef createNestedArray() const; 24 | 25 | // Adds the specified value at the end of the array. 26 | // 27 | // bool add(TValue); 28 | // TValue = bool, long, int, short, float, double, serialized, VariantRef, 29 | // std::string, String, ObjectRef 30 | template 31 | FORCE_INLINE bool add(const T &value) const { 32 | return impl()->addElement().set(value); 33 | } 34 | // 35 | // bool add(TValue); 36 | // TValue = char*, const char*, const __FlashStringHelper* 37 | template 38 | FORCE_INLINE bool add(T *value) const { 39 | return impl()->addElement().set(value); 40 | } 41 | 42 | private: 43 | const TArray *impl() const { 44 | return static_cast(this); 45 | } 46 | }; 47 | } // namespace ARDUINOJSON_NAMESPACE 48 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Deserialization/ArduinoStreamReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_ARDUINO_STREAM 8 | 9 | #include 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | struct ArduinoStreamReader { 14 | Stream& _stream; 15 | 16 | public: 17 | explicit ArduinoStreamReader(Stream& stream) : _stream(stream) {} 18 | 19 | int read() { 20 | // don't use _stream.read() as it ignores the timeout 21 | uint8_t c; 22 | return _stream.readBytes(&c, 1) ? c : -1; 23 | } 24 | }; 25 | 26 | inline ArduinoStreamReader makeReader(Stream& input) { 27 | return ArduinoStreamReader(input); 28 | } 29 | } // namespace ARDUINOJSON_NAMESPACE 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Deserialization/FlashStringReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_PROGMEM 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | class UnsafeFlashStringReader { 11 | const char* _ptr; 12 | 13 | public: 14 | explicit UnsafeFlashStringReader(const __FlashStringHelper* ptr) 15 | : _ptr(reinterpret_cast(ptr)) {} 16 | 17 | int read() { 18 | return pgm_read_byte_near(_ptr++); 19 | } 20 | }; 21 | 22 | class SafeFlashStringReader { 23 | const char* _ptr; 24 | const char* _end; 25 | 26 | public: 27 | explicit SafeFlashStringReader(const __FlashStringHelper* ptr, size_t size) 28 | : _ptr(reinterpret_cast(ptr)), _end(_ptr + size) {} 29 | 30 | int read() { 31 | if (_ptr < _end) 32 | return pgm_read_byte_near(_ptr++); 33 | else 34 | return -1; 35 | } 36 | }; 37 | 38 | inline UnsafeFlashStringReader makeReader(const __FlashStringHelper* input) { 39 | return UnsafeFlashStringReader(input); 40 | } 41 | 42 | inline SafeFlashStringReader makeReader(const __FlashStringHelper* input, 43 | size_t size) { 44 | return SafeFlashStringReader(input, size); 45 | } 46 | } // namespace ARDUINOJSON_NAMESPACE 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Deserialization/IteratorReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | template 10 | class IteratorReader { 11 | TIterator _ptr, _end; 12 | 13 | public: 14 | explicit IteratorReader(TIterator begin, TIterator end) 15 | : _ptr(begin), _end(end) {} 16 | 17 | int read() { 18 | if (_ptr < _end) 19 | return static_cast(*_ptr++); 20 | else 21 | return -1; 22 | } 23 | }; 24 | 25 | template 26 | inline IteratorReader makeReader( 27 | const TInput& input) { 28 | return IteratorReader(input.begin(), 29 | input.end()); 30 | } 31 | } // namespace ARDUINOJSON_NAMESPACE 32 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Deserialization/NestingLimit.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | struct NestingLimit { 12 | NestingLimit() : value(ARDUINOJSON_DEFAULT_NESTING_LIMIT) {} 13 | explicit NestingLimit(uint8_t n) : value(n) {} 14 | 15 | uint8_t value; 16 | }; 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Deserialization/StdStreamReader.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_STD_STREAM 8 | 9 | #include 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | class StdStreamReader { 14 | std::istream& _stream; 15 | char _current; 16 | 17 | public: 18 | explicit StdStreamReader(std::istream& stream) 19 | : _stream(stream), _current(0) {} 20 | 21 | int read() { 22 | return _stream.get(); 23 | } 24 | 25 | private: 26 | StdStreamReader& operator=(const StdStreamReader&); // Visual Studio C4512 27 | }; 28 | 29 | inline StdStreamReader makeReader(std::istream& input) { 30 | return StdStreamReader(input); 31 | } 32 | } // namespace ARDUINOJSON_NAMESPACE 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "BasicJsonDocument.hpp" 8 | 9 | #include // malloc, free 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | struct DefaultAllocator { 14 | void* allocate(size_t n) { 15 | return malloc(n); 16 | } 17 | 18 | void deallocate(void* p) { 19 | free(p); 20 | } 21 | }; 22 | 23 | typedef BasicJsonDocument DynamicJsonDocument; 24 | 25 | } // namespace ARDUINOJSON_NAMESPACE 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Document/StaticJsonDocument.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonDocument.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | class StaticJsonDocument : public JsonDocument { 13 | static const size_t _capacity = 14 | AddPadding::value>::value; 15 | 16 | public: 17 | StaticJsonDocument() : JsonDocument(_buffer, _capacity) {} 18 | 19 | StaticJsonDocument(const StaticJsonDocument& src) 20 | : JsonDocument(_buffer, _capacity) { 21 | set(src); 22 | } 23 | 24 | template 25 | StaticJsonDocument(const T& src, 26 | typename enable_if::value>::type* = 0) 27 | : JsonDocument(_buffer, _capacity) { 28 | set(src); 29 | } 30 | 31 | // disambiguate 32 | StaticJsonDocument(VariantRef src) : JsonDocument(_buffer, _capacity) { 33 | set(src); 34 | } 35 | 36 | StaticJsonDocument operator=(const StaticJsonDocument& src) { 37 | set(src); 38 | return *this; 39 | } 40 | 41 | template 42 | StaticJsonDocument operator=(const T& src) { 43 | set(src); 44 | return *this; 45 | } 46 | 47 | private: 48 | char _buffer[_capacity]; 49 | }; 50 | 51 | } // namespace ARDUINOJSON_NAMESPACE 52 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Json/EscapeSequence.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | class EscapeSequence { 10 | public: 11 | // Optimized for code size on a 8-bit AVR 12 | static char escapeChar(char c) { 13 | const char *p = escapeTable(false); 14 | while (p[0] && p[1] != c) { 15 | p += 2; 16 | } 17 | return p[0]; 18 | } 19 | 20 | // Optimized for code size on a 8-bit AVR 21 | static char unescapeChar(char c) { 22 | const char *p = escapeTable(true); 23 | for (;;) { 24 | if (p[0] == '\0') return c; 25 | if (p[0] == c) return p[1]; 26 | p += 2; 27 | } 28 | } 29 | 30 | private: 31 | static const char *escapeTable(bool excludeIdenticals) { 32 | return &"\"\"\\\\b\bf\fn\nr\rt\t"[excludeIdenticals ? 4 : 0]; 33 | } 34 | }; 35 | } // namespace ARDUINOJSON_NAMESPACE 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Json/Utf8.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | namespace Utf8 { 10 | template 11 | inline void encodeCodepoint(uint16_t codepoint, TStringBuilder &str) { 12 | if (codepoint < 0x80) { 13 | str.append(char(codepoint)); 14 | return; 15 | } 16 | 17 | if (codepoint >= 0x00000800) { 18 | str.append(char(0xe0 /*0b11100000*/ | (codepoint >> 12))); 19 | str.append(char(((codepoint >> 6) & 0x3f /*0b00111111*/) | 0x80)); 20 | } else { 21 | str.append(char(0xc0 /*0b11000000*/ | (codepoint >> 6))); 22 | } 23 | str.append(char((codepoint & 0x3f /*0b00111111*/) | 0x80)); 24 | } 25 | } // namespace Utf8 26 | } // namespace ARDUINOJSON_NAMESPACE 27 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Memory/Alignment.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // size_t 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | inline bool isAligned(void *ptr) { 12 | const size_t mask = sizeof(void *) - 1; 13 | size_t addr = reinterpret_cast(ptr); 14 | return (addr & mask) == 0; 15 | } 16 | 17 | inline size_t addPadding(size_t bytes) { 18 | const size_t mask = sizeof(void *) - 1; 19 | return (bytes + mask) & ~mask; 20 | } 21 | 22 | template 23 | struct AddPadding { 24 | static const size_t mask = sizeof(void *) - 1; 25 | static const size_t value = (bytes + mask) & ~mask; 26 | }; 27 | 28 | } // namespace ARDUINOJSON_NAMESPACE 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Memory/StringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "MemoryPool.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | class StringBuilder { 12 | public: 13 | explicit StringBuilder(MemoryPool* parent) : _parent(parent), _size(0) { 14 | _slot = _parent->allocExpandableString(); 15 | } 16 | 17 | void append(const char* s) { 18 | while (*s) append(*s++); 19 | } 20 | 21 | void append(const char* s, size_t n) { 22 | while (n-- > 0) append(*s++); 23 | } 24 | 25 | void append(char c) { 26 | if (!_slot.value) return; 27 | 28 | if (_size >= _slot.size) { 29 | _slot.value = 0; 30 | return; 31 | } 32 | 33 | _slot.value[_size++] = c; 34 | } 35 | 36 | char* complete() { 37 | append('\0'); 38 | if (_slot.value) { 39 | _parent->freezeString(_slot, _size); 40 | } 41 | return _slot.value; 42 | } 43 | 44 | private: 45 | MemoryPool* _parent; 46 | size_t _size; 47 | StringSlot _slot; 48 | }; 49 | 50 | } // namespace ARDUINOJSON_NAMESPACE 51 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Memory/StringSlot.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // for size_t 8 | #include "../Configuration.hpp" 9 | 10 | #define JSON_STRING_SIZE(SIZE) (SIZE) 11 | 12 | namespace ARDUINOJSON_NAMESPACE { 13 | 14 | struct StringSlot { 15 | char *value; 16 | size_t size; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Misc/Visitable.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | struct Visitable { 12 | // template 13 | // void accept(Visitor&) const; 14 | }; 15 | 16 | template 17 | struct IsVisitable : is_base_of {}; 18 | 19 | template 20 | struct IsVisitable : IsVisitable {}; 21 | } // namespace ARDUINOJSON_NAMESPACE 22 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/MsgPack/endianess.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 8 | #include "../Polyfills/utility.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | #if ARDUINOJSON_LITTLE_ENDIAN 13 | inline void fixEndianess(uint8_t *p, integral_constant) { 14 | swap(p[0], p[7]); 15 | swap(p[1], p[6]); 16 | swap(p[2], p[5]); 17 | swap(p[3], p[4]); 18 | } 19 | 20 | inline void fixEndianess(uint8_t *p, integral_constant) { 21 | swap(p[0], p[3]); 22 | swap(p[1], p[2]); 23 | } 24 | 25 | inline void fixEndianess(uint8_t *p, integral_constant) { 26 | swap(p[0], p[1]); 27 | } 28 | 29 | inline void fixEndianess(uint8_t *, integral_constant) {} 30 | 31 | template 32 | inline void fixEndianess(T &value) { 33 | fixEndianess(reinterpret_cast(&value), 34 | integral_constant()); 35 | } 36 | #else 37 | template 38 | inline void fixEndianess(T &) {} 39 | #endif 40 | 41 | } // namespace ARDUINOJSON_NAMESPACE 42 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/MsgPack/ieee754.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | inline void doubleToFloat(const uint8_t d[8], uint8_t f[4]) { 10 | f[0] = uint8_t((d[0] & 0xC0) | (d[0] << 3 & 0x3f) | (d[1] >> 5)); 11 | f[1] = uint8_t((d[1] << 3) | (d[2] >> 5)); 12 | f[2] = uint8_t((d[2] << 3) | (d[3] >> 5)); 13 | f[3] = uint8_t((d[3] << 3) | (d[4] >> 5)); 14 | } 15 | 16 | } // namespace ARDUINOJSON_NAMESPACE 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Namespace.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "version.hpp" 8 | 9 | #include "Configuration.hpp" 10 | 11 | #define ARDUINOJSON_DO_CONCAT(A, B) A##B 12 | #define ARDUINOJSON_CONCAT2(A, B) ARDUINOJSON_DO_CONCAT(A, B) 13 | #define ARDUINOJSON_CONCAT3(A, B, C) \ 14 | ARDUINOJSON_CONCAT2(A, ARDUINOJSON_CONCAT2(B, C)) 15 | #define ARDUINOJSON_CONCAT4(A, B, C, D) \ 16 | ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT2(A, B), ARDUINOJSON_CONCAT2(C, D)) 17 | #define ARDUINOJSON_CONCAT8(A, B, C, D, E, F, G, H) \ 18 | ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT4(A, B, C, D), \ 19 | ARDUINOJSON_CONCAT4(E, F, G, H)) 20 | #define ARDUINOJSON_CONCAT10(A, B, C, D, E, F, G, H, I, J) \ 21 | ARDUINOJSON_CONCAT8(A, B, C, D, E, F, G, ARDUINOJSON_CONCAT3(H, I, J)) 22 | 23 | #define ARDUINOJSON_NAMESPACE \ 24 | ARDUINOJSON_CONCAT10( \ 25 | ArduinoJson, ARDUINOJSON_VERSION_MAJOR, ARDUINOJSON_VERSION_MINOR, \ 26 | ARDUINOJSON_VERSION_REVISION, _, ARDUINOJSON_USE_LONG_LONG, \ 27 | ARDUINOJSON_USE_DOUBLE, ARDUINOJSON_DECODE_UNICODE, \ 28 | ARDUINOJSON_ENABLE_NAN, ARDUINOJSON_ENABLE_INFINITY) 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Numbers/Float.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | #if ARDUINOJSON_USE_DOUBLE 12 | typedef double Float; 13 | #else 14 | typedef float Float; 15 | #endif 16 | } // namespace ARDUINOJSON_NAMESPACE 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Numbers/Integer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | #include // int64_t 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | #if ARDUINOJSON_USE_LONG_LONG 14 | typedef int64_t Integer; 15 | typedef uint64_t UInt; 16 | #else 17 | typedef long Integer; 18 | typedef unsigned long UInt; 19 | #endif 20 | } // namespace ARDUINOJSON_NAMESPACE 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Numbers/parseFloat.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "convertNumber.hpp" 8 | #include "parseNumber.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | template 13 | inline T parseFloat(const char* s) { 14 | // try to reuse the same parameters as JsonDeserializer 15 | typedef typename choose_largest::type TFloat; 16 | return parseNumber(s).template as(); 17 | } 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Numbers/parseInteger.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 8 | #include "convertNumber.hpp" 9 | #include "parseNumber.hpp" 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | template 13 | T parseInteger(const char *s) { 14 | // try to reuse the same parameters as JsonDeserializer 15 | typedef typename choose_largest::type>::type 16 | TUInt; 17 | return parseNumber(s).template as(); 18 | } 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Object/ObjectFunctions.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Collection/CollectionData.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | void objectAccept(const CollectionData *obj, Visitor &visitor) { 13 | if (obj) 14 | visitor.visitObject(*obj); 15 | else 16 | visitor.visitNull(); 17 | } 18 | 19 | inline bool objectEquals(const CollectionData *lhs, const CollectionData *rhs) { 20 | if (lhs == rhs) return true; 21 | if (!lhs || !rhs) return false; 22 | return lhs->equalsObject(*rhs); 23 | } 24 | 25 | template 26 | inline VariantData *objectGet(const CollectionData *obj, TAdaptedString key) { 27 | if (!obj) return 0; 28 | return obj->get(key); 29 | } 30 | 31 | template 32 | void objectRemove(CollectionData *obj, TAdaptedString key) { 33 | if (!obj) return; 34 | obj->remove(key); 35 | } 36 | 37 | template 38 | inline VariantData *objectGetOrCreate(CollectionData *obj, TAdaptedString key, 39 | MemoryPool *pool) { 40 | if (!obj) return 0; 41 | 42 | // ignore null key 43 | if (key.isNull()) return 0; 44 | 45 | // search a matching key 46 | VariantData *var = obj->get(key); 47 | if (var) return var; 48 | 49 | return obj->add(key, pool); 50 | } 51 | } // namespace ARDUINOJSON_NAMESPACE 52 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Object/Pair.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Strings/String.hpp" 8 | #include "../Variant/VariantRef.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | // A key value pair for CollectionData. 12 | class Pair { 13 | public: 14 | Pair(MemoryPool* pool, VariantSlot* slot) { 15 | if (slot) { 16 | _key = String(slot->key(), !slot->ownsKey()); 17 | _value = VariantRef(pool, slot->data()); 18 | } 19 | } 20 | 21 | String key() const { 22 | return _key; 23 | } 24 | 25 | VariantRef value() const { 26 | return _value; 27 | } 28 | 29 | private: 30 | String _key; 31 | VariantRef _value; 32 | }; 33 | 34 | class PairConst { 35 | public: 36 | PairConst(const VariantSlot* slot) { 37 | if (slot) { 38 | _key = String(slot->key(), !slot->ownsKey()); 39 | _value = VariantConstRef(slot->data()); 40 | } 41 | } 42 | 43 | String key() const { 44 | return _key; 45 | } 46 | 47 | VariantConstRef value() const { 48 | return _value; 49 | } 50 | 51 | private: 52 | String _key; 53 | VariantConstRef _value; 54 | }; 55 | } // namespace ARDUINOJSON_NAMESPACE 56 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Operators/VariantCasts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/attributes.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | class VariantCasts { 13 | public: 14 | template 15 | FORCE_INLINE operator T() const { 16 | return impl()->template as(); 17 | } 18 | 19 | private: 20 | const TImpl *impl() const { 21 | return static_cast(this); 22 | } 23 | }; 24 | } // namespace ARDUINOJSON_NAMESPACE 25 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Operators/VariantOperators.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "VariantCasts.hpp" 8 | #include "VariantComparisons.hpp" 9 | #include "VariantOr.hpp" 10 | #include "VariantShortcuts.hpp" 11 | 12 | namespace ARDUINOJSON_NAMESPACE { 13 | 14 | template 15 | class VariantOperators : public VariantCasts, 16 | public VariantComparisons, 17 | public VariantOr, 18 | public VariantShortcuts {}; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Operators/VariantOr.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/attributes.hpp" 8 | #include "../Polyfills/type_traits.hpp" 9 | #include "../Variant/VariantAs.hpp" 10 | 11 | namespace ARDUINOJSON_NAMESPACE { 12 | 13 | template 14 | class VariantOr { 15 | public: 16 | // Returns the default value if the VariantRef is undefined of incompatible 17 | template 18 | T operator|(const T &defaultValue) const { 19 | if (impl()->template is()) 20 | return impl()->template as(); 21 | else 22 | return defaultValue; 23 | } 24 | 25 | // Returns the default value if the VariantRef is undefined of incompatible 26 | // Special case for string: null is treated as undefined 27 | const char *operator|(const char *defaultValue) const { 28 | const char *value = impl()->template as(); 29 | return value ? value : defaultValue; 30 | } 31 | 32 | private: 33 | const TImpl *impl() const { 34 | return static_cast(this); 35 | } 36 | }; 37 | } // namespace ARDUINOJSON_NAMESPACE 38 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Operators/VariantShortcuts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Array/ArrayShortcuts.hpp" 8 | #include "../Object/ObjectShortcuts.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | template 13 | class VariantShortcuts : public ObjectShortcuts, 14 | public ArrayShortcuts { 15 | public: 16 | using ArrayShortcuts::createNestedArray; 17 | using ArrayShortcuts::createNestedObject; 18 | using ArrayShortcuts::operator[]; 19 | using ObjectShortcuts::createNestedArray; 20 | using ObjectShortcuts::createNestedObject; 21 | using ObjectShortcuts::operator[]; 22 | }; 23 | } // namespace ARDUINOJSON_NAMESPACE 24 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/alias_cast.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include // for size_t 9 | #include "../Configuration.hpp" 10 | #include "../Polyfills/math.hpp" 11 | 12 | namespace ARDUINOJSON_NAMESPACE { 13 | 14 | template 15 | struct alias_cast_t { 16 | union { 17 | F raw; 18 | T data; 19 | }; 20 | }; 21 | 22 | template 23 | T alias_cast(F raw_data) { 24 | alias_cast_t ac; 25 | ac.raw = raw_data; 26 | return ac.data; 27 | } 28 | } // namespace ARDUINOJSON_NAMESPACE 29 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/assert.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef ARDUINOJSON_DEBUG 8 | #include 9 | #define ARDUINOJSON_ASSERT(X) assert(X) 10 | #else 11 | #define ARDUINOJSON_ASSERT(X) ((void)0) 12 | #endif 13 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/attributes.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef _MSC_VER // Visual Studio 8 | 9 | #define FORCE_INLINE // __forceinline causes C4714 when returning std::string 10 | #define NO_INLINE __declspec(noinline) 11 | #define DEPRECATED(msg) __declspec(deprecated(msg)) 12 | 13 | #elif defined(__GNUC__) // GCC or Clang 14 | 15 | #define FORCE_INLINE __attribute__((always_inline)) 16 | #define NO_INLINE __attribute__((noinline)) 17 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) 18 | #define DEPRECATED(msg) __attribute__((deprecated(msg))) 19 | #else 20 | #define DEPRECATED(msg) __attribute__((deprecated)) 21 | #endif 22 | 23 | #else // Other compilers 24 | 25 | #define FORCE_INLINE 26 | #define NO_INLINE 27 | #define DEPRECATED(msg) 28 | 29 | #endif 30 | 31 | #if __cplusplus >= 201103L 32 | #define NOEXCEPT noexcept 33 | #else 34 | #define NOEXCEPT throw() 35 | #endif 36 | 37 | #if defined(__has_attribute) 38 | #if __has_attribute(no_sanitize) 39 | #define ARDUINOJSON_NO_SANITIZE(check) __attribute__((no_sanitize(check))) 40 | #else 41 | #define ARDUINOJSON_NO_SANITIZE(check) 42 | #endif 43 | #else 44 | #define ARDUINOJSON_NO_SANITIZE(check) 45 | #endif 46 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/ctype.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | inline bool isdigit(char c) { 10 | return '0' <= c && c <= '9'; 11 | } 12 | 13 | inline bool issign(char c) { 14 | return '-' == c || c == '+'; 15 | } 16 | } // namespace ARDUINOJSON_NAMESPACE 17 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/gsl/not_null.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../assert.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | class not_null { 13 | public: 14 | explicit not_null(T ptr) : _ptr(ptr) { 15 | ARDUINOJSON_ASSERT(ptr != NULL); 16 | } 17 | 18 | T get() const { 19 | ARDUINOJSON_ASSERT(_ptr != NULL); 20 | return _ptr; 21 | } 22 | 23 | private: 24 | T _ptr; 25 | }; 26 | 27 | template 28 | not_null make_not_null(T ptr) { 29 | ARDUINOJSON_ASSERT(ptr != NULL); 30 | return not_null(ptr); 31 | } 32 | 33 | } // namespace ARDUINOJSON_NAMESPACE 34 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/limits.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Polyfills/type_traits.hpp" 8 | 9 | #ifdef _MSC_VER 10 | #pragma warning(push) 11 | #pragma warning(disable : 4310) 12 | #endif 13 | 14 | namespace ARDUINOJSON_NAMESPACE { 15 | 16 | // Differs from standard because we can't use the symbols "min" and "max" 17 | template 18 | struct numeric_limits; 19 | 20 | template 21 | struct numeric_limits::value>::type> { 22 | static T lowest() { 23 | return 0; 24 | } 25 | static T highest() { 26 | return T(-1); 27 | } 28 | }; 29 | 30 | template 31 | struct numeric_limits< 32 | T, typename enable_if::value && is_signed::value>::type> { 33 | static T lowest() { 34 | return T(T(1) << (sizeof(T) * 8 - 1)); 35 | } 36 | static T highest() { 37 | return T(~lowest()); 38 | } 39 | }; 40 | 41 | } // namespace ARDUINOJSON_NAMESPACE 42 | 43 | #ifdef _MSC_VER 44 | #pragma warning(pop) 45 | #endif 46 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/math.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // Some libraries #define isnan() and isinf() so we need to check before 10 | // using this name 11 | 12 | #ifndef isnan 13 | template 14 | bool isnan(T x) { 15 | return x != x; 16 | } 17 | #endif 18 | 19 | #ifndef isinf 20 | template 21 | bool isinf(T x) { 22 | return x != 0.0 && x * 2 == x; 23 | } 24 | #endif 25 | } // namespace ARDUINOJSON_NAMESPACE 26 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/mpl/max.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // for size_t 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | // A meta-function that returns the highest value 12 | template Y)> 13 | struct Max {}; 14 | 15 | template 16 | struct Max { 17 | static const size_t value = X; 18 | }; 19 | 20 | template 21 | struct Max { 22 | static const size_t value = Y; 23 | }; 24 | } // namespace ARDUINOJSON_NAMESPACE 25 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/safe_strcmp.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | inline int8_t safe_strcmp(const char* a, const char* b) { 10 | if (a == b) return 0; 11 | if (!a) return -1; 12 | if (!b) return 1; 13 | return static_cast(strcmp(a, b)); 14 | } 15 | 16 | inline int8_t safe_strncmp(const char* a, const char* b, size_t n) { 17 | if (a == b) return 0; 18 | if (!a) return -1; 19 | if (!b) return 1; 20 | return static_cast(strncmp(a, b, n)); 21 | } 22 | } // namespace ARDUINOJSON_NAMESPACE 23 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "type_traits/conditional.hpp" 8 | #include "type_traits/enable_if.hpp" 9 | #include "type_traits/integral_constant.hpp" 10 | #include "type_traits/is_array.hpp" 11 | #include "type_traits/is_base_of.hpp" 12 | #include "type_traits/is_const.hpp" 13 | #include "type_traits/is_floating_point.hpp" 14 | #include "type_traits/is_integral.hpp" 15 | #include "type_traits/is_same.hpp" 16 | #include "type_traits/is_signed.hpp" 17 | #include "type_traits/is_unsigned.hpp" 18 | #include "type_traits/make_unsigned.hpp" 19 | #include "type_traits/remove_const.hpp" 20 | #include "type_traits/remove_reference.hpp" 21 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/conditional.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | template 10 | struct conditional { 11 | typedef TrueType type; 12 | }; 13 | 14 | template 15 | struct conditional { 16 | typedef FalseType type; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/enable_if.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that return the type T if Condition is true. 10 | template 11 | struct enable_if {}; 12 | 13 | template 14 | struct enable_if { 15 | typedef T type; 16 | }; 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/integral_constant.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | template 10 | struct integral_constant { 11 | static const T value = v; 12 | }; 13 | 14 | typedef integral_constant true_type; 15 | typedef integral_constant false_type; 16 | 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_array.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // size_t 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | struct is_array : false_type {}; 13 | 14 | template 15 | struct is_array : true_type {}; 16 | 17 | template 18 | struct is_array : true_type {}; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_base_of.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that returns true if Derived inherits from TBase is an 10 | // integral type. 11 | template 12 | class is_base_of { 13 | protected: // <- to avoid GCC's "all member functions in class are private" 14 | typedef char Yes[1]; 15 | typedef char No[2]; 16 | 17 | static Yes &probe(const TBase *); 18 | static No &probe(...); 19 | 20 | public: 21 | static const bool value = 22 | sizeof(probe(reinterpret_cast(0))) == sizeof(Yes); 23 | }; 24 | } // namespace ARDUINOJSON_NAMESPACE 25 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_const.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | // A meta-function that return the type T without the const modifier 12 | template 13 | struct is_const : false_type {}; 14 | 15 | template 16 | struct is_const : true_type {}; 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_floating_point.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | struct is_floating_point : false_type {}; 13 | 14 | template <> 15 | struct is_floating_point : true_type {}; 16 | 17 | template <> 18 | struct is_floating_point : true_type {}; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_integral.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../../Configuration.hpp" 8 | #include "is_same.hpp" 9 | 10 | namespace ARDUINOJSON_NAMESPACE { 11 | 12 | // A meta-function that returns true if T is an integral type. 13 | template 14 | struct is_integral { 15 | static const bool value = 16 | is_same::value || is_same::value || 17 | is_same::value || is_same::value || 18 | is_same::value || is_same::value || 19 | is_same::value || is_same::value || 20 | #if ARDUINOJSON_HAS_LONG_LONG 21 | is_same::value || 22 | is_same::value || 23 | #endif 24 | #if ARDUINOJSON_HAS_INT64 25 | is_same::value || 26 | is_same::value || 27 | #endif 28 | is_same::value; 29 | 30 | // CAUTION: differs from std::is_integral as it doesn't include bool 31 | }; 32 | 33 | template 34 | struct is_integral : is_integral {}; 35 | } // namespace ARDUINOJSON_NAMESPACE 36 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_same.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | // A meta-function that returns true if types T and U are the same. 12 | template 13 | struct is_same : false_type {}; 14 | 15 | template 16 | struct is_same : true_type {}; 17 | } // namespace ARDUINOJSON_NAMESPACE 18 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | namespace ARDUINOJSON_NAMESPACE { 9 | 10 | template 11 | struct is_signed : false_type {}; 12 | 13 | template <> 14 | struct is_signed : true_type {}; 15 | 16 | template <> 17 | struct is_signed : true_type {}; 18 | 19 | template <> 20 | struct is_signed : true_type {}; 21 | 22 | template <> 23 | struct is_signed : true_type {}; 24 | 25 | template <> 26 | struct is_signed : true_type {}; 27 | 28 | template <> 29 | struct is_signed : true_type {}; 30 | 31 | template <> 32 | struct is_signed : true_type {}; 33 | 34 | #if ARDUINOJSON_HAS_LONG_LONG 35 | template <> 36 | struct is_signed : true_type {}; 37 | #endif 38 | 39 | #if ARDUINOJSON_HAS_INT64 40 | template <> 41 | struct is_signed : true_type {}; 42 | #endif 43 | } // namespace ARDUINOJSON_NAMESPACE 44 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | namespace ARDUINOJSON_NAMESPACE { 9 | 10 | template 11 | struct is_unsigned : false_type {}; 12 | 13 | template <> 14 | struct is_unsigned : true_type {}; 15 | 16 | template <> 17 | struct is_unsigned : true_type {}; 18 | 19 | template <> 20 | struct is_unsigned : true_type {}; 21 | 22 | template <> 23 | struct is_unsigned : true_type {}; 24 | 25 | template <> 26 | struct is_unsigned : true_type {}; 27 | 28 | #if ARDUINOJSON_HAS_INT64 29 | template <> 30 | struct is_unsigned : true_type {}; 31 | #endif 32 | 33 | #if ARDUINOJSON_HAS_LONG_LONG 34 | template <> 35 | struct is_unsigned : true_type {}; 36 | #endif 37 | } // namespace ARDUINOJSON_NAMESPACE 38 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/remove_const.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that return the type T without the const modifier 10 | template 11 | struct remove_const { 12 | typedef T type; 13 | }; 14 | template 15 | struct remove_const { 16 | typedef T type; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/remove_reference.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A meta-function that return the type T without the reference modifier. 10 | template 11 | struct remove_reference { 12 | typedef T type; 13 | }; 14 | template 15 | struct remove_reference { 16 | typedef T type; 17 | }; 18 | } // namespace ARDUINOJSON_NAMESPACE 19 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/type_traits/type_identity.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "integral_constant.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template 12 | struct type_identity { 13 | typedef T type; 14 | }; 15 | } // namespace ARDUINOJSON_NAMESPACE 16 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Polyfills/utility.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | template 9 | inline void swap(T& a, T& b) { 10 | T t(a); 11 | a = b; 12 | b = t; 13 | } 14 | } // namespace ARDUINOJSON_NAMESPACE 15 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Serialization/DummyWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | class DummyWriter { 10 | public: 11 | size_t write(uint8_t) { 12 | return 1; 13 | } 14 | 15 | size_t write(const uint8_t*, size_t n) { 16 | return n; 17 | } 18 | }; 19 | } // namespace ARDUINOJSON_NAMESPACE 20 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Serialization/StaticStringWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ARDUINOJSON_NAMESPACE { 8 | 9 | // A Print implementation that allows to write in a char[] 10 | class StaticStringWriter { 11 | public: 12 | StaticStringWriter(char *buf, size_t size) : end(buf + size - 1), p(buf) { 13 | *p = '\0'; 14 | } 15 | 16 | size_t write(uint8_t c) { 17 | if (p >= end) return 0; 18 | *p++ = static_cast(c); 19 | *p = '\0'; 20 | return 1; 21 | } 22 | 23 | size_t write(const uint8_t *s, size_t n) { 24 | char *begin = p; 25 | while (p < end && n > 0) { 26 | *p++ = static_cast(*s++); 27 | n--; 28 | } 29 | *p = '\0'; 30 | return size_t(p - begin); 31 | } 32 | 33 | private: 34 | char *end; 35 | char *p; 36 | }; 37 | } // namespace ARDUINOJSON_NAMESPACE 38 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Serialization/StreamWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | #if ARDUINOJSON_ENABLE_STD_STREAM 10 | 11 | #include 12 | 13 | namespace ARDUINOJSON_NAMESPACE { 14 | 15 | class StreamWriter { 16 | public: 17 | explicit StreamWriter(std::ostream& os) : _os(os) {} 18 | 19 | size_t write(uint8_t c) { 20 | _os << c; 21 | return 1; 22 | } 23 | 24 | size_t write(const uint8_t* s, size_t n) { 25 | _os.write(reinterpret_cast(s), 26 | static_cast(n)); 27 | return n; 28 | } 29 | 30 | private: 31 | // cannot be assigned 32 | StreamWriter& operator=(const StreamWriter&); 33 | 34 | std::ostream& _os; 35 | }; 36 | } // namespace ARDUINOJSON_NAMESPACE 37 | 38 | #endif // ARDUINOJSON_ENABLE_STD_STREAM 39 | -------------------------------------------------------------------------------- /lib/ArduinoJson_ID64/src/ArduinoJson/Serialization/measure.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "./DummyWriter.hpp" 8 | 9 | namespace ARDUINOJSON_NAMESPACE { 10 | 11 | template