提交 12b208d4 authored 作者: blu's avatar blu

feature: record cmd from cloud to edge

上级 e6caa780
{
"data":{
"V2I0C7KC":{
"TESTDEV1":{
"addr":"127.0.0.1",
"apiCloud":"http://127.0.0.1:8089",
"ipcs":[
{
"addr":"172.31.0.129",
"addr":"rtsp://evcloudsvc.ilabservice.cloud/MerckTest50",
"modules":{
"evml":[
{
......@@ -14,7 +14,7 @@
"iid":1,
"post":30,
"pre":4,
"sn":"V2I0C7KC",
"sn":"TESTDEV1",
"thresh":30,
"fpsProc": 3,
"entropy": 0.3,
......@@ -27,7 +27,7 @@
"iid":1,
"enabled": 1,
"portPub":5556,
"sn":"V2I0C7KC"
"sn":"TESTDEV1"
}
],
"evpusher":[
......@@ -35,9 +35,9 @@
"enabled":1,
"iid":2,
"password":"",
"sn":"V2I0C7KC",
"sn":"TESTDEV1",
"token":"",
"urlDest":"rtsp://40.73.41.176/V2I0C7KC",
"urlDest":"rtsp://evcloudsvc.ilabservice.cloud/TESTDEV1",
"user":""
}
],
......@@ -46,8 +46,8 @@
"enabled":1,
"iid":1,
"path":"slices",
"sn":"V2I0C7KC",
"videoServerAddr": "http://40.73.41.176:10009/upload/evtvideos/"
"sn":"TESTDEV1",
"videoServerAddr": "http://evcloudsvc.ilabservice.cloud:10009/upload/evtvideos/"
}
]
},
......@@ -55,14 +55,14 @@
"port":554,
"proto":"rtsp",
"user":"admin",
"sn": "V2I0C7KC"
"sn": "TESTDEV1"
}
],
"mqttCloud":"<cloud_addr>",
"portCloud":5556,
"portRouter":5550,
"proto":"zmq",
"sn":"V2I0C7KC"
"sn":"darwin_test"
}
},
"lastupdated":1567669674
......
......@@ -1452,7 +1452,7 @@ public:
auto type = body["type"].get<string>();
// find slicer id by camera sn
if(this->peerData["ipcStatus"].count(sn) != 0) {
auto dsn = this->peerData["ipcStatus"][sn]["mgrTerminal"].get<string>();
auto dsn = this->peerData["ipcStatus"][sn]["mgrTerminal"]["sn"].get<string>();
json j = getConfigForDevice(dsn);
if(j["code"] == 0) {
for(auto &[k,v]:j["data"].items()){
......
......@@ -174,14 +174,15 @@ private:
// msg from cluster mgr
if(peerId == daemonId) {
if(metaValue == EV_MSG_META_VALUE_CMD_STOP || metaValue == EV_MSG_META_VALUE_CMD_RESTART) {
spdlog::info("{} received {} cmd from cluster mgr {}", selfId, metaValue, daemonId);
spdlog::info("{} received {} cmd from cluster daemon {}", selfId, metaValue, daemonId);
bProcessed = true;
exit(0);
}
else if(metaValue == "debug:record") {
try {
json body = json::parse(body2str(v[2]));
if(body.count("data") != 0 && body["data"].is_object() && body["data"].count("start") != 0 && body["data"]["start"].is_number() && body["data"].count("end") != 0 && body["data"]["end"].is_number() && body["data"].count("type") != 0 && body["data"]["type"].is_string()) {
spdlog::info("{} received debug:record body: {}", selfId, body.dump());
if(body.count("data") != 0 && body["data"].is_object() && body["data"].count("start") != 0 && body["data"]["start"].is_number() && body["data"].count("end") != 0 && body["data"]["end"].is_number() && body["data"].count("type") != 0) {
json evt;
evt["type"] = body["data"]["type"];
evt["start"] = body["data"]["start"];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论