diff --git a/bin/firmware.bin b/bin/firmware.bin index 4298122..d734ad0 100644 Binary files a/bin/firmware.bin and b/bin/firmware.bin differ diff --git a/bin/firmware32.bin b/bin/firmware32.bin index 0aaf4e9..838a03c 100644 Binary files a/bin/firmware32.bin and b/bin/firmware32.bin differ diff --git a/bin/firmware32c3.bin b/bin/firmware32c3.bin index 6fad862..e09c1ba 100644 Binary files a/bin/firmware32c3.bin and b/bin/firmware32c3.bin differ diff --git a/bin/firmware32c3v1.bin b/bin/firmware32c3v1.bin index d35bdf8..2930575 100644 Binary files a/bin/firmware32c3v1.bin and b/bin/firmware32c3v1.bin differ diff --git a/bin/firmware32lite.bin b/bin/firmware32lite.bin index 9d9f83d..9f48e27 100644 Binary files a/bin/firmware32lite.bin and b/bin/firmware32lite.bin differ diff --git a/bin/firmware32s2.bin b/bin/firmware32s2.bin index 854d95a..e65cac6 100644 Binary files a/bin/firmware32s2.bin and b/bin/firmware32s2.bin differ diff --git a/bin/version.json b/bin/version.json index e65581c..6196cdc 100644 --- a/bin/version.json +++ b/bin/version.json @@ -1 +1 @@ -{ "project":"gravmon", "version":"1.2.0", "html": [ ] } \ No newline at end of file +{ "project":"gravmon", "version":"1.2.1", "html": [ ] } \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index ca02814..6a2640a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -39,21 +39,21 @@ build_flags = -DUSE_LITTLEFS=true -DUSER_SSID=\""\"" # =\""myssid\"" -DUSER_SSID_PWD=\""\"" # =\""mypwd\"" - -DCFG_APPVER="\"1.2.0\"" + -DCFG_APPVER="\"1.2.1\"" #-DCFG_GITREV=\""beta-3\"" !python script/git_rev.py lib_deps = # Using local copy of these libraries - # https://github.com/mp-se/i2cdevlib.git# + # https://github.com/mp-se/i2cdevlib.git# # https://github.com/mp-se/OneWire # https://github.com/mp-se/Arduino-Temperature-Control-Library # https://github.com/khoih-prog/ESP_WiFiManager # https://github.com/khoih-prog/ESP_DoubleResetDetector - https://github.com/mp-se/tinyexpr # https://github.com/codeplea/tinyexpr + https://github.com/mp-se/tinyexpr # https://github.com/codeplea/tinyexpr https://github.com/mp-se/Arduino-Log#1.1.1 # https://github.com/thijse/Arduino-Log - https://github.com/mp-se/ArduinoJson#v6.18.5 # https://github.com/bblanchon/ArduinoJson - https://github.com/mp-se/arduinoCurveFitting#v1.0.6 # https://github.com/Rotario/arduinoCurveFitting - https://github.com/mp-se/arduino-mqtt#v2.5.0 # https://github.com/256dpi/arduino-mqtt + https://github.com/mp-se/ArduinoJson#v6.18.5 # https://github.com/bblanchon/ArduinoJson + https://github.com/mp-se/arduinoCurveFitting#v1.0.6 # https://github.com/Rotario/arduinoCurveFitting + https://github.com/mp-se/arduino-mqtt#v2.5.0 # https://github.com/256dpi/arduino-mqtt lib_deps32 = https://github.com/mp-se/NimBLE-Arduino#1.3.8 # https://github.com/h2zero/NimBLE-Arduino extra_scripts = @@ -102,8 +102,10 @@ lib_deps = ${common_env_data.lib_deps} board = ${common_env_data.board} build_type = release +#build_type = debug board_build.filesystem = littlefs build_src_filter = +<*> -<../test/tests*.cpp> +monitor_filters = esp8266_exception_decoder [env:gravity-unit] upload_speed = ${common_env_data.upload_speed} @@ -120,9 +122,10 @@ lib_deps = https://github.com/bxparks/AUnit#v1.6.1 ${common_env_data.lib_deps} board = ${common_env_data.board} -build_type = release +build_type = debug board_build.filesystem = littlefs build_src_filter = +<*> - +<../test/tests*.cpp> +monitor_filters = esp8266_exception_decoder [env:gravity32-release] framework = ${common_env_data.framework} diff --git a/src/templating.cpp b/src/templating.cpp index 5a0b65a..0ed0741 100644 --- a/src/templating.cpp +++ b/src/templating.cpp @@ -194,4 +194,17 @@ const char* TemplatingEngine::create(TemplatingEngine::Templates idx, return ""; } +// added to support more unit test scenarios. +const char* TemplatingEngine::create(const char* formatTemplate) { + _baseTemplate = String(formatTemplate); + + // Insert data into template. + transform(); + _baseTemplate.clear(); + + if (_output) return _output; + + return ""; +} + // EOF diff --git a/src/templating.hpp b/src/templating.hpp index f6f0bac..349b8c5 100644 --- a/src/templating.hpp +++ b/src/templating.hpp @@ -160,7 +160,8 @@ class TemplatingEngine { } } } - strncat(_output, format + k, size - k); + // strncat(_output, format + k, size - k); + strncat(_output, format + k, strlen(format + k)); Log.notice(F("TPL : Transformed template %d chars to %d chars" CR), strlen(format), strlen(_output)); @@ -202,6 +203,7 @@ class TemplatingEngine { float tempC, float runTime); const char *create(TemplatingEngine::Templates idx, bool useDefaultTemplate = false); + const char *create(const char *formatTemplate); }; #endif // SRC_TEMPLATING_HPP_ diff --git a/src_docs/source/index.rst b/src_docs/source/index.rst index 68f3faf..87a0f49 100644 --- a/src_docs/source/index.rst +++ b/src_docs/source/index.rst @@ -7,7 +7,7 @@ Welcome to GravityMon ##################### .. note:: - This documentation reflects **v1.2.0**. Last updated 2022-12-06 + This documentation reflects **v1.2.1**. Last updated 2023-01-23 What is GravityMon? -------------------- diff --git a/src_docs/source/releases.rst b/src_docs/source/releases.rst index 90f7819..091adaf 100644 --- a/src_docs/source/releases.rst +++ b/src_docs/source/releases.rst @@ -3,6 +3,17 @@ Releases ######## +v1.2.1 +====== + +Issues adressed +++++++++++++++++ +* BUG: Under some circumstances the last part of the format template was omitted. + +Other ++++++ +* Update tinyexpr library to latest baseline. For forumula evaluation. + v1.2.0 ====== diff --git a/test/tests_templating.cpp b/test/tests_templating.cpp index 8168ea3..ba69c8f 100644 --- a/test/tests_templating.cpp +++ b/test/tests_templating.cpp @@ -125,4 +125,26 @@ test(template_applyTemplate5) { assertEqual(s, v); } +test(template_applyTemplate6) { + TemplatingEngine e; + char buffer[20]; + myConfig.setMDNS("gravitymon"); + + const char* tpl = + "Densite1${gravity}" + "Batterie1${battery}" + "Temperature1${temp}"; + + e.initialize(45.0, 1.123, 1.223, 21.2, 2.98); + String s = e.create(tpl); + String batt = + convertFloatToString(myBatteryVoltage.getVoltage(), &buffer[0], 2); + batt.trim(); + + String v = "Densite11.1230" + "Batterie1" + batt + "" + "Temperature121.2"; + assertEqual(s, v); +} + // EOF