diff --git a/common/u2g.h b/common/u2g.h new file mode 100644 index 0000000..83cf184 --- /dev/null +++ b/common/u2g.h @@ -0,0 +1 @@ +void utf2gbk(char *utf,char* gbk); diff --git a/dbaccess/SH_SqlDB.cpp b/dbaccess/SH_SqlDB.cpp index c5ab7c6..140d911 100644 --- a/dbaccess/SH_SqlDB.cpp +++ b/dbaccess/SH_SqlDB.cpp @@ -942,7 +942,7 @@ int SqliteDB::CalculateBattery() print_info("已经使用 = %f\n",atof(vecResSig[6].c_str())); float remainBattery = capacity - usageBattery * 0.2; - LOG_INFO("dataNodeNo = %s,已经使用 = %f,剩余电量 = %f\n",vecRes[i][0].c_str(),atof(vecResSig[6].c_str()),remainBattery); + LOG_INFO("dataNodeNo = %s,batteryUsage = %f,batteryRemain = %f\n",vecRes[i][0].c_str(),atof(vecResSig[6].c_str()),remainBattery); memset(whereCon,0x00,sizeof(whereCon)); sprintf(whereCon," dataNodeNo = '%s' order by timeStamp desc limit 0,1 ",vecRes[i][0].c_str()); string strtimeStamp = sql_ctl->GetData(T_BATTERY_INFO(TNAME)," timeStamp ",whereCon); diff --git a/platform/SH_PlatformInit.cpp b/platform/SH_PlatformInit.cpp index 03e3120..9201d51 100644 --- a/platform/SH_PlatformInit.cpp +++ b/platform/SH_PlatformInit.cpp @@ -12,7 +12,7 @@ int GlobalConfig::LinkCount = 0; int GlobalConfig::net0Status = 1; -std::string GlobalConfig::Version = "3.2.1"; +std::string GlobalConfig::Version = "3.2.2"; std::string GlobalConfig::MacAddr_G = ""; std::string GlobalConfig::MacAddr_G2 = ""; std::string GlobalConfig::IpAddr_G = ""; diff --git a/threadfunc/SH_ThreadFunc.cpp b/threadfunc/SH_ThreadFunc.cpp index a1b0160..6c42c5d 100644 --- a/threadfunc/SH_ThreadFunc.cpp +++ b/threadfunc/SH_ThreadFunc.cpp @@ -29,7 +29,7 @@ Dial dial; void CheckThread() { print_info("ENTER CHECK THREAD \n"); - std::string runinfo = "系统循环检测模块启动"; + std::string runinfo = "ENTER CHECK THREAD "; LOG_INFO(runinfo.c_str()); int heart_count = 0; @@ -306,7 +306,7 @@ void CheckThread() char localtimestamp[32] = { 0 }; GetTimeNet(localtimestamp, 1); char whereCon[1024] = {0}; - sprintf(whereCon," timestamp < '%ld' ",atol(localtimestamp) - 15638400); //删除半年前的数据 + sprintf(whereCon," timestamp < '%ld' ",atol(localtimestamp) - 5097600); //删除2个月前的数据 sql_ctl->DeleteTableData(" t_battery_history ",whereCon); /*staticData = 0; Json::Value jsHeart; diff --git a/uart/SH_Uart.cpp b/uart/SH_Uart.cpp index 1b486a4..4eeb6e0 100644 --- a/uart/SH_Uart.cpp +++ b/uart/SH_Uart.cpp @@ -1964,7 +1964,14 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) char buf[20] = {0x00}; int nodeResend = 0; sprintf(buf, "%02x%02x", pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]); - LOG_INFO("DealDataNodeFeature %02x%02x,isWave \n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag); + if (flag == 1) + { + LOG_INFO("DealDataNodeFeature %02x%02x, %d\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag); + }else{ + LOG_INFO("DealDataNodeFeature %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]); + } + + if (bSendTimeStamp)//波形处理中 return; std::string strShortAddr = std::string(buf); @@ -2216,7 +2223,8 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) char selectCon[128] = { 0 }; sprintf(selectCon, "channelID='%s' and sendMsg = '1' ORDER BY timeStamp ASC LIMIT 0,1",(strMeasurementID + "-S").c_str()); std::string strTime = sql_ctl->GetData(szTableName, "timeStamp", selectCon); - int Count = sql_ctl->GetTableRows(szTableName, NULL); + sprintf(whereCon,"channelID='%s' and sendMsg = '1'",(strMeasurementID + "-S").c_str()); + int Count = sql_ctl->GetTableRows(szTableName, whereCon); if(Count == -1){ sql_ctl->CreatedataStatictable(szTableName); } @@ -3434,7 +3442,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag) bZigbeeSinal = false; } - LOG_INFO("DealDataNodeFeature end %02x%02x,isWave \n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag); + LOG_INFO("DealDataNodeFeature end %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]); } void Uart::DealDataNodeWave(const char *pData)