cheliequan
2023-01-16 382be0b170230274bb18c66dd42146b255d7245a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/******************************************************************************
 
                  版权所有 (C), 2001-2011, 北京贝思科技术有限公司
 
 ******************************************************************************
  文 件 名   : camera.cpp
  版 本 号   : 初稿
  作    者   : cheliequan
  生成日期   : 2023年1月13日
  最近修改   :
  功能描述   : 获取相机相关信息
  函数列表   :
              dbapi_get_cameras_by_runtype
              dbapi_get_gb28181_cameras_by_runtype
  修改历史   :
  1.日    期   : 2023年1月13日
    作    者   : cheliequan
    修改内容   : 创建文件
 
******************************************************************************/
 
/*----------------------------------------------*
 * 包含头文件                                   *
 *----------------------------------------------*/
 
/*----------------------------------------------*
 * 外部变量说明                                 *
 *----------------------------------------------*/
 
/*----------------------------------------------*
 * 外部函数原型说明                             *
 *----------------------------------------------*/
 
/*----------------------------------------------*
 * 内部函数原型说明                             *
 *----------------------------------------------*/
 
/*----------------------------------------------*
 * 全局变量                                     *
 *----------------------------------------------*/
 
/*----------------------------------------------*
 * 模块级变量                                   *
 *----------------------------------------------*/
 
/*----------------------------------------------*
 * 常量定义                                     *
 *----------------------------------------------*/
 
/*----------------------------------------------*
 * 宏定义                                       *
 *----------------------------------------------*/
 
#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, char *runType, bool gb28181) {
    const char *topic = DATA_URL_PREFIX("/camera/getCamerasByRunType");
    if (gb28181) {
        topic = DATA_URL_PREFIX("/gb28181/camera/getCamerasByRunType)");
    }
 
    std::map<string, string> params;
    params["runType"] = runType;
    bool ret = bus_dbapi_get_list(handle, topic, list, params);
    params.clear();
 
    return ret;
}