cheliequan
2023-01-12 19364a2cc1bdba9c8e8296df0d06cee336d187e6
Merge branch 'master' of http://192.168.5.5:10010/r/valib/c_bhomedbapi
2个文件已删除
5个文件已添加
4个文件已修改
130 ■■■■ 已修改文件
CMakeLists.txt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
camera.cpp 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dbapi.h 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.cpp 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
polygon.cpp 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rule.cpp 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rule.h 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sdk.cpp 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
stack.cpp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sysset.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
sysset.h 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CMakeLists.txt
@@ -32,7 +32,11 @@
    )
set(src
    ${CMAKE_SOURCE_DIR}/camera.cpp
    ${CMAKE_SOURCE_DIR}/polygon.cpp
    ${CMAKE_SOURCE_DIR}/rule.cpp
    ${CMAKE_SOURCE_DIR}/sdk.cpp
    ${CMAKE_SOURCE_DIR}/stack.cpp
    ${CMAKE_SOURCE_DIR}/sysset.cpp
    ${CMAKE_SOURCE_DIR}/util.cpp
    ${CMAKE_SOURCE_DIR}/3rdparty/yyjson/yyjson.c
camera.cpp
New file
@@ -0,0 +1,19 @@
#include "dbapi.h"
#include "util.h"
using namespace protomsg;
// 加get参数 runType 1: 实时 0 轮询
bool dbapi_get_cameras_by_runtype(void *handle, std::vector<protomsg::Camera> & list) {
    const char *topic = DATA_URL_PREFIX("/camera/getCamerasByRunType");
    return true;
}
// 加get参数 runType 1: 实时 0 轮询
bool dbapi_get_gb28181_cameras_by_runtype(void *handle, std::vector<protomsg::Camera> & list) {
    const char *topic = DATA_URL_PREFIX("/gb28181/camera/getCamerasByRunType");
    return true;
}
dbapi.h
New file
@@ -0,0 +1,27 @@
#ifndef C_BHOME_BUS_DBAPIS_H
#define C_BHOME_BUS_DBAPIS_H
#include <vector>
#include "proto/x86_64/sysset.pb.h"
#include "proto/x86_64/protomsg.pb.h"
#include "proto/x86_64/fileanalysis.pb.h"
using namespace std;
bool dbapi_get_server_info(void *handle, protomsg::LocalConfig & message);
bool dbapi_get_poll_config(void *handle, protomsg::PollConfig & message);
bool dbapi_get_stack_config(void *handle, protomsg::FileAnalysisSetting & message);
bool dbapi_get_time_rules(void *handle, std::vector<protomsg::CameraTimerule> & list);
bool dbapi_get_camera_rules(void *handle, std::vector<protomsg::CameraAndRules> & list);
bool dbapi_get_cameras_by_runtype(void *handle, std::vector<protomsg::Camera> & list);
bool dbapi_get_gb28181_cameras_by_runtype(void *handle, std::vector<protomsg::Camera> & list);
bool dbapi_get_sdk_channel_set(void *handle, std::vector<protomsg::SdkChanSet> & list);
bool dbapi_get_sdks(void *handle, std::vector<protomsg::Sdk> & list);
bool dbapi_get_doing_stacks(void *handle, std::vector<protomsg::FileStack> & list);
bool dbapi_get_polygons(void *handle, std::vector<protomsg::CameraPolygon> & list);
bool dbapi_get_polygon_relations(void *handle, std::vector<protomsg::CameraPolygonRelation> & list);
#endif
main.cpp
@@ -9,8 +9,7 @@
#include "3rdparty/bus_client/cbhomeclient.h"
#include "3rdparty/bus_client/message.h"
#include "sysset.h"
#include "rule.h"
#include "dbapi.h"
#include "proto/x86_64/sysset.pb.h"
#include "proto/x86_64/fileanalysis.pb.h"
#include "proto/x86_64/protomsg.pb.h"
polygon.cpp
New file
@@ -0,0 +1,17 @@
#include "dbapi.h"
#include "util.h"
using namespace protomsg;
bool dbapi_get_polygons(void *handle, std::vector<protomsg::CameraPolygon> & list) {
    const char *topic = DATA_URL_PREFIX("/polygon/findAll");
    return true;
}
bool dbapi_get_polygon_relations(void *handle, std::vector<protomsg::CameraPolygonRelation> & list) {
    const char *topic = DATA_URL_PREFIX("/polygon/relation/findAll");
     return true;;
}
rule.cpp
@@ -1,10 +1,10 @@
#include "rule.h"
#include "dbapi.h"
#include "util.h"
#include "3rdparty/yyjson/yyjson.h"
using namespace protomsg;
bool dbapi_get_time_rules(void *handle, vector<protomsg::CameraTimerule> & list) {
bool dbapi_get_time_rules(void *handle, std::vector<protomsg::CameraTimerule> & list) {
    const char *topic = DATA_URL_PREFIX("/cameraTimerule/findAll");
    char * ptr_value = NULL;
@@ -76,3 +76,10 @@
    return true;
}
bool dbapi_get_camera_rules(void *handle, std::vector<protomsg::CameraAndRules> & list) {
    const char *topic = DATA_URL_PREFIX("/camera/rule/findAll");
     return true;;
}
rule.h
File was deleted
sdk.cpp
New file
@@ -0,0 +1,16 @@
#include "dbapi.h"
#include "util.h"
using namespace protomsg;
bool dbapi_get_sdk_channel_set(void *handle, std::vector<protomsg::SdkChanSet> & list) {
    const char *topic = DATA_URL_PREFIX("/sdk/getAllSdkChanSet");
    return true;
}
bool dbapi_get_sdks(void *handle, std::vector<protomsg::Sdk> & list) {
    const char *topic = DATA_URL_PREFIX("/sdk/findAllSdk");
    return true;
}
stack.cpp
New file
@@ -0,0 +1,11 @@
#include "dbapi.h"
#include "util.h"
using namespace protomsg;
bool dbapi_get_doing_stacks(void *handle, std::vector<protomsg::FileStack> & list) {
    const char *topic = DATA_URL_PREFIX("/fileStack/findAllDoingStacks");
    return true;
}
sysset.cpp
@@ -1,4 +1,4 @@
#include "sysset.h"
#include "dbapi.h"
#include "util.h"
using namespace protomsg;
sysset.h
File was deleted