diff --git a/jsonparse/web_cmd_parse3.cpp b/jsonparse/web_cmd_parse3.cpp index 6c89b59..5492702 100644 --- a/jsonparse/web_cmd_parse3.cpp +++ b/jsonparse/web_cmd_parse3.cpp @@ -899,7 +899,7 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 ¶m){ if (nSize > 0) { char szTableName[100] = {0x00}, whereCon[256] = {0x00},selectCon[100] = {0x00}; if (param.mMode == 1){ - sprintf(selectCon," dataNodeNo,channelID,timeStamp,sendMsg,nodeResend "); + sprintf(selectCon," dataNodeNo,channelID,timeStamp,sendMsg,sendMsg,nodeResend "); sprintf(szTableName,"t_data_%s",param.MeasurementID.c_str()); }else{ sprintf(selectCon," * "); @@ -908,14 +908,14 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 ¶m){ if(param.straxis == ""){ if (param.mMode == 1){ - sprintf(whereCon, " channelID like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str()); + sprintf(whereCon, " channelID like '%s-X' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str()); }else{ sprintf(whereCon, " data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str()); } } else{ if (param.mMode == 1){ - sprintf(whereCon, " channelID = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str()); + sprintf(whereCon, " channelID = '%s-X' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str()); }else{ sprintf(whereCon, " data_nodeno = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str()); } @@ -951,15 +951,15 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 ¶m){ if(param.straxis == "") { if (param.mMode == 1){ - sprintf(whereCon, " channelID like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum); + sprintf(whereCon, " channelID like '%s-X' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum); }else{ sprintf(whereCon, " data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum); } }else{ if (param.mMode == 1){ - sprintf(whereCon, " channelID = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum); + sprintf(whereCon, " channelID = '%s-X' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum); }else{ - sprintf(whereCon, "data_nodeno = %s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum); + sprintf(whereCon, "data_nodeno = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum); } } array_t vecRes; diff --git a/uart/uart.cpp b/uart/uart.cpp index f318e30..f9b57c7 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -1092,11 +1092,11 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) { strChannelID = strMeasurementID + "-Z"; wave_error_z = true; } - if(scheduler::instance().WaveError(wave_shortAddr) < 0){ - zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str()); - sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str()); - sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql); - } + + zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str()); + sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str()); + sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql); + JsonData jd; jd.JsonCmd_32(strMeasurementID,1,1,strChannelID,error_msg); @@ -1134,11 +1134,11 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) { strChannelID = strMeasurementID + "-Z"; wave_error_z = true; } - if(scheduler::instance().WaveError(wave_shortAddr) < 0){ - zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str()); - sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str()); - sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql); - } + + zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str()); + sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str()); + sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql); + JsonData jd; jd.JsonCmd_32(strMeasurementID,1,1,strChannelID,error_msg); continue; diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index fe197e5..c29f592 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -860,6 +860,11 @@ void Uart::DealWave() { { scheduler::instance().WaveSuccess(wave_shortAddr); } + + if (g_mapCompress[strShortAddr].CountX <= 0 && g_mapCompress[strShortAddr].CountY <= 0 && g_mapCompress[strShortAddr].CountZ <= 0) + { + scheduler::instance().WaveError(wave_shortAddr); + } g_mapCompress[strShortAddr].CountX = 0; g_mapCompress[strShortAddr].CountY = 0;