add interface

This commit is contained in:
lnk
2026-03-13 16:07:22 +08:00
parent 93def18fbd
commit af937a8360
4 changed files with 519 additions and 82 deletions

View File

@@ -1631,11 +1631,18 @@ void process_received_message(string mac, string id,const char* data, size_t len
<< ", Cloud=" << result.CloudTimeSync << "\n"
<< " Signal: " << result.SignalStrength << std::endl;
runninginfo_cache_put(id, result);
on_device_response_minimal(static_cast<int>(ResponseCode::OK), id, 0, static_cast<int>(DeviceState::READING_RUNNINGINFORMATION_1));
//读取装置运行信息(主动触发)成功,调整为空闲,处理后续工作。
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}
else {
// 装置答非所问异常
on_device_response_minimal(static_cast<int>(ResponseCode::INTERNAL_ERROR), id, 0, static_cast<int>(DeviceState::READING_RUNNINGINFORMATION_1));
// 读取装置运行信息(主动触发)失败,调整为空闲状态,处理下一项工作。
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}
@@ -2006,11 +2013,15 @@ void process_received_message(string mac, string id,const char* data, size_t len
<< " Time Sync Methods: 0x" << versionInfo.TimeSyncMethods << "\n"
<< " Device Functions: 0x" << versionInfo.DeviceFunctions << std::dec << "\n";
versioninfo_cache_put(id, versionInfo);
on_device_response_minimal(static_cast<int>(ResponseCode::OK), id, 0, static_cast<int>(DeviceState::READING_DEVVERSION));
//读取装置版本配置信息成功,调整为空闲,处理后续工作。
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}
else {
// 装置答非所问异常
on_device_response_minimal(static_cast<int>(ResponseCode::INTERNAL_ERROR), id, 0, static_cast<int>(DeviceState::READING_DEVVERSION));
// 读取装置版本配置信息失败,调整为空闲状态,处理下一项工作。
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}