diff --git a/localserver/web_cmd.cpp b/localserver/web_cmd.cpp index cfcfd66..0172e96 100644 --- a/localserver/web_cmd.cpp +++ b/localserver/web_cmd.cpp @@ -672,30 +672,6 @@ std::string LocalServer::HandleCgi_cmd(std::string &pData) { std::string data = jd.JsonCmd_Cgi_71(param); return data; }break; - case kGetFeatureSensorInfo:{ - JsonData jd; - Param_101 param; - param.mac = recvBody["mac"].asString(); - param.timeStart = recvBody["timeStart"].asString(); - param.timeEnd = recvBody["timeEnd"].asString(); - param.mPackageFlag = recvBody["package"].asInt(); - std::string data = jd.JsonCmd_Cgi_101(param); - return data; - }break; - case kScanSenorInfo:{ - JsonData jd; - std::string data = jd.JsonCmd_Cgi_102(); - return data; - }break; - case kOperateSensor:{ - JsonData jd; - Param_103 param; - param.mac = recvBody["mac"].asString(); - param.name = recvBody["name"].asString(); - param.operate = recvBody["operate"].asString(); - std::string data = jd.JsonCmd_Cgi_103(param); - return data; - }break; default: JsonData jd; std::string data = jd.JsonCmd_Cgi_default(); diff --git a/uart/uart.cpp b/uart/uart.cpp index 1ca1dc8..2e4f0a1 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -416,32 +416,7 @@ int Uart::DealAskTask(uint16_t ushortAdd){ zlog_info(zct, " DealAskTask end" ); return 0; } -int Uart::DealAskTaskOld(uint16_t ushortAdd){ - char wherecon[50]={0}; - sprintf(wherecon, "zigbeeShortAddr='%02x%02x'", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd)); - int sensor_count = sqlite_db_ctrl::instance().GetTableRows(T_SENSOR_INFO(TNAME), wherecon); - if (sensor_count < 1) { - zlog_warn(zct, "device info not found %02x%02x ", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd)); - return 1; - } - int next_duration = 0,next_task_id = 0; - int taskID; - ScheduleTask scheduleTask; - taskID = scheduler::instance().StartSchedule(ushortAdd,next_duration, next_task_id); - zlog_info(zct, "DealAskTaskOld taskID = %d next_duration = %d next_task_id = %d", taskID, next_duration, next_task_id); - if(next_task_id == kScheduleUpgrade){ - scheduleTask.cmd = REVIVE_DURATION; - scheduleTask.shortAddr = ushortAdd; - scheduleTask.duration = next_duration; - scheduleTask.next_taskID = UPGRADE; - TaskResp(scheduleTask); - } - if (taskID == kScheduleUpgrade){ - UpdateWirelessNode(ushortAdd); - } - return 0; -} int Uart::DealException(const char* pData){ return 0; } @@ -686,7 +661,35 @@ int Uart::DealFeatureValue(const char *pData,uint16_t ushortAdd){ last_time = atol(nowTimetamp.c_str()); return 0; } +int Uart::DealAskTaskOld(uint16_t ushortAdd){ + char wherecon[50]={0}; + sprintf(wherecon, "zigbeeShortAddr='%02x%02x'", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd)); + int sensor_count = sqlite_db_ctrl::instance().GetTableRows(T_SENSOR_INFO(TNAME), wherecon); + if (sensor_count < 1) { + zlog_warn(zct, "device info not found %02x%02x ", UINT16_HIGH(ushortAdd),UINT16_LOW(ushortAdd)); + return 1; + } + int next_duration = 0,next_task_id = 0; + int taskID; + ScheduleTask scheduleTask; + bool z = false; + taskID = scheduler::instance().StartSchedule(ushortAdd,next_duration,z, next_task_id); + zlog_warn(zct, "DealAskTaskOld taskID = %d next_duration = %d next_task_id = %d", taskID, next_duration, next_task_id); + //if(next_task_id == kScheduleUpgrade) + { + // scheduleTask.cmd = REVIVE_DURATION; + // scheduleTask.shortAddr = ushortAdd; + // scheduleTask.duration = next_duration; + // scheduleTask.next_taskID = UPGRADE; + // TaskResp(scheduleTask); + UpdateWirelessNode(ushortAdd); + } + if (taskID == kScheduleUpgrade){ + + } + return 0; +} void Uart::DealRecvData(const char *pData) { uint16_t ushortAdd = BUILD_UINT16(pData[3] & 0xFF, pData[4] & 0xFF);