提交 2201b433 authored 作者: bruce.lu's avatar bruce.lu

init

上级 8f65730b
#pragma GCC diagnostic ignored "-Wunused-variable"
#include "inc/database.h"
//#include "inc/json.hpp"
#include "spdlog/spdlog.h"
#include <cstdlib>
#include <mutex>
#include <map>
......@@ -10,8 +6,12 @@
#include <iomanip>
#include <thread>
#include <chrono>
#include "inc/database.h"
#include "spdlog/spdlog.h"
#include "inc/httplib.h"
using namespace leveldb;
using namespace httplib;
string _config_default_tmpl = "{\"time\":0,\"code\":0,\"data\":{\"<SN_MGR>\":{\"sn\":\"<SN_MGR>\",\"addr\":\"127.0.0.1\",\"mqtt-cloud\":\"<cloud_addr>\",\"api-cloud\":\"http://127.0.0.1:8089\",\"proto\":\"zmq\",\"port-cloud\":5556,\"port-router\":5550,\"status\":1,\"ipcs\":[{\"addr\":\"172.31.0.51\",\"proto\":\"rtsp\",\"user\":\"admin\",\"password\":\"FWBWTU\",\"status\":0,\"port\":554,\"modules\":{\"evpuller\":[{\"sn\":\"<SN_PULLER>\",\"addr\":\"127.0.0.1\",\"iid\":1,\"port-pub\":5556,\"status\":0}],\"evpusher\":[{\"sn\":\"<SN_PUSHER>\",\"iid\":1,\"urlDest\":\"rtsp://40.73.41.176:554/test1\",\"user\":\"\",\"password\":\"\",\"token\":\"\",\"enabled\":1,\"status\":0}],\"evslicer\":[{\"sn\":\"<SN_SLICER>\",\"iid\":1,\"path\":\"slices\",\"enabled\":1,\"status\":0}],\"evml\":[{\"type\":\"motion\",\"sn\":\"<SN_ML>\",\"iid\":1,\"pre\":3,\"area\":300,\"post\":30,\"thresh\":80,\"enabled\":1,\"status\":0}]}}]}}}";
......@@ -446,4 +446,17 @@ togo_end:
return 0;
};
}// namespace LVDB
namespace cloudutils {
json registry(const char *sn, const json &config)
{
//if(config.)
return json();
}
} // namespace cloudutils
\ No newline at end of file
......@@ -53,6 +53,6 @@ namespace LVDB {
typedef int(*cb_traverse_configration_module)(string modname, json &mod);
int traverseConfigureModules(json &config, cb_traverse_configration_module cb, string moduleName = "");
}
} // namespace LVDB
#endif
\ No newline at end of file
......@@ -29,7 +29,7 @@ namespace cloudutils
"lastupdated": 0,
"sn":"ILSEVMGR1",
"addr":"172.31.0.76",
"addr-cloud":"172.31.0.76",
"addr-cloud":"172.31.0.76",RzMbCp5W6^ZS
"proto":"zmq",
"port-cloud":5556,
"port-router":5550,
......@@ -91,14 +91,6 @@ namespace cloudutils
*/
// const char *config = "{\"time\":0,\"code\":0,\"data\":{\"ILSEVMGR1\":{\"sn\":\"ILSEVMGR1\",\"addr\":\"127.0.0.1\",\"addr-cloud\":\"127.0.0.1\",\"proto\":\"zmq\",\"port-cloud\":5556,\"port-router\":5550,\"status\":1,\"ipcs\":[{\"addr\":\"172.31.0.51\",\"proto\":\"rtsp\",\"user\":\"admin\",\"password\":\"iLabService\",\"status\":1,\"modules\":{\"evpuller\":[{\"sn\":\"ILSEVPULLER1\",\"addr\":\"127.0.0.1\",\"iid\":1,\"port-pub\":5556,\"status\":1}],\"evpusher\":[{\"sn\":\"ILSEVPUSHER1\",\"iid\":1,\"urlDest\":\"rtsp://40.73.41.176:554/test1\",\"user\":\"\",\"password\":\"\",\"token\":\"\",\"enabled\":1,\"status\":1}],\"evslicer\":[{\"sn\":\"ILSEVSLICER1\",\"iid\":1,\"path\":\"slices\",\"enabled\":1,\"status\":1}],\"evml\":[{\"type\":\"motion\",\"sn\":\"ILSEVMLMOTION1\",\"iid\":1,\"enabled\":1,\"status\":1}]}}]}}}";
json registry(const char *sn, const json &config)
{
// find local info in db
// request cloud info
// moc
return json();
}
vector<string> split(const std::string& s, char delimiter)
{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论