From 6056ea167ac0deeeb2a1c487b8d041d491dd4b00 Mon Sep 17 00:00:00 2001 From: lnk Date: Tue, 16 Sep 2025 10:13:47 +0800 Subject: [PATCH] add --- LFtid1056/dealMsg.cpp | 2 ++ LFtid1056/main_thread.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/LFtid1056/dealMsg.cpp b/LFtid1056/dealMsg.cpp index 78d1e20..acbe8b6 100644 --- a/LFtid1056/dealMsg.cpp +++ b/LFtid1056/dealMsg.cpp @@ -1031,6 +1031,7 @@ void process_received_message(string mac, string id,const char* data, size_t len uint8_t monitor_index = parser.RecvData[0]; std::cout << "Monitor Index: " << static_cast(monitor_index) << std::endl; send_set_value_reply(id, monitor_index, dz_list); + on_device_response_minimal(static_cast(ResponseCode::OK), id, 0, static_cast(DeviceState::READING_FIXEDVALUE)); //定值描述读取完毕,调整为空闲,处理后续工作。 ClientManager::instance().change_device_state(id, DeviceState::IDLE); @@ -1261,6 +1262,7 @@ void process_received_message(string mac, string id,const char* data, size_t len } send_internal_value_reply(id, control_words); + on_device_response_minimal(static_cast(ResponseCode::OK), id, 0, static_cast(DeviceState::READING_INTERFIXEDVALUE)); // 控制字描述读取完毕,调整为空闲,处理后续工作 ClientManager::instance().change_device_state(id, DeviceState::IDLE); diff --git a/LFtid1056/main_thread.cpp b/LFtid1056/main_thread.cpp index cf42326..9e0d208 100644 --- a/LFtid1056/main_thread.cpp +++ b/LFtid1056/main_thread.cpp @@ -154,17 +154,17 @@ void* client_manager_thread(void* arg) { printf("Started client connections\n"); // 创建测点数据 - std::vector points1 = { + /*std::vector points1 = { {"P001", "Main Voltage", "D001",1 ,1, 1, 1, 1,"0.38k",0}, {"P002", "Backup Voltage", "D001",2 ,1, 1, 1, 1,"0.38k",0} }; std::vector points2 = { {"P003", "Main Voltage", "D002",1 ,1, 1, 1, 1,"0.38k",0}, {"P004", "Backup Voltage", "D002",2 ,1, 1, 1, 1,"0.38k",0} - }; + };*/ //00B78DA800D6 00-B7-8D-01-79-06 00-B7-8D-A8-00-D6 00-B7-8D-01-71-09 00-B7-8D-01-88-7f // 创建装置列表 - std::vector devices = { + /*std::vector devices = { { "D001", "Primary Device", "Model-X", "00-B7-8D-01-88-7f", 1, points1,true @@ -173,13 +173,13 @@ void* client_manager_thread(void* arg) { "D002", "Primary Device1", "Model-X1", "00-B7-8D-01-71-09", 1, points2,true } - }; + };*/ // 生成100个测试装置 //std::vector test_devices = generate_test_devices(100); //lnk从台账读取设备 - //std::vector devices = GenerateDeviceInfoFromLedger(terminal_devlist);//lnk添加 + std::vector devices = GenerateDeviceInfoFromLedger(terminal_devlist);//lnk添加 //台账打印 PrintDevices(devices); @@ -310,7 +310,7 @@ int main(int argc ,char** argv) {// std::cerr << "process param error,exit" << std::endl; return 1; } - //init_daemon(); + init_daemon(); srand(time(NULL)); // 初始化随机数种子 // 初始化线程数组