diff --git a/Cidn-SH b/Cidn-SH new file mode 100755 index 0000000..23d8a89 Binary files /dev/null and b/Cidn-SH differ diff --git a/uart/uart.cpp b/uart/uart.cpp index 2a6e003..a80b03e 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -131,6 +131,7 @@ Uart::Uart() : mUart(mIoSev), mStrand(mIoSev) { memset(send_data, 0, sizeof(send_data)); last_short_addr = 0; last_time = 0; + last_time_upgrade = 0; current_z = false; } @@ -385,7 +386,7 @@ int Uart::DealAskTask(uint16_t ushortAdd){ scheduleTask.next_taskID = UPGRADE; TaskResp(scheduleTask); } - + DealReviveDuration(ushortAdd); // if (next_task_id == kScheduleEigenValue) //1.特征值 // { @@ -646,8 +647,9 @@ int Uart::DealFeatureValue(const char *pData,uint16_t ushortAdd){ GetTimeNet(localtimestamp, 1); std::string nowTimetamp = std::string(localtimestamp); long now_time = atol(nowTimetamp.c_str()); + zlog_info(zct, "DealFeatureValue1 short_addr_last = %02x%02x,timestamp_last = %ld,nowTime = %ld",UINT16_HIGH(ushortAdd), UINT16_LOW(ushortAdd),last_time,now_time); if(ushortAdd == last_short_addr && (now_time - last_time) < 5){ - zlog_warn(zct, "DealFeatureValue short_addr_last = %02x%02x,timestamp_last = %ld,nowTime = %ld",UINT16_HIGH(ushortAdd), UINT16_LOW(ushortAdd),last_time,now_time); + zlog_warn(zct, "DealFeatureValue2 short_addr_last = %02x%02x,timestamp_last = %ld,nowTime = %ld",UINT16_HIGH(ushortAdd), UINT16_LOW(ushortAdd),last_time,now_time); int iRet = DealDataNodeFeature(pData, 0); if (iRet != 0) { @@ -715,13 +717,13 @@ void Uart::DealRecvData(const char *pData) { GetTimeNet(localtimestamp, 1); std::string nowTimetamp = std::string(localtimestamp); long now_time = atol(nowTimetamp.c_str()); - if(ushortAdd == last_short_addr && (now_time - last_time) < 5){ + if(ushortAdd == last_short_addr && (now_time - last_time_upgrade) < 5){ zlog_warn(zct, "WAVE_COMPRESS | UPGRADE_ASK short_addr_last = %02x%02x,timestamp_last = %ld,nowTime = %ld",UINT16_HIGH(ushortAdd), UINT16_LOW(ushortAdd),last_time,now_time); return ; } GetTimeNet(localtimestamp, 1); nowTimetamp = std::string(localtimestamp); - last_time = atol(nowTimetamp.c_str()); + last_time_upgrade = atol(nowTimetamp.c_str()); } if (ushortAdd != last_short_addr){ diff --git a/uart/uart.hpp b/uart/uart.hpp index cc08dbd..803a114 100644 --- a/uart/uart.hpp +++ b/uart/uart.hpp @@ -284,6 +284,7 @@ private: uint8_t send_data[100]; uint16_t last_short_addr; long last_time; + long last_time_upgrade; bool current_z; std::map> map_send_data;