diff --git a/code/src/server_main.cpp b/code/src/server_main.cpp index 81eadf39..bfe085ef 100644 --- a/code/src/server_main.cpp +++ b/code/src/server_main.cpp @@ -83,6 +83,14 @@ esp_err_t info_get_handler(httpd_req_t *req) return ESP_OK; } + if (_task.compare("HTMLVersion") == 0) + { + std::string zw; + zw = std::string(getHTMLversion()); + httpd_resp_sendstr_chunk(req, zw.c_str()); + httpd_resp_sendstr_chunk(req, NULL); + return ESP_OK; + } return ESP_OK; } diff --git a/code/src/server_tflite.cpp b/code/src/server_tflite.cpp index e2f0985e..5af665fd 100644 --- a/code/src/server_tflite.cpp +++ b/code/src/server_tflite.cpp @@ -18,6 +18,8 @@ #include "ClassLogFile.h" +#include "version.h" + ClassFlowControll tfliteflow; TaskHandle_t xHandleblink_task_doFlow = NULL; @@ -417,11 +419,19 @@ esp_err_t handler_sysinfo(httpd_req_t *req) const char* resp_str; string zw; string cputemp = std::to_string(temperatureRead()); + string gitversion = libfive_git_version(); + string buildtime = build_time(); + string gitbranch = libfive_git_branch(); + string gitbasebranch = git_base_branch(); + string htmlversion = getHTMLversion(); zw = "[\ {\ - \"firmware\" : \"2.0.0\",\ - \"html\" : \"1.0.1\",\ + \"firmware\" : \"" + gitversion + "\",\ + \"buildtime\" : \"" + buildtime + "\",\ + \"gitbranch\" : \"" + gitbranch + "\",\ + \"gitbasebranch\" : \"" + gitbasebranch + "\",\ + \"html\" : \"" + htmlversion + "\",\ \"cputemp\" : \"" + cputemp + "\",\ \"hostname\" : \"host\",\ \"IPv4\" : \"IP\"\ diff --git a/code/src/version.cpp b/code/src/version.cpp index 7b7c01e5..b14ca2b6 100644 --- a/code/src/version.cpp +++ b/code/src/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="bafd67b"; +const char* GIT_REV="9080f1d+"; const char* GIT_TAG=""; -const char* GIT_BRANCH="master"; -const char* BUILD_TIME="2020-09-28 19:57"; \ No newline at end of file +const char* GIT_BRANCH="rolling"; +const char* BUILD_TIME="2020-09-28 23:50"; \ No newline at end of file diff --git a/code/src/version.h b/code/src/version.h index 2f571e91..d58f9ecc 100644 --- a/code/src/version.h +++ b/code/src/version.h @@ -8,6 +8,8 @@ extern "C" extern const char* BUILD_TIME; } +#include + const char* GIT_BASE_BRANCH = "master - v2.1.1 - 2020-09-28"; @@ -35,4 +37,22 @@ const char* libfive_git_revision(void) const char* libfive_git_branch(void) { return GIT_BRANCH; +} + +std::string getHTMLversion(void){ + + string line = ""; + + FILE* pFile; + string fn = FormatFileName("/sdcard/html/version.txt"); + pFile = fopen(fn.c_str(), "r"); + + if (pFile == NULL) + return std::string("NAN"); + + char zw[1024]; + fgets(zw, 1024, pFile); + line = std::string(trim(zw)); + + return line; } \ No newline at end of file diff --git a/code/version.cpp b/code/version.cpp index 7b7c01e5..b14ca2b6 100644 --- a/code/version.cpp +++ b/code/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="bafd67b"; +const char* GIT_REV="9080f1d+"; const char* GIT_TAG=""; -const char* GIT_BRANCH="master"; -const char* BUILD_TIME="2020-09-28 19:57"; \ No newline at end of file +const char* GIT_BRANCH="rolling"; +const char* BUILD_TIME="2020-09-28 23:50"; \ No newline at end of file diff --git a/sd-card/html/info.html b/sd-card/html/info.html index c898d55e..8729c71f 100644 --- a/sd-card/html/info.html +++ b/sd-card/html/info.html @@ -3,7 +3,7 @@ Set PreValue - + - + + @@ -38,7 +38,7 @@ div { - + @@ -49,7 +49,7 @@ div { - + @@ -60,7 +60,7 @@ div { - + @@ -71,9 +71,20 @@ div { + + + + + HTML Version: + + +
+ +
+ - \ No newline at end of file + diff --git a/sd-card/html/version.txt b/sd-card/html/version.txt new file mode 100644 index 00000000..3eefcb9d --- /dev/null +++ b/sd-card/html/version.txt @@ -0,0 +1 @@ +1.0.0