/******************************************************************************
|
|
版权所有 (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;
|
}
|
|
|
bool dbapi_get_json_by_cameralist(std::vector<protomsg::Camera> &list, string &json) {
|
bool ret = bus_dbapi_get_json(list, json);
|
|
return ret;
|
}
|