modify bugs

This commit is contained in:
zhangsheng 2026-03-16 15:13:20 +08:00
parent 725b3ade9e
commit e53b687b5d
2 changed files with 13 additions and 8 deletions

View File

@ -26,6 +26,7 @@ int SensorScheduler::StartSchedule(uint16_t short_addr, int &next_duration, bool
} else {
id = iter->second;
}
current_ts_ = GetLocalTs();
CleanIdleOccupiedSet(current_ts_);
@ -35,15 +36,20 @@ int SensorScheduler::StartSchedule(uint16_t short_addr, int &next_duration, bool
nth_eigen_value_slice_ = seconds_in_current_wave_slice_ / eigen_value_send_interval_;
seconds_in_current_eigen_slice_ = seconds_in_current_wave_slice_ % eigen_value_send_interval_;
ts_in_eigen_slice_ = false;
if (seconds_in_current_eigen_slice_ < 60 - 3) {
ts_in_eigen_slice_ = true;
}
if (ts_in_eigen_slice_) {
nth_eigen_slice_ = (seconds_in_current_eigen_slice_ + 2) / eigen_value_send_duration_;
// nth_eigen_slice_ = (seconds_in_current_eigen_slice_ + 2) / eigen_value_send_duration_;
if (nth_eigen_value_slice_ == 0) {
ClearFailureSuccessMap();
}
} else {
if (seconds_per_wave_slice_ == 0) {
seconds_per_wave_slice_ = 60;
}
nth_wave_slice_ = (seconds_in_current_eigen_slice_ - 60 + 3) / seconds_per_wave_slice_;
}
zlog_debug(zbt, "[%d:%x] ts:%ld, current utc:%s, nth eigen_value slice:%d, seconds in eigen slice:%d, eigen slice:%d",

View File

@ -349,26 +349,25 @@ int Uart::DealAskTask(uint16_t ushortAdd){
zlog_warn(zct, "device info not found %02x%02x ", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd));
return 1;
}
int next_task_id = 0;
int next_duration_,next_task_id = 0;
int taskID;
ScheduleTask scheduleTask;
bool z = false;
//taskID = scheduler::instance().StartSchedule(ushortAdd,next_duration,z, next_task_id);
uint16_t next_duration = scheduler::instance().GetNextDuration(ushortAdd,z,next_task_id);
zlog_info(zct, "next_duration = %d next_taskID = %d,z = %d", next_duration,next_task_id,z);
current_z = z;
zlog_info(zct, "taskID = %d next_duration = %d next_task_id = %d,current_z = %d", taskID, next_duration, next_task_id,current_z);
if (taskID == kScheduleConfigSensor)
if (scheduler::instance().StartSchedule(ushortAdd,next_duration_,z, next_task_id) == kScheduleConfigSensor)
{
scheduleTask.cmd = CONFIG;
scheduleTask.duration = next_duration;
scheduleTask.duration = next_duration_;
scheduleTask.next_taskID = next_task_id;
scheduleTask.shortAddr = ushortAdd;
TaskResp(scheduleTask);
mssleep(50000);
UpdateConfig(ushortAdd);
}
uint16_t next_duration = scheduler::instance().GetNextDuration(ushortAdd,z,next_task_id);
zlog_info(zct, "taskID = %d next_duration = %d next_task_id = %d,current_z = %d", taskID, next_duration, next_task_id,current_z);
if(next_task_id == kScheduleWaveForm){
scheduleTask.cmd = REVIVE_DURATION;
scheduleTask.shortAddr = ushortAdd;