From 88178aed18f9f1a42b8429e500b8431952f87f4d Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 12 一月 2023 17:38:13 +0800
Subject: [PATCH] 添加时间规则接口定义
---
rule.cpp | 4 ++--
main.cpp | 12 +++++++++---
rule.h | 4 +++-
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/main.cpp b/main.cpp
index bdc8578..8029bd9 100644
--- a/main.cpp
+++ b/main.cpp
@@ -42,9 +42,15 @@
// }
// 鏁版嵁鏍堥厤缃� fileanalysis.pb.h
- protomsg::FileAnalysisSetting node;
- if (dbapi_get_stack_config(handle, node)) {
- printf("StackConfig: %s\n", node.filedirectory().c_str());
+ // protomsg::FileAnalysisSetting node;
+ // if (dbapi_get_stack_config(handle, node)) {
+ // printf("StackConfig: %s\n", node.filedirectory().c_str());
+ // }
+
+ // 鏃堕棿瑙勫垯
+ std::vector<protomsg::CameraTimerule> list;
+ if (dbapi_get_time_rules(handle, list)) {
+ printf("CameraTimerule:\n");
}
return 0;
diff --git a/rule.cpp b/rule.cpp
index 12636de..df571c1 100644
--- a/rule.cpp
+++ b/rule.cpp
@@ -3,8 +3,8 @@
using namespace protomsg;
-bool dbapi_get_time_rules(void *handle, protomsg::CameraTimerule & message) {
+bool dbapi_get_time_rules(void *handle, vector<protomsg::CameraTimerule> & list) {
const char *topic = DATA_URL_PREFIX("/cameraTimerule/findAll");
- return bus_dbapi_get(handle, topic, message);
+ return true;
}
diff --git a/rule.h b/rule.h
index b89d045..f7471ed 100644
--- a/rule.h
+++ b/rule.h
@@ -1,8 +1,10 @@
#ifndef C_BHOME_BUS_DBAPI_RULE_H
#define C_BHOME_BUS_DBAPI_RULE_H
+#include <vector>
#include "proto/x86_64/protomsg.pb.h"
+using namespace std;
-bool dbapi_get_time_rules(void *handle, protomsg::CameraTimerule & message);
+bool dbapi_get_time_rules(void *handle, std::vector<protomsg::CameraTimerule> & list);
#endif
\ No newline at end of file
--
Gitblit v1.8.0