diff --git a/uart/uart.cpp b/uart/uart.cpp index 8eb8693..8f3a3ee 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -360,7 +360,9 @@ int Uart::DealAskTask(uint16_t ushortAdd){ } else if (taskID == kScheduleUpgrade) //3.升级 { + zlog_info(zct, " UpdateWirelessNode 2222" ); UpdateWirelessNode(ushortAdd); + zlog_info(zct, " UpdateWirelessNode end1111" ); }else if (taskID == kScheduleConfigSensor) //4.更新配置 { scheduleTask.cmd = CONFIG; @@ -383,7 +385,7 @@ int Uart::DealAskTask(uint16_t ushortAdd){ scheduleTask.duration = next_duration; TaskResp(scheduleTask); } - + zlog_info(zct, " DealAskTask end" ); return 0; } @@ -520,6 +522,7 @@ void Uart::DealRecvData(const char *pData) { break; case ASK_TASK: DealAskTask(ushortAdd); + zlog_info(zct, " DealAskTask end11111" ); break; case DEVICE_EXCEPTION: DealException(pData); diff --git a/uart/uart_parameter_config.cpp b/uart/uart_parameter_config.cpp index a2fb6f1..2e8bff8 100644 --- a/uart/uart_parameter_config.cpp +++ b/uart/uart_parameter_config.cpp @@ -168,19 +168,22 @@ void Uart::UpdateWirelessNode(uint16_t shortAdd) { } Data[99] = tmp; sleep(1); + zlog_info(zct, "111111111"); WriteToUart((const char*)Data, 100); + zlog_info(zct, "22222222222"); int iRet = CheckZigbeeACK(); + zlog_info(zct, "333333333333"); if (iRet == 0) { zlog_info(zct, "Packge ACK send success,shortAddr = %02x%02x", UINT16_HIGH(shortAdd), UINT16_LOW(shortAdd)); } else { zlog_warn(zct, "Packge ACK send failed,shortAddr = %02x%02x", UINT16_HIGH(shortAdd), UINT16_LOW(shortAdd)); } - mssleep(10000); + mssleep(50000); int Count = thisSize / 92; int lastSize = thisSize % 92; unsigned char UpdateData[100] = {0x00}; //帧头[3byte] 节点地址[2byte] 数据类型[1byte] 序号[1byte] 数据包[92byte] CRC校验[1byte] - zlog_warn(zbt, "Start Update!!! file Size = %d,fileName = %s,Count = %d,lastSize = %d,shortAddr = %02x%02x", (int)thisSize,DataNodeUpdateFile.c_str(),Count,lastSize,UINT16_HIGH(shortAdd), UINT16_LOW(shortAdd)); + zlog_warn(zbt, "Start Upgrade!!! file Size = %d,fileName = %s,Count = %d,lastSize = %d,shortAddr = %02x%02x", (int)thisSize,DataNodeUpdateFile.c_str(),Count,lastSize,UINT16_HIGH(shortAdd), UINT16_LOW(shortAdd)); tmp = 0x00; gpio_set(GlobalConfig::GPIO_G.zigAckreset, 0); mssleep(1000); @@ -619,6 +622,7 @@ int Uart::CheckZigbeeACK() { iRet = 0; break; } + time += 1; mssleep(10000); } while (time < 150); return iRet;