From bfdb4cdbf7bb8300fe37bc6a89c6f5d217dfe14c Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Sun, 29 Sep 2024 19:57:44 +0800 Subject: [PATCH] =?UTF-8?q?3.2.5=20beta=205=20=E4=BC=98=E5=8C=96=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=AD=98=E5=82=A8=EF=BC=8C=E6=95=B0=E6=8D=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=EF=BC=8C=E4=BC=A0=E6=84=9F=E5=99=A8=E5=8F=91=E5=B0=84?= =?UTF-8?q?=E5=8A=9F=E7=8E=87=E5=BC=80=E5=85=B3=EF=BC=8C=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9C=80=E5=A4=9A=E5=AD=98=E5=82=A85?= =?UTF-8?q?=E5=A4=A9=EF=BC=8C=E4=BC=A0=E6=84=9F=E5=99=A8=E7=89=B9=E5=BE=81?= =?UTF-8?q?=E5=80=BC=E6=9C=80=E5=A4=9A=E5=AD=98=E5=82=A85=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/SH_CommonFunc.cpp | 2 +- common/SH_CommonFunc.hpp | 6 ++++- common/SH_global.h | 6 ++--- dbaccess/SH_SqlDB.cpp | 47 ++++++++++++++++++---------------- jsonparse/SH_JsonCmd.cpp | 20 +++++++++++++++ jsonparse/SH_JsonCmd.hpp | 1 + localserver/SH_LocalServer.cpp | 14 ++++++++++ main.cpp | 2 +- threadfunc/SH_ThreadFunc.cpp | 2 +- uart/SH_Uart.cpp | 36 ++++++++++++-------------- 10 files changed, 88 insertions(+), 48 deletions(-) diff --git a/common/SH_CommonFunc.cpp b/common/SH_CommonFunc.cpp index d505e7c..9715b29 100644 --- a/common/SH_CommonFunc.cpp +++ b/common/SH_CommonFunc.cpp @@ -2036,7 +2036,7 @@ int writeIntValue(const char* section, char* key, int val, const char* file) { char strValue[STRVALUE_MAX_LEN]; memset(strValue, '\0', STRVALUE_MAX_LEN); - sprintf(strValue, "%-4d", val); + sprintf(strValue, "%d", val); writeStringVlaue(section, key, strValue, file); } diff --git a/common/SH_CommonFunc.hpp b/common/SH_CommonFunc.hpp index a63bd40..135a685 100644 --- a/common/SH_CommonFunc.hpp +++ b/common/SH_CommonFunc.hpp @@ -610,7 +610,11 @@ struct Param_56 { int EndFrequency; Param_56():mMode(0),mChannelId(""),mDataNodeNo(""),mPackageFlag(0),StartFrequency(0),EndFrequency(0){}; }; - +struct Param_57 { + int mMode; + int mZigbeePowerEnable; + Param_57():mZigbeePowerEnable(0){}; +}; typedef struct DataNodeUpdate{ std::string strUpdataFileName; std::string strSoftVersion; diff --git a/common/SH_global.h b/common/SH_global.h index 48bcc15..c670268 100644 --- a/common/SH_global.h +++ b/common/SH_global.h @@ -24,8 +24,8 @@ enum enumZigBeeTransmitStatus { //#define Q4G_MODULE //#define WIFI_MODULE //#define NR5G_MEIGE -#define G2UL_GATEWAY -//#define IMX6UL_GATEWAY +//#define G2UL_GATEWAY +#define IMX6UL_GATEWAY class GlobalConfig { @@ -78,7 +78,7 @@ public : #define WHITE "\033[1;37m" #ifdef IMX6UL_GATEWAY -#define SAVE_COUNT 2592 +#define SAVE_COUNT 4320 #define OneWeek 259359 #endif #ifdef G2UL_GATEWAY diff --git a/dbaccess/SH_SqlDB.cpp b/dbaccess/SH_SqlDB.cpp index d57b8ef..3916038 100644 --- a/dbaccess/SH_SqlDB.cpp +++ b/dbaccess/SH_SqlDB.cpp @@ -1335,7 +1335,7 @@ int SqliteDB::QueryofflineData() memcpy(updateSql, "sendMsg='1'",sizeof(updateSql)); sql_ctl->UpdateTableData(StaticTableName, updateSql, whereCon); sql_ctl->UpdateTableData(dataTableName, updateSql, whereCon); - LOG_INFO("resend success dataNodeNo = %s,TimeStamp = '%s'\n",arrRetData[j][0].c_str(),arrRetData[j][8].c_str()); + //LOG_INFO("resend success dataNodeNo = %s,TimeStamp = '%s'\n",arrRetData[j][0].c_str(),arrRetData[j][8].c_str()); } } } @@ -1392,7 +1392,7 @@ int SqliteDB::QueryofflineData() //DeleteTableData("t_data_waveSend", whereCon); std::string strCmd = "rm " + arrRetData[i][1]; system(strCmd.c_str()); - LOG_INFO("resend success waveName = %s\n",arrRetData[i][1].c_str()); + //LOG_INFO("resend success waveName = %s\n",arrRetData[i][1].c_str()); } } @@ -1416,13 +1416,13 @@ int SqliteDB::CalculateData() sprintf(tableName,"t_dataStatic_%s",vecRet[i][0].c_str()); const char *sql = " timestamp >= strftime('%s', 'now', '-1 day', 'start of day','utc') " - "AND timestamp < strftime('%s', 'now', 'start of day','utc','+24 hours') "; + "AND timestamp < strftime('%s', 'now', '-1 day','start of day','utc','+24 hours') "; int StatisticCount = GetTableRows(tableName,sql); - sql = "timeStamp >= strftime('%s', 'now', '-1 day', 'start of day','utc') AND timeStamp < strftime('%s', 'now', 'start of day','utc','+24 hours') and statisticType = '1' "; + sql = "timeStamp >= strftime('%s', 'now', '-1 day', 'start of day','utc') AND timeStamp < strftime('%s', 'now', '-1 day','start of day','utc','+24 hours') and statisticType = '1' "; int SixCount = GetTableRows(tableName,sql); - sql = "timeStamp >= strftime('%s', 'now', '-1 day', 'start of day','utc') AND timeStamp < strftime('%s', 'now', 'start of day','utc','+24 hours') and statisticType = '1' and timing = '0'"; + sql = "timeStamp >= strftime('%s', 'now', '-1 day', 'start of day','utc') AND timeStamp < strftime('%s', 'now', '-1 day','start of day','utc','+24 hours') and statisticType = '1' and timing = '0'"; int TimingCount = GetTableRows(tableName,sql); print_info("nodeWaveSend = %s,waveInterVal = %s\n",vecRet[i][2].c_str(),vecRet[i][4].c_str()); if(vecRet[i][2] == "") @@ -1517,24 +1517,27 @@ int SqliteDB::CalculateData() LOG_INFO("dataNodeNo = %s , Statistic Count = %d , 06 Count = %d , Timing Count = %d , CountWaveX = %d , CountWaveY = %d , CountWaveZ = %d , featureInterVal = %s , waveInterVal = %s , NodeWaveSend = %s\n"\ ,vecRet[i][0].c_str(),StatisticCount,SixCount,TimingCount,CountWaveX,CountWaveY,CountWaveZ,vecRet[i][3].c_str(),vecRet[i][4].c_str(),vecRet[i][2].c_str()); - if (rateX == 1 && rateY == 1 && rateZ == 1 && vecRet[i][5] == "3") - { - char updateSql[50] = {0x00}; - sprintf(updateSql,"ZigbeePower = '2',UpdateFlag = 0 "); - memset(whereCon,0x00,sizeof(whereCon)); - sprintf(whereCon," dataNodeNo = '%s'",vecRet[i][0].c_str()); - UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon); - LOG_INFO("update ZigbeePower 2"); - } + int zigbeepowerEnable = readIntValue( "config", "zigbeepowerEnable",(char*)GlobalConfig::Config_G.c_str()); + if(zigbeepowerEnable){ + if (rateX != -1 && rateY != -1 && rateZ != -1 && vecRet[i][5] == "3") + { + char updateSql[50] = {0x00}; + sprintf(updateSql,"ZigbeePower = '2',UpdateFlag = 0 "); + memset(whereCon,0x00,sizeof(whereCon)); + sprintf(whereCon," dataNodeNo = '%s'",vecRet[i][0].c_str()); + UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon); + LOG_INFO("update ZigbeePower 2"); + } - if ((rateX == -1 || rateY == -1 || rateZ == -1 )&& vecRet[i][5] == "2") - { - char updateSql[50] = {0x00}; - sprintf(updateSql,"ZigbeePower = '3',UpdateFlag = 0 "); - memset(whereCon,0x00,sizeof(whereCon)); - sprintf(whereCon," dataNodeNo = '%s'",vecRet[i][0].c_str()); - UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon); - LOG_INFO("update ZigbeePower 3"); + if ((rateX == -1 || rateY == -1 || rateZ == -1 ) && vecRet[i][5] == "2") + { + char updateSql[50] = {0x00}; + sprintf(updateSql,"ZigbeePower = '3',UpdateFlag = 0 "); + memset(whereCon,0x00,sizeof(whereCon)); + sprintf(whereCon," dataNodeNo = '%s'",vecRet[i][0].c_str()); + UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon); + LOG_INFO("update ZigbeePower 3"); + } } featureInterVal = atoi(vecRet[i][3].c_str()); waveInterVal = atoi(vecRet[i][4].c_str()); diff --git a/jsonparse/SH_JsonCmd.cpp b/jsonparse/SH_JsonCmd.cpp index f1e2d4f..a68d6bd 100644 --- a/jsonparse/SH_JsonCmd.cpp +++ b/jsonparse/SH_JsonCmd.cpp @@ -2789,3 +2789,23 @@ std::string JsonData::JsonCmd_Cgi_56(Param_56 ¶m) return showValue.write(jsonVal); } +std::string JsonData::JsonCmd_Cgi_57(Param_57 ¶m) +{ + Json::Value jsonVal; + jsonVal.clear(); + Json::Value jsBody; + jsonVal[JSON_FIELD_CMD] = "57"; + jsonVal["success"] = true; + jsonVal["message"] = ""; + int zigbeepowerEnable = -1; + if(param.mMode == 1){ + zigbeepowerEnable = writeIntValue( "config", "zigbeepowerEnable",param.mZigbeePowerEnable,(char*)GlobalConfig::Config_G.c_str()); + }else if (param.mMode == 0) + { + zigbeepowerEnable = readIntValue( "config", "zigbeepowerEnable",(char*)GlobalConfig::Config_G.c_str()); + } + jsBody["zigbeepowerEnable"] = zigbeepowerEnable; + jsonVal["content"] = jsBody; + + return showValue.write(jsonVal); +} \ No newline at end of file diff --git a/jsonparse/SH_JsonCmd.hpp b/jsonparse/SH_JsonCmd.hpp index 47d666c..2a7d5cc 100644 --- a/jsonparse/SH_JsonCmd.hpp +++ b/jsonparse/SH_JsonCmd.hpp @@ -73,6 +73,7 @@ public : std::string JsonCmd_Cgi_55(Param_55 ¶m); std::string JsonCmd_Cgi_56(Param_56 ¶m); + std::string JsonCmd_Cgi_57(Param_57 ¶m); std::string JsonCmd_Cgi_default(); private : diff --git a/localserver/SH_LocalServer.cpp b/localserver/SH_LocalServer.cpp index eb2bca0..e971bfd 100644 --- a/localserver/SH_LocalServer.cpp +++ b/localserver/SH_LocalServer.cpp @@ -636,6 +636,20 @@ try{ param.mDataNodeNo = recvBody["dataNodeNo"].asString(); std::string data = jd.JsonCmd_Cgi_56(param); return data; + } + case 57:{ + JsonData jd; + Param_57 param; + param.mZigbeePowerEnable = recvBody["ZigbeePowerEnable"].asInt(); + std::string type = recvBody["type"].asString(); + if (0 == type.compare("SET")) { + param.mMode = 1; + } + if (0 == type.compare("GET")) { + param.mMode = 0; + } + std::string data = jd.JsonCmd_Cgi_57(param); + return data; } break; default: diff --git a/main.cpp b/main.cpp index 660747d..ea499e0 100644 --- a/main.cpp +++ b/main.cpp @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) { printf(" Firmware compile time:%s %s,version %s\n", __DATE__, __TIME__,GlobalConfig::Version.c_str()); // 初始化日志记录,日志缓存区,记录数,未使用,后期,命令启动 - log_init(SOFTWARE_RUN_LOG, 1380, 200 * 1024 * 2); + log_init(SOFTWARE_RUN_LOG, 1380, 160 * 1024 * 2); LOG_INFO("####CIDNSOFT start####\n"); // 查看版本信息 diff --git a/threadfunc/SH_ThreadFunc.cpp b/threadfunc/SH_ThreadFunc.cpp index d850eea..0127d21 100644 --- a/threadfunc/SH_ThreadFunc.cpp +++ b/threadfunc/SH_ThreadFunc.cpp @@ -273,7 +273,7 @@ void CheckThread() } } } - if(1500 == Battery){ + if(7200 == Battery){ Battery = 0; LOG_INFO("Battery\n"); sql_ctl->CalculateBattery(); diff --git a/uart/SH_Uart.cpp b/uart/SH_Uart.cpp index 802b1e2..2ed06d0 100644 --- a/uart/SH_Uart.cpp +++ b/uart/SH_Uart.cpp @@ -635,7 +635,7 @@ int Uart::FindRecvPackage(int bytesRead, char* mUartRecvBuf,char* head) } break; }else if(command == 35){ - LOG_INFO("command = %d ShortAddr :%s,Timetamp=%s\n",command,strShortAddr.c_str(),strTimetamp.c_str()); + //LOG_INFO("command = %d ShortAddr :%s,Timetamp=%s\n",command,strShortAddr.c_str(),strTimetamp.c_str()); // for(int j = i; j < i+100;j++){ // printf("%02X ",UartRecvBuf[j]&0xFF); // } @@ -661,7 +661,7 @@ int Uart::FindRecvPackage(int bytesRead, char* mUartRecvBuf,char* head) boost::split( vParamRSSI, vecDataNodeNo[1], boost::is_any_of( "," ), boost::token_compress_on ); if(vParamRSSI.size() > 0){ sprintf(updateSql, "RSSI = '%s,%02d' ",vParamRSSI[0].c_str(),UartRecvBuf[i+14]&0xFF); - LOG_INFO(updateSql); + //LOG_INFO(updateSql); sprintf(whereCon, "dataNodeNo='%s'", (char*)vecDataNodeNo[0].c_str()); sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon); } @@ -718,7 +718,7 @@ int Uart::FindRecvPackage(int bytesRead, char* mUartRecvBuf,char* head) //pTestRecv(command); }else if(command == 218){//DA - LOG_INFO("command = %d,zigbeeShortAddr = %s , signal = %02d,strTimetamp = %s\n",command,m_strDestShortAddr.c_str(),UartRecvBuf[i+6]&0xFF,strTimetamp.c_str()); + //LOG_INFO("command = %d,zigbeeShortAddr = %s , signal = %02d,strTimetamp = %s\n",command,m_strDestShortAddr.c_str(),UartRecvBuf[i+6]&0xFF,strTimetamp.c_str()); char whereCon[1024] = {0}; char updateSql[1024] = { 0 }; char tableName[100]={0x00}; @@ -743,11 +743,11 @@ int Uart::FindRecvPackage(int bytesRead, char* mUartRecvBuf,char* head) boost::split( vParamRSSI, vecDataNodeNo[2], boost::is_any_of( "," ), boost::token_compress_on ); if(vParamRSSI.size() == 1){ sprintf(updateSql, "RSSI = '%02d,%s' ",UartRecvBuf[i+6]&0xFF,vParamRSSI[0].c_str()); - LOG_INFO(updateSql); + //LOG_INFO(updateSql); }else if(vParamRSSI.size() == 2){ sprintf(updateSql, "RSSI = '%02d,%s' ",UartRecvBuf[i+6]&0xFF,vParamRSSI[1].c_str()); - LOG_INFO(updateSql); + //LOG_INFO(updateSql); } sprintf(whereCon, "dataNodeNo='%s'", (char*)vecDataNodeNo[0].c_str()); sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon); @@ -2246,8 +2246,6 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) RecordBattery(strLongAddr,dataStatic,nowTimetamp); - - char szTableName[50]={0x00},szTableNameStatic[50]={0x00},szTableNameData[50]={0x00}; sprintf(szTableName,"t_dataStatic_%s",strLongAddr.c_str()); memcpy(szTableNameStatic,szTableName,sizeof(szTableNameStatic)); @@ -2324,9 +2322,9 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) print_info("nowTimetamp = %s",nowTimetamp.c_str()); // save dataStatic of 7 days char selectCon[128] = { 0 }; - sprintf(selectCon, "channelID='%s' and sendMsg = '1' ORDER BY timeStamp ASC LIMIT 0,1",(strMeasurementID + "-S").c_str()); + sprintf(selectCon, "channelID='%s' ORDER BY timeStamp ASC LIMIT 0,1",(strMeasurementID + "-S").c_str()); std::string strTime = sql_ctl->GetData(szTableName, "timeStamp", selectCon); - sprintf(whereCon,"channelID='%s' and sendMsg = '1'",(strMeasurementID + "-S").c_str()); + sprintf(whereCon,"channelID='%s' ",(strMeasurementID + "-S").c_str()); int Count = sql_ctl->GetTableRows(szTableName, whereCon); if(Count == -1){ sql_ctl->CreatedataStatictable(szTableName); @@ -2340,7 +2338,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) sprintf(updateSql, "temTop='%f',temBot='%f',dip='%d',voltage='%d',timeStamp='%s',StaticIndex = %d, nodeResend = %d,zigbeeSignal = '',zigbeeSignalNode = '',statisticType = '',timing = '' ",\ dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, nowTimetamp.c_str(),staticIndex,nodeResend); - sprintf(whereCon, "channelID='%s' and sendMsg = '1'", (strMeasurementID + "-S").c_str()); + sprintf(whereCon, "channelID='%s' ", (strMeasurementID + "-S").c_str()); if ( /*0 == sql_ctl->GetTableRows(T_DATASTATIC_INFO(TNAME), whereCon)*/ (Count * 3 < SAVE_COUNT && lTime < OneWeek ) || strTime.size() == 0 ) { print_info("insert static data to sql\n"); char insertSql[1024] = { 0 }; @@ -2363,7 +2361,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) } } else { memset(whereCon,0x00,sizeof(whereCon)); - sprintf(whereCon, "channelID='%s' and sendMsg = '1' and timeStamp = '%s'", (strMeasurementID + "-S").c_str(),strTime.c_str()); + sprintf(whereCon, "channelID='%s' and timeStamp = '%s'", (strMeasurementID + "-S").c_str(),strTime.c_str()); print_info("update static data to sql\n"); sql_ctl->UpdateTableData(szTableName, updateSql, whereCon); memset(whereCon,0x00,sizeof(whereCon)); @@ -2695,7 +2693,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) dataDymX.Phase4 = 0; memset(whereCon, 0, 1024); - sprintf(whereCon, "channelID='%s' and sendMsg = '1'", (strMeasurementID + "-X").c_str()); + sprintf(whereCon, "channelID='%s' ", (strMeasurementID + "-X").c_str()); memset(updateSql, 0, 1024); sprintf(updateSql, "diagnosisPk='%f',integratPk='%f',integratRMS='%f',rmsValues='%f',envelopEnergy='%f',\ Amp1='%f',Amp2='%f',Amp3='%f',Amp4='%f',Amp5='%f',Phase1='%f',Phase2='%f',Phase3='%f',Phase4='%f',timeStamp='%s',StaticIndex = %d,nodeResend = %d ",\ @@ -2715,7 +2713,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) sql_ctl->UpdateTableData(T_DATA_INFO(TNAME), updateSql, whereCon); } else { memset(whereCon,0x00,sizeof(whereCon)); - sprintf(whereCon, "channelID='%s' and sendMsg = '1' and timeStamp = '%s'", (strMeasurementID + "-X").c_str(),strTime.c_str()); + sprintf(whereCon, "channelID='%s' and timeStamp = '%s'", (strMeasurementID + "-X").c_str(),strTime.c_str()); // sprintf(whereCon, "channelID='%s' and sendMsg = '1' ", (strLongAddr + "-X").c_str()); sql_ctl->UpdateTableData(szTableName, updateSql, whereCon); memset(whereCon,0x00,sizeof(whereCon)); @@ -3058,7 +3056,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) dataDymY.Phase4 = 0; memset(whereCon, 0, 1024); - sprintf(whereCon, "channelID='%s' and sendMsg = '1'", (strMeasurementID + "-Y").c_str()); + sprintf(whereCon, "channelID='%s' ", (strMeasurementID + "-Y").c_str()); memset(updateSql, 0, 1024); sprintf(updateSql, "diagnosisPk='%f',integratPk='%f',integratRMS='%f',rmsValues='%f',envelopEnergy='%f',\ Amp1='%f',Amp2='%f',Amp3='%f',Amp4='%f',Amp5='%f',Phase1='%f',Phase2='%f',Phase3='%f',Phase4='%f',timeStamp='%s',StaticIndex = %d,nodeResend = %d ",\ @@ -3079,7 +3077,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) } else { memset(whereCon,0x00,sizeof(whereCon)); - sprintf(whereCon, "channelID='%s' and sendMsg = '1' and timeStamp = '%s'", (strMeasurementID + "-Y").c_str(),strTime.c_str()); + sprintf(whereCon, "channelID='%s' and timeStamp = '%s'", (strMeasurementID + "-Y").c_str(),strTime.c_str()); // sprintf(whereCon, "channelID='%s' and sendMsg = '1' ", (strLongAddr + "-Y").c_str()); sql_ctl->UpdateTableData(szTableName, updateSql, whereCon); memset(whereCon,0x00,sizeof(whereCon)); @@ -3420,7 +3418,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) dataDymZ.Phase4 = lowbit * n; memset(whereCon, 0, 1024); - sprintf(whereCon, "channelID='%s' and sendMsg = '1'", (strMeasurementID + "-Z").c_str()); + sprintf(whereCon, "channelID='%s' ", (strMeasurementID + "-Z").c_str()); memset(updateSql, 0, 1024); sprintf(updateSql, "diagnosisPk='%f',integratPk='%f',integratRMS='%f',rmsValues='%f',envelopEnergy='%f',\ @@ -3442,7 +3440,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) } else { memset(whereCon,0x00,sizeof(whereCon)); - sprintf(whereCon, "channelID='%s' and sendMsg = '1' and timeStamp = '%s'", (strMeasurementID + "-Z").c_str(),strTime.c_str()); + sprintf(whereCon, "channelID='%s' and timeStamp = '%s'", (strMeasurementID + "-Z").c_str(),strTime.c_str()); // sprintf(whereCon, "channelID='%s' and sendMsg = '1'", (strLongAddr + "-Z").c_str()); sql_ctl->UpdateTableData(szTableName, updateSql, whereCon); memset(whereCon,0x00,sizeof(whereCon)); @@ -3966,7 +3964,7 @@ void Uart::WriteDatFile(int sampleRate,string& strMeasurementID,int iChannel,std std::string WaveData = WaveValue.write(valWaveData); char selectCon[128] = { 0 }; - sprintf(selectCon, "channelID='%s' and sendMsg = '1' ORDER BY timeStamp ASC LIMIT 0,1",strChannelID.c_str()); + sprintf(selectCon, "channelID='%s' ORDER BY timeStamp ASC LIMIT 0,1",strChannelID.c_str()); std::string strTime = sql_ctl->GetData("t_data_waveSend", "timeStamp", selectCon); long lTime = atol(nowTimetamp.c_str())-atol(strTime.c_str()); int Count = sql_ctl->GetTableRows("t_data_waveSend", NULL); @@ -3979,7 +3977,7 @@ void Uart::WriteDatFile(int sampleRate,string& strMeasurementID,int iChannel,std char updateSql[128] = { 0 },whereCon[128] = {0}; sprintf(updateSql, "waveName='%s',timeStamp='%s'",strFileName_Record.c_str(),nowTimetamp.c_str()); memset(whereCon,0x00,sizeof(whereCon)); - sprintf(whereCon, "channelID='%s' and sendMsg = '1' and timeStamp = '%s'", strChannelID.c_str(),strTime.c_str()); + sprintf(whereCon, "channelID='%s' and timeStamp = '%s'", strChannelID.c_str(),strTime.c_str()); print_info("update static data to sql\n"); sql_ctl->UpdateTableData("t_data_waveSend", updateSql, whereCon); }