diff --git a/LFtid1056/dealMsg.cpp b/LFtid1056/dealMsg.cpp index 1f5172b..1059b41 100644 --- a/LFtid1056/dealMsg.cpp +++ b/LFtid1056/dealMsg.cpp @@ -706,8 +706,8 @@ void process_received_message(string mac, string id,const char* data, size_t len << ", Error: " << strerror(errno) << std::endl; // 文件保存失败,通知云端 - on_device_response_minimal(static_cast(ResponseCode::BAD_REQUEST), - id, 0, static_cast(DeviceState::READING_EVENTFILE)); + /*on_device_response_minimal(static_cast(ResponseCode::BAD_REQUEST), + id, 0, static_cast(DeviceState::READING_EVENTFILE));*/ } //当前文件下载完毕,调整为空闲处理下一项工作(如果这里后续有新文件等待下载,一般已经存入等待队列等候处理了,调成空闲状态后直接就会开始新文件的下载工作) @@ -716,7 +716,7 @@ void process_received_message(string mac, string id,const char* data, size_t len } else { // 装置答非所问异常 - on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_EVENTFILE)); + //on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_EVENTFILE)); // 接收波形文件数据错误,调整为空闲状态,处理下一项工作。 ClientManager::instance().change_device_state(id, DeviceState::IDLE); } @@ -848,6 +848,7 @@ void process_received_message(string mac, string id,const char* data, size_t len } else { + on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_FILEDATA)); std::cerr << "Failed to save file: " << file_path << ", Error: " << strerror(errno) << std::endl; } @@ -871,6 +872,7 @@ void process_received_message(string mac, string id,const char* data, size_t len // 确保数据长度足够包含测点序号 if (parser.RecvData.size() < 1) { std::cout << "Invalid fix value data length" << std::endl; + on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_FIXEDVALUE)); ClientManager::instance().change_device_state(id, DeviceState::IDLE); break; } @@ -887,6 +889,7 @@ void process_received_message(string mac, string id,const char* data, size_t len if (bufflen % structlen != 0) { std::cout << "Invalid fix value data length: " << bufflen << " (not multiple of 4)" << std::endl; + on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_FIXEDVALUE)); ClientManager::instance().change_device_state(id, DeviceState::IDLE); break; } @@ -950,6 +953,7 @@ void process_received_message(string mac, string id,const char* data, size_t len if (bufflen == 0 || bufflen % structlen != 0) { std::cerr << "Invalid fixdes data length: " << bufflen << " (expected multiple of " << structlen << ")" << std::endl; + on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_FIXEDVALUEDES)); ClientManager::instance().change_device_state(id, DeviceState::IDLE); break; } @@ -1126,6 +1130,7 @@ void process_received_message(string mac, string id,const char* data, size_t len std::cerr << "Invalid internal fixdes data length: " << bufflen << " (expected multiple of " << structlen << ")" << std::endl; ClientManager::instance().change_device_state(id, DeviceState::IDLE); + on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_INTERFIXEDVALUEDES)); break; } else @@ -1200,6 +1205,7 @@ void process_received_message(string mac, string id,const char* data, size_t len if (bufflen == 0 || bufflen % structlen != 0) { std::cerr << "Invalid control word data length: " << bufflen << " (expected multiple of " << structlen << ")" << std::endl; + on_device_response_minimal(static_cast(ResponseCode::INTERNAL_ERROR), id, 0, static_cast(DeviceState::READING_CONTROLWORD)); ClientManager::instance().change_device_state(id, DeviceState::IDLE); break; }