diff --git a/common/common_func.cpp b/common/common_func.cpp index 90c3051..9752516 100644 --- a/common/common_func.cpp +++ b/common/common_func.cpp @@ -323,8 +323,8 @@ int config_uart(const char *port, int speed) { opt.c_oflag &= ~(OPOST); opt.c_cflag &= ~(CSIZE | PARENB | CBAUD); opt.c_cflag |= (CS8 | speed); - opt.c_cc[VMIN] = 255; - opt.c_cc[VTIME] = 5; + opt.c_cc[VMIN] = 1; + opt.c_cc[VTIME] = 1; if (tcsetattr(fd, TCSANOW, &opt) < 0) { zlog_error(zbt, "tcsetattr failed"); return -2; diff --git a/common/global.hpp b/common/global.hpp index f8b3ec6..3f66941 100644 --- a/common/global.hpp +++ b/common/global.hpp @@ -19,7 +19,7 @@ enum enumZigBeeTransmitStatus { //#define NR5G_MODULE //#define Q4G_MODULE -//#define WIFI_MODULE +#define WIFI_MODULE //#define NR5G_MEIGE diff --git a/common/parameter_defination.hpp b/common/parameter_defination.hpp index 5e8482a..ec3d6a2 100644 --- a/common/parameter_defination.hpp +++ b/common/parameter_defination.hpp @@ -360,4 +360,12 @@ struct Param_64 { std::vector cfg; Param_64() : mMode(0),partial(false){}; }; +struct Param_65 { + + int mMode; + int mPackageFlag; + std::string timeStart; + std::string timeEnd; + Param_65() : mMode(0),mPackageFlag(0),timeStart(""),timeEnd(""){}; +}; #endif // PARAMETER_DEFINATION_HPP_ diff --git a/jsonparse/web_cmd_parse2.cpp b/jsonparse/web_cmd_parse2.cpp index 85844c8..4fd7695 100644 --- a/jsonparse/web_cmd_parse2.cpp +++ b/jsonparse/web_cmd_parse2.cpp @@ -238,13 +238,13 @@ std::string JsonData::JsonCmd_Cgi_27(Param_27 ¶m) { sqlite_db_ctrl::instance().DeleteTableData(T_BATTERY_INFO(TNAME), whereCon); sqlite_db_ctrl::instance().DeleteTableData(" t_battery_history ", whereCon); memset(whereCon,0,sizeof(whereCon)); - sprintf(whereCon, "channelID like'%s'", param.mDataNodeNo.c_str()); + sprintf(whereCon, "channelID like '%%%s%%'", param.mMeasurementID.c_str()); sqlite_db_ctrl::instance().DeleteTableData(" t_data_waveSend ", whereCon); char szTableName[50] = {0x00}; - sprintf(szTableName, "DROP TABLE t_data_%s", param.mDataNodeNo.c_str()); + sprintf(szTableName, "DROP TABLE t_data_%s", param.mMeasurementID.c_str()); sqlite_db_ctrl::instance().CreateTable(szTableName); memset(szTableName, 0x00, sizeof(szTableName)); - sprintf(szTableName, "DROP TABLE t_dataStatic_%s", param.mDataNodeNo.c_str()); + sprintf(szTableName, "DROP TABLE t_dataStatic_%s", param.mMeasurementID.c_str()); sqlite_db_ctrl::instance().CreateTable(szTableName); uint16_t short_addr; char *end_ptr = NULL; diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index e9f4009..52b033d 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -1007,7 +1007,7 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan Json::FastWriter WaveValue; std::string WaveData = WaveValue.write(valWaveData); - char selectCon[128] = {0},whereCon[128] = {0}; + char selectCon[128] = {0},whereCon[1024] = {0}; sprintf(selectCon, "channelID='%s' ORDER BY timeStamp ASC LIMIT 0,1", strChannelID.c_str()); std::string strTime = sqlite_db_ctrl::instance().GetData("t_data_waveSend", "timeStamp", selectCon); long lTime = atol(nowTimetamp.c_str()) - atol(strTime.c_str()); @@ -1080,10 +1080,9 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan } else { zlog_warn(zct, "send data , filename %s,size = %d\n", strFileName.c_str(), vecData.size()); } - - char whereCon[1024] = {0x00}; char updateSql[1024] = {0x00}; char tmpWhere[128] = {0x00}; + memset(whereCon, 0x00, sizeof(whereCon)); sprintf(tmpWhere, "channelID = '%s' and save = 1 ", strChannelID.c_str()); int count = sqlite_db_ctrl::instance().GetTableRows("t_data_waveSend", tmpWhere); zlog_info(zct, "save channlID %s dat count = %d\n", strChannelID.c_str(), count);