Merge branch 'dg101' of http://192.168.0.10:3000/pandx/WLG into dg101
# Conflicts: # .vscode/settings.json
This commit is contained in:
commit
4f835b395f
@ -11,7 +11,7 @@ public:
|
||||
|
||||
void DataNodeStatusCheck();
|
||||
// mqtt command
|
||||
std::string JsonCmd_07(); //获取系统内存温度硬盘等信息
|
||||
int JsonCmd_07(); //获取系统内存温度硬盘等信息
|
||||
std::string JsonCmd_20(Param_20 ¶m);
|
||||
std::string JsonCmd_22(Param_22 ¶m); //时区配置
|
||||
std::string JsonCmd_23(Param_23 ¶m); //服务器配置
|
||||
|
||||
@ -492,9 +492,9 @@ int JsonData::JsonCmd_29() {
|
||||
jsonVal.clear();
|
||||
jsonVal["cmd"] = "29";
|
||||
jsonVal["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
|
||||
jsSystemSetting["WebVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "WebVersion");
|
||||
jsSystemSetting["SystemVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "SystemVersion");
|
||||
jsSystemSetting["GateWayVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayVersion");
|
||||
jsBody["WebVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "WebVersion");
|
||||
jsBody["SystemVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "SystemVersion");
|
||||
jsBody["GateWayVersion"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayVersion");
|
||||
jsBody["localIP"] = GlobalConfig::IpAddr_G;
|
||||
jsBody["dataNodeGatewayType"] = ReadStrByOpt(SYSTEMINFOFILE, "Version", "GateWayProduct");
|
||||
jsBody["CommMode"] = "有线";
|
||||
@ -591,7 +591,7 @@ int JsonData::JsonCmd_30(){
|
||||
std::vector<std::string> vParambattery;
|
||||
boost::split(vParambattery, arrRes[j][43], boost::is_any_of(","), boost::token_compress_on);
|
||||
if (vParambattery.size() > 1) {
|
||||
jsSensorData["battery"] = atoi(vParambattery[1].c_str())/atoi(vParambattery[0].c_str());
|
||||
jsSensorData["battery"] = float(atof(vParambattery[1].c_str())/atof(vParambattery[0].c_str()));
|
||||
} else {
|
||||
jsSensorData["battery"] = 0.99;
|
||||
}
|
||||
@ -727,7 +727,7 @@ void JsonData::DataNodeStatusCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
std::string JsonData::JsonCmd_07() {
|
||||
int JsonData::JsonCmd_07() {
|
||||
Json::Value jsonVal;
|
||||
jsonVal.clear();
|
||||
Json::Value jsData;
|
||||
@ -749,5 +749,6 @@ std::string JsonData::JsonCmd_07() {
|
||||
jsonVal["success"] = false;
|
||||
jsonVal["message"] = "状态获取失败";
|
||||
}
|
||||
return show_value_.write(jsonVal);
|
||||
data_publish(show_value_.write(jsonVal).c_str(), GlobalConfig::Topic_G.mPubStatus.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -45,11 +45,11 @@ void LocalServer::HandleFromServer(const char *pData_r, int pLen, const char *to
|
||||
}
|
||||
|
||||
switch (cmdType) {
|
||||
case kHWStatus: {
|
||||
JsonData jd;
|
||||
std::string data = jd.JsonCmd_07();
|
||||
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
|
||||
} break;
|
||||
// case kHWStatus: {
|
||||
// JsonData jd;
|
||||
// std::string data = jd.JsonCmd_07();
|
||||
// data_publish(data.c_str(), GlobalConfig::Topic_G.mPubCmd.c_str());
|
||||
// } break;
|
||||
case kRebootSystem: {
|
||||
recvValue["dataNodeGatewayNo"] = GlobalConfig::MacAddr_G;
|
||||
recvValue["status"] = "ACK";
|
||||
|
||||
@ -97,8 +97,7 @@ void CheckThread() {
|
||||
}
|
||||
if (HardStatus == 3600) { // one hour 3600
|
||||
JsonData jd;
|
||||
std::string data = jd.JsonCmd_07();
|
||||
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubStatus.c_str());
|
||||
jd.JsonCmd_07();
|
||||
HardStatus = 0;
|
||||
}
|
||||
if (mqttresend == 7200) {
|
||||
@ -116,7 +115,7 @@ void CheckThread() {
|
||||
}
|
||||
}
|
||||
|
||||
if (600 == online_check) {
|
||||
if (120 == online_check) {
|
||||
online_check = 0;
|
||||
int Count = sqlite_db_ctrl::instance().GetTableRows(T_SENSOR_INFO(TNAME), NULL);
|
||||
JsonData jd;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user