From 5a633ddf66e916e45f3cb63c7cf5389bfca67bca Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Sat, 8 Feb 2025 11:39:21 +0800 Subject: [PATCH] modify code --- common/common_func.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/common_func.cpp b/common/common_func.cpp index ffcd0a2..1fd6422 100644 --- a/common/common_func.cpp +++ b/common/common_func.cpp @@ -986,10 +986,20 @@ void GetSysStatusCMT(int& cpu_use,int& mem_use,int& disk_remain,int& cpu_temp) } char hardTotal[32]; char hardFree[32]; + char rateHardUse[32]; char chRes[100]; memset(chRes, 0, 100); - getDiskInfo(hardTotal, hardFree); + + char hardName[32]; + char hardUse[32]; + const char *getEmmcInfo = "df -h | grep /opt"; + system_custom(getEmmcInfo, chRes); + sscanf(chRes, "%s%s%s%s%s", hardName, hardTotal, hardUse, hardFree, rateHardUse); + + std::string strhardTotal(hardTotal); std::string strhardFree(hardFree); + std::string strrateHardUse(rateHardUse); + char key[128] = {0}; memset(key, 0, sizeof(key)); sprintf(key, "/sys/class/thermal/thermal_zone0/temp");