修复bug

This commit is contained in:
zhangsheng 2025-02-12 17:37:07 +08:00
parent 5a633ddf66
commit b4c24e718a
2 changed files with 15 additions and 1 deletions

View File

@ -606,6 +606,13 @@ void ImportConfig(std::string filename) {
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());
sqlite_db_ctrl::instance().UpdateTableData(T_GATEWAY_INFO(TNAME), updateSql, whereCon);
}
int UpdataDataNodeConfig(std::string filename) {

View File

@ -769,6 +769,13 @@ std::string JsonData::JsonCmd_Cgi_31(Param_31 &param) {
if (0 == param.mMode) {
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());
sqlite_db_ctrl::instance().UpdateTableData(T_GATEWAY_INFO(TNAME), updateSql, whereCon);
system("reboot");
}
Json::Value jsBody;
jsonVal["message"] = "设置完成";