mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
show release in log instead of branch (#1660)
Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -44,6 +44,7 @@ extern const char* GIT_REV;
|
|||||||
extern const char* GIT_BRANCH;
|
extern const char* GIT_BRANCH;
|
||||||
extern const char* BUILD_TIME;
|
extern const char* BUILD_TIME;
|
||||||
|
|
||||||
|
extern std::string getFwVersion(void);
|
||||||
extern std::string getHTMLversion(void);
|
extern std::string getHTMLversion(void);
|
||||||
extern std::string getHTMLcommit(void);
|
extern std::string getHTMLcommit(void);
|
||||||
|
|
||||||
@@ -155,8 +156,7 @@ extern "C" void app_main(void)
|
|||||||
return; // No way to continue without SD-Card!
|
return; // No way to continue without SD-Card!
|
||||||
}
|
}
|
||||||
|
|
||||||
string versionFormated = "Branch: '" + std::string(GIT_BRANCH) + \
|
string versionFormated = getFwVersion() + ", Date/Time: " + std::string(BUILD_TIME) + \
|
||||||
"', Revision: " + std::string(GIT_REV) +", Date/Time: " + std::string(BUILD_TIME) + \
|
|
||||||
", Web UI: " + getHTMLversion();
|
", Web UI: " + getHTMLversion();
|
||||||
|
|
||||||
if (std::string(GIT_TAG) != "") { // We are on a tag, add it as prefix
|
if (std::string(GIT_TAG) != "") { // We are on a tag, add it as prefix
|
||||||
|
|||||||
@@ -74,15 +74,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
}
|
}
|
||||||
else if (_task.compare("FirmwareVersion") == 0)
|
else if (_task.compare("FirmwareVersion") == 0)
|
||||||
{
|
{
|
||||||
string buf;
|
httpd_resp_sendstr_chunk(req, getFwVersion().c_str());
|
||||||
if (std::string(GIT_TAG) == "") { // Tag not set, show branch
|
|
||||||
buf = "Development-Branch: " + std::string(GIT_BRANCH);
|
|
||||||
}
|
|
||||||
else { // Tag is set, ignore branch
|
|
||||||
buf = "Release: " + std::string(GIT_TAG);
|
|
||||||
}
|
|
||||||
buf = buf + " (Commit: " + std::string(GIT_REV) + ")";
|
|
||||||
httpd_resp_sendstr_chunk(req, buf.c_str());
|
|
||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,19 @@ const char* libfive_git_branch(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string getFwVersion(void) {
|
||||||
|
std::string buf;
|
||||||
|
if (std::string(GIT_TAG) == "") { // Tag not set, show branch
|
||||||
|
buf = "Development-Branch: " + std::string(GIT_BRANCH);
|
||||||
|
}
|
||||||
|
else { // Tag is set, ignore branch
|
||||||
|
buf = "Release: " + std::string(GIT_TAG);
|
||||||
|
}
|
||||||
|
buf = buf + " (Commit: " + std::string(GIT_REV) + ")";
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
std::string getHTMLversion(void){
|
std::string getHTMLversion(void){
|
||||||
char buf[100]="?\0";
|
char buf[100]="?\0";
|
||||||
FILE* pFile;
|
FILE* pFile;
|
||||||
|
|||||||
Reference in New Issue
Block a user