This commit is contained in:
zhangsheng 2025-04-29 11:25:46 +08:00
parent bcb9ff0409
commit 665de086cb
2 changed files with 8 additions and 4 deletions

View File

@ -557,8 +557,9 @@ void Uart::DealRecvData(const char *pData) {
DealException(pData); DealException(pData);
break; break;
case MEAS_EVAL: case MEAS_EVAL:
DealReviveDuration(ushortAdd);
DealDataNodeFeature(pData, 0); DealDataNodeFeature(pData, 0);
DealReviveDuration(ushortAdd);
break; break;
case UPGRADE: case UPGRADE:
if (recvcode == 0){ if (recvcode == 0){
@ -696,6 +697,7 @@ void Uart::DealDataNodeInfo(const char *pData) {
zlog_warn(zct, "recv remote zigbee module info shortAddr %02x%02x", pRecvData->Data[46], pRecvData->Data[47]); zlog_warn(zct, "recv remote zigbee module info shortAddr %02x%02x", pRecvData->Data[46], pRecvData->Data[47]);
char buf[32] = {0}; char buf[32] = {0};
char whereCon[64] = {0}; char whereCon[64] = {0};
uint16_t ushortAdd = BUILD_UINT16(pData[3] & 0xFF, pData[4] & 0xFF);
char chTemp = pRecvData->Data[0]; //设备状态标志 1 byte char chTemp = pRecvData->Data[0]; //设备状态标志 1 byte
DataNodeInfo dataNodeInfo; DataNodeInfo dataNodeInfo;
dataNodeInfo.EquipSta = GET_BIT(chTemp, 2); dataNodeInfo.EquipSta = GET_BIT(chTemp, 2);
@ -842,7 +844,6 @@ void Uart::DealDataNodeInfo(const char *pData) {
zlog_info(zct, "upgrade = %d", upgrade); zlog_info(zct, "upgrade = %d", upgrade);
if (upgrade == 1) if (upgrade == 1)
{ {
uint16_t ushortAdd = BUILD_UINT16(pData[3] & 0xFF, pData[4] & 0xFF);
sprintf(whereCon, "dataNodeNo='%s'", dataNodeInfo.ZigbeeLongAddr.c_str()); sprintf(whereCon, "dataNodeNo='%s'", dataNodeInfo.ZigbeeLongAddr.c_str());
std::string soft_version = sqlite_db_ctrl::instance().GetData(T_SENSOR_INFO(TNAME), " softVersion ", whereCon); std::string soft_version = sqlite_db_ctrl::instance().GetData(T_SENSOR_INFO(TNAME), " softVersion ", whereCon);
if (dataNodeInfo.SoftVersion != soft_version) { if (dataNodeInfo.SoftVersion != soft_version) {
@ -1018,6 +1019,8 @@ void Uart::DealDataNodeInfo(const char *pData) {
g_mapCompress.insert(std::make_pair(dataNodeInfo.ZigbeeShortAddr, tempchannel)); g_mapCompress.insert(std::make_pair(dataNodeInfo.ZigbeeShortAddr, tempchannel));
zlog_info(zct, "new Node,size = %d", g_mapCompress.size()); zlog_info(zct, "new Node,size = %d", g_mapCompress.size());
} }
int next_duration = 0;
scheduler::instance().StartSchedule(ushortAdd,next_duration);
zlog_info(zct, "DealDataNodeInfo %s ", dataNodeInfo.ZigbeeShortAddr.c_str()); zlog_info(zct, "DealDataNodeInfo %s ", dataNodeInfo.ZigbeeShortAddr.c_str());
} }

View File

@ -558,7 +558,8 @@ int Uart::TaskResp(ScheduleTask scheduleTask){
UpdateData[4] = scheduleTask.shortAddr & 0xFF; UpdateData[4] = scheduleTask.shortAddr & 0xFF;
UpdateData[5] = scheduleTask.cmd & 0xFF; UpdateData[5] = scheduleTask.cmd & 0xFF;
UpdateData[6] = 0x00; UpdateData[6] = 0x00;
if (scheduleTask.cmd == MEAS_EVAL) zlog_info(zct,"next taskID = %d\n",scheduleTask.next_taskID);
if (scheduleTask.next_taskID == MEAS_EVAL)
{ {
UpdateData[7] = UINT16_LOW(scheduleTask.duration); UpdateData[7] = UINT16_LOW(scheduleTask.duration);
UpdateData[8] = UINT16_HIGH(scheduleTask.duration); UpdateData[8] = UINT16_HIGH(scheduleTask.duration);
@ -571,7 +572,7 @@ int Uart::TaskResp(ScheduleTask scheduleTask){
UpdateData[22] = UINT32_LOW_2(scheduleTask.millisecond); UpdateData[22] = UINT32_LOW_2(scheduleTask.millisecond);
UpdateData[23] = UINT32_LOW_1(scheduleTask.millisecond); UpdateData[23] = UINT32_LOW_1(scheduleTask.millisecond);
}else if (scheduleTask.cmd == WAVE_CMD) }else if (scheduleTask.next_taskID == WAVE_CMD)
{ {
uint8_t x,y,z; uint8_t x,y,z;
wave_feature_set_inst::instance().GetWaveCfg(scheduleTask.shortAddr,x,y,z); wave_feature_set_inst::instance().GetWaveCfg(scheduleTask.shortAddr,x,y,z);