调整测试demo订阅的主题

This commit is contained in:
zgj
2025-02-25 10:27:47 +08:00
parent 166fef54ef
commit 8f7b42d7b3
+3 -2
View File
@@ -46,8 +46,9 @@ int GetVersion::HandleMsg(const msg_t msg,msg_t &outMsg, handparam_t *param) {
recvTimeStr = jsObj["time"];
}catch (nlohmann::json::parse_error& e) {
std::cerr << "Parsing error: " << e.what() << std::endl;
return false;
return -1;
}
makeGetVersionReponse(tokenStr,outMsg);
return 0;
}
@@ -66,7 +67,7 @@ void GetVersion::makeGetVersionReponse(std::string tokenStr,msg_t &outMsg) {
js["time"] = ToolUtils::getTimeStringWithFomat(true);
js["data"] = {{"version","shb-xxxx"}};
outMsg.topic = "/test2-topic";
outMsg.topic = "/sys.dbc/sys.brd/S-datacenter/F-GetVersion";
outMsg.payload = js.dump();
outMsg.timestamp = ToolUtils::getUtcTime(true);
}