mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 12:36:52 +03:00
72 lines
1.3 KiB
C++
72 lines
1.3 KiB
C++
#ifndef _VERSION_H
|
|
#define _VERSION_H
|
|
|
|
// These variables are autogenerated and compiled
|
|
// into the library by the version.cmake script
|
|
extern "C"
|
|
{
|
|
extern const char* GIT_TAG;
|
|
extern const char* GIT_REV;
|
|
extern const char* GIT_BRANCH;
|
|
extern const char* BUILD_TIME;
|
|
}
|
|
|
|
#include <string>
|
|
#include <string.h>
|
|
#include "Helper.h"
|
|
#include <fstream>
|
|
|
|
|
|
const char* build_time(void)
|
|
{
|
|
return BUILD_TIME;
|
|
}
|
|
|
|
const char* libfive_git_version(void)
|
|
{
|
|
return GIT_TAG;
|
|
}
|
|
|
|
const char* libfive_git_revision(void)
|
|
{
|
|
return GIT_REV;
|
|
}
|
|
|
|
const char* libfive_git_branch(void)
|
|
{
|
|
return GIT_BRANCH;
|
|
}
|
|
|
|
|
|
std::string getHTMLversion(void){
|
|
char buf[100]="?\0";
|
|
FILE* pFile;
|
|
string fn = FormatFileName("/sdcard/html/version.txt");
|
|
pFile = fopen(fn.c_str(), "r");
|
|
|
|
if (pFile == NULL)
|
|
return std::string(buf);
|
|
|
|
fgets(buf, sizeof(buf), pFile); // Line 1: Version
|
|
fclose(pFile);
|
|
|
|
return std::string(buf);
|
|
}
|
|
|
|
std::string getHTMLcommit(void){
|
|
char buf[100]="?\0";
|
|
FILE* pFile;
|
|
string fn = FormatFileName("/sdcard/html/version.txt");
|
|
pFile = fopen(fn.c_str(), "r");
|
|
|
|
if (pFile == NULL)
|
|
return std::string(buf);
|
|
|
|
fgets(buf, sizeof(buf), pFile); // Line 1: Version -> ignored
|
|
fgets(buf, sizeof(buf), pFile); // Line 2: Commit
|
|
fclose(pFile);
|
|
|
|
return std::string(buf);
|
|
}
|
|
|
|
#endif // _VERSION_H
|