modify bugs
This commit is contained in:
parent
725b3ade9e
commit
e53b687b5d
@ -26,6 +26,7 @@ int SensorScheduler::StartSchedule(uint16_t short_addr, int &next_duration, bool
|
|||||||
} else {
|
} else {
|
||||||
id = iter->second;
|
id = iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_ts_ = GetLocalTs();
|
current_ts_ = GetLocalTs();
|
||||||
CleanIdleOccupiedSet(current_ts_);
|
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_;
|
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_;
|
seconds_in_current_eigen_slice_ = seconds_in_current_wave_slice_ % eigen_value_send_interval_;
|
||||||
ts_in_eigen_slice_ = false;
|
ts_in_eigen_slice_ = false;
|
||||||
|
|
||||||
if (seconds_in_current_eigen_slice_ < 60 - 3) {
|
if (seconds_in_current_eigen_slice_ < 60 - 3) {
|
||||||
ts_in_eigen_slice_ = true;
|
ts_in_eigen_slice_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ts_in_eigen_slice_) {
|
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) {
|
if (nth_eigen_value_slice_ == 0) {
|
||||||
ClearFailureSuccessMap();
|
ClearFailureSuccessMap();
|
||||||
}
|
}
|
||||||
} else {
|
} 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_;
|
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",
|
zlog_debug(zbt, "[%d:%x] ts:%ld, current utc:%s, nth eigen_value slice:%d, seconds in eigen slice:%d, eigen slice:%d",
|
||||||
|
|||||||
@ -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));
|
zlog_warn(zct, "device info not found %02x%02x ", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int next_task_id = 0;
|
int next_duration_,next_task_id = 0;
|
||||||
int taskID;
|
int taskID;
|
||||||
ScheduleTask scheduleTask;
|
ScheduleTask scheduleTask;
|
||||||
bool z = false;
|
bool z = false;
|
||||||
//taskID = scheduler::instance().StartSchedule(ushortAdd,next_duration,z, next_task_id);
|
//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;
|
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 (scheduler::instance().StartSchedule(ushortAdd,next_duration_,z, next_task_id) == kScheduleConfigSensor)
|
||||||
if (taskID == kScheduleConfigSensor)
|
|
||||||
{
|
{
|
||||||
scheduleTask.cmd = CONFIG;
|
scheduleTask.cmd = CONFIG;
|
||||||
scheduleTask.duration = next_duration;
|
scheduleTask.duration = next_duration_;
|
||||||
scheduleTask.next_taskID = next_task_id;
|
scheduleTask.next_taskID = next_task_id;
|
||||||
scheduleTask.shortAddr = ushortAdd;
|
scheduleTask.shortAddr = ushortAdd;
|
||||||
TaskResp(scheduleTask);
|
TaskResp(scheduleTask);
|
||||||
mssleep(50000);
|
mssleep(50000);
|
||||||
UpdateConfig(ushortAdd);
|
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){
|
if(next_task_id == kScheduleWaveForm){
|
||||||
scheduleTask.cmd = REVIVE_DURATION;
|
scheduleTask.cmd = REVIVE_DURATION;
|
||||||
scheduleTask.shortAddr = ushortAdd;
|
scheduleTask.shortAddr = ushortAdd;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user