add codes
This commit is contained in:
parent
7472843976
commit
49efe12361
@ -374,23 +374,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_duration = 0,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);
|
||||||
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;
|
||||||
@ -645,14 +647,14 @@ int Uart::DealFeatureValue(const char *pData,uint16_t ushortAdd){
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// char logInfo[100] = {0x00};
|
char logInfo[100] = {0x00};
|
||||||
// std::vector<uint8_t>& data_vec = map_send_data[ushortAdd];
|
std::vector<uint8_t>& data_vec = map_send_data[ushortAdd];
|
||||||
// const uint8_t* send_data = data_vec.data();
|
const uint8_t* send_data = data_vec.data();
|
||||||
// WriteToUart((const char*)send_data, 100);
|
WriteToUart((const char*)send_data, 100);
|
||||||
// mssleep(50000);
|
mssleep(50000);
|
||||||
// WriteToUart((const char*)send_data, 100);
|
WriteToUart((const char*)send_data, 100);
|
||||||
// mssleep(50000);
|
mssleep(50000);
|
||||||
// WriteToUart((const char*)send_data, 100);
|
WriteToUart((const char*)send_data, 100);
|
||||||
}else {
|
}else {
|
||||||
DealAskTask(ushortAdd);
|
DealAskTask(ushortAdd);
|
||||||
DealDataNodeFeature(pData, 0);
|
DealDataNodeFeature(pData, 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user