fix bugs
This commit is contained in:
parent
3770680271
commit
8cc3cb10b7
@ -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){
|
||||
|
||||
@ -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<uint16_t, std::vector<uint8_t>> map_send_data;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user