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

feature: record cmd from cloud to edge

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