修复bug

This commit is contained in:
zhangsheng 2025-02-12 17:38:23 +08:00
parent efcb2bc04c
commit aeab036239
4 changed files with 20 additions and 7 deletions

BIN
Cidn-SH

Binary file not shown.

View File

@ -785,7 +785,7 @@ void ImportConfig(std::string filename)
Json::Reader reader;
is.open(filename.c_str(), std::ios::in);
string zigbeeChannel;
print_info("filename = %s\n",filename.c_str());
Json::Value jsSystemSetting,jsonValnet,jsonValnet1,jsSystemInfo,jsonValZigbee,jsondataNodeArray;
if (reader.parse(is, root)) {
jsSystemInfo = root["SystemInfo"];
@ -809,7 +809,7 @@ void ImportConfig(std::string filename)
'%s','%s','%s','%s','%s','%s',\
'%s','%s','%s','%s','%s','%s','%s','%s',\
'%s','%s','%s','%s','%s',\
'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s'",
'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','0,0,0'",
vecDataNode[0].c_str(),dataNodeName,vecDataNode[2].c_str(),vecDataNode[3].c_str(),vecDataNode[4].c_str(),\
vecDataNode[5].c_str(),vecDataNode[6].c_str(),vecDataNode[7].c_str(),vecDataNode[8].c_str(),vecDataNode[9].c_str(),\
vecDataNode[10].c_str(),vecDataNode[11].c_str(),vecDataNode[12].c_str(),vecDataNode[13].c_str(),vecDataNode[14].c_str(),\
@ -835,15 +835,21 @@ void ImportConfig(std::string filename)
WriteStr2Config(ZIGBEECONFIG, "Zigbee", "channel", jsonValZigbee["channel"].asString());
WriteStr2Config(ZIGBEECONFIG, "Zigbee", "PanID", jsonValZigbee["PanID"].asString());
WriteStr2Config(SYSTEMINFOFILE, "Version", "GateWayVersion", jsSystemInfo["GateWayVersion"].asString());
WriteStr2Config(SYSTEMINFOFILE, "Version", "SystemVersion", jsSystemInfo["SystemVersion"].asString());
WriteStr2Config(SYSTEMINFOFILE, "Version", "WebVersion", jsSystemInfo["WebVersion"].asString());
WriteStr2Config(SYSTEMINFOFILE, "Version", "GateWayHwVesion", jsSystemInfo["GateWayHwVesion"].asString());
WriteStr2Config(SYSTEMINFOFILE, "Version", "GateWayProduct", jsSystemInfo["GateWayProduct"].asString());
char whereCon[1024] = {0};
char updateSql[1024] = { 0 };
sprintf(updateSql, "zigbeePanID = '%s',zigbeeChannel = '%s'",\
jsonValZigbee["PanID"].asString().c_str(),jsonValZigbee["channel"].asString().c_str());
sprintf(whereCon, "gatewayMAC='%s'", GlobalConfig::MacAddr_G.c_str());
sql_ctl->UpdateTableData(T_GATEWAY_INFO(TNAME), updateSql, whereCon);
}
//system("reboot");
system("reboot");
}
int UpdataDataNodeConfig(std::string filename)
{

View File

@ -21,11 +21,11 @@ enum enumZigBeeTransmitStatus {
//#define NR5G_MODULE
#define Q4G_MODULE
//#define Q4G_MODULE
//#define WIFI_MODULE
//#define NR5G_MEIGE
#define G2UL_GATEWAY
//#define IMX6UL_GATEWAY
//#define G2UL_GATEWAY
#define IMX6UL_GATEWAY
class GlobalConfig
{

View File

@ -2184,6 +2184,13 @@ std::string JsonData::JsonCmd_Cgi_31(Param_31 &param)
WriteStr2Config(ZIGBEECONFIG, "Zigbee", "channel", std::string(buf));*/
WriteStr2Config(ZIGBEECONFIG, "Zigbee", "channel", param.mChannelId);
WriteStr2Config(ZIGBEECONFIG, "Zigbee", "PanID", param.mPanID);
char whereCon[1024] = {0};
char updateSql[1024] = { 0 };
sprintf(updateSql, "zigbeePanID = '%s',zigbeeChannel = '%s'",\
param.mPanID.c_str(),param.mChannelId.c_str());
sprintf(whereCon, "gatewayMAC='%s'", GlobalConfig::MacAddr_G.c_str());
sql_ctl->UpdateTableData(T_GATEWAY_INFO(TNAME), updateSql, whereCon);
system("reboot");
//pUart->ZigbeeInit();
//pUart->UpdateZigbeeInfoCtrl();
}