资源描述
平台SDK开发手册 (CS客户端部分)
非常感谢选择本公司产品,我们将竭诚为您提供最好的服务。
本手册内容将不定期更新,恕不另行通知;更新内容将在版本更新信息中给出。
如您对手册中的内容有疑惑或者有好的建议,请通过技术支持联系我们。
我们的进步需要您的宝贵意见。
1. 简介
1.1 前提
当您阅读该开发手册时,同时应该拿到以下内容:
1. PlatformSDK.h
2. PlatformSDK.dll及其依赖的其他dll
3. PlatSDK_Test,为平台SDK(CS部分)的测试demo,包括C++源代码及可执行程序。
1.2 版本信息
版本号
日期
变更说明
1.0.0
2015-03-23
发布
2. 接口定义
2.1 初始化/反初始化接口定义
2.1.1 初始化接口
接口名称:
int Plat_Init();
接口描述:
初始化平台SDK
参数说明:
无
返回值:
成功返回0,错误时返回-1,通过Plat_GetLastError()查看错误码
备注:
初始化接口只需调用一次,在调用任何接口前,必须调用 Plat_Init完成初始化工作
2.1.2 反初始化接口
接口名称:
int Plat_UnInit();
接口描述:
反初始化平台SDK
参数说明:
无
返回值:
成功返回0,错误时返回-1,通过Plat_GetLastError()查看错误码
备注:
释放资源,全局只调用一次
2.2 用户接口定义
2.2.1 登录接口
接口名称:
int Plat_LoginCMS(
const char* cscmsIP,
int icmsPort,
const char* csUserName,
const char* csPSW,
int iLoginType = 0,
int iMqPort = 61618);
接口描述:
用户登录到指定平台
参数说明:
参数名
输入/输出
描述
cscmsIP
[in]
中心管理服务器地址,(例“172.7.150.2”)
icmsPort
[in]
中心管理服务器端口。(例80)
csUserName
[in]
用户名 (例 admin)
csPSW
[in]
用户密码(例admin)
iLoginType
[in]
登录类型。(为预留参数,默认为0)
iMqPort
[in]
MQ服务器端口,默认61618
返回值:成功返回一个大于0的会话句柄,错误时返回-1,通过Plat_GetLastError()查看错误码
备注:无
2.2.2 登出接口
接口名称:
int Plat_LogoutCMS(int iUserHandle);
接口描述:
用户登出接口
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
返回值:
成功返回0,错误时返回-1,通过Plat_GetLastError()查看错误码
备注:
无
2.3 组织资源接口定义
2.3.1 获取控制中心信息接口
接口名称:
int Plat_GetAllControlCell(
int iUserHandle,
int iNeedGetNum,
PLAT_CONTROLCELLINFO* pCellBuffer,
int* pOutputNum);
接口描述:
获取控制中心列表信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的中心个数
pCellBuffer
[in][out]
存放控制单元的缓冲区,由调用者分配
pOutputNum
[out]
输出资源数目,当缓冲区为NULL时,pOutputNum的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目
返回值:
成功返回0,错误时返回-1,通过Plat_GetLastError()查看错误码
备注:
无
2.3.2 获取区域信息接口
接口名称:
int Plat_GetAllRegion (
int iUserHandle,
int iNeedGetNum,
PLAT_REGIONINFO* pRegionBuffer,
int* pOutputNum);
接口描述:
获取区域信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的资源个数
pRegionBuffer
[in][out]
存放区域的缓冲区,由调用者分配
pOutputNum
[out]
输出资源数目,当缓冲区为NULL时,pOutputNum的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目
返回值:
成功返回0,错误时返回-1,通过Plat_GetLastError()查看错误码
备注:
无
2.4 查询权限接口定义
2.4.1 查询权限接口
接口名称:
int Plat_CheckRight(
int iUserHandle,
int iObjectType,
int iRightTpye,
int iObjectID);
接口描述:
检查资源权限
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iObjectType
[in]
权限元素类型,见PLAT_PRLOBJTYPE_*
iRightTpye
[in]
权限掩码,见PLAT_PRLMASK_*
iObjectID
[in]
元素ID
返回值:
有权限时返回0,无权限返回-1
备注:
无
2.5 报警/事件订阅接口定义
2.5.1 订阅报警/事件接口
接口名称:
int Plat_SubscribeInfo(
int iUserHandle,
EventSubscribeCallback fSubscribeCallback,
void* pUser);
接口描述:
订阅报警、事件
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
fSubscribeCallback
[in]
报警、事件接收回调函数指针
pUser
[in]
用户数据
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.5.2 取消订阅接口
接口名称:
int Plat_UnSubscribeInfo(int iUserHandle);
接口描述:
取消订阅事件
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.5.3 根据URL获取图片
接口名称:
int Plat_GetPicDataByURL(
int iUserHandle,
const char* pURL,
char** pPicData,
int* pPicLen);
接口描述:
根据图片的URL获取图片信息,图片URL可以在订阅报警事件回调中获取
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
pURL
[in]
图片URL
pPicData
[out]
图片数据
pPicLen
[out]
图片长度
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
获取到图片后,需要调用Plat_FreePicData释放内存
2.5.4 释放图片数据
接口名称:
int Plat_FreePicData(
int iUserHandle,
char** pPicData);
接口描述:
释放图片数据
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
pPicData
[in]
图片数据
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.6 订阅状态接口定义
2.6.1 订阅状态接口
接口名称:
int Plat_SubscribeState (
int iUserHandle,
StateCallback fSubscribeCallback,
void* pUser);
接口描述:
订阅状态接口,包括设备在线状态、门禁状态等
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
fSubscribeCallback
[in]
资源状态接收回调函数指针
pUser
[in]
用户数据
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.6.2 取消订阅接口
接口名称:
int Plat_UnSubscribeState (int iUserHandle);
接口描述:
取消订阅接口
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.7 报警接口定义
2.7.1 获取设备主机信息
接口名称:
int Plat_VSS_GetDeviceHostInfo(
int iUserHandle,
int iType,
int iNeedGetNum,
LPPLAT_VSS_DEVICEHOST pOutDevHostInfo,
int* pOutputNum);
接口描述:
获取设备主机信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iType
[in]
报警设备类型,报警主机:PLAT_DEVICE_ALARM_HOST,消防主机:PLAT_DEVICE_FIRE_HOST,动环主机:PLAT_DEVICE_SENSOR_HOST,
停车场管理主机:PLAT_DEVICE_PARK_HOST,巡查主机:PLAT_DEVICE_PATROL
iNeedGetNum
[in]
需要获取的数目
pOutDevHostInfo
[in][out]
报警设备信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutDevHostInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.7.2 获取设备通道信息
接口名称:
int Plat_VSS_GetDevChnlInfo (
int iUserHandle,
int iType,
int iNeedGetNum,
LPPLAT_VSS_DEVICECHANNEL pOutDevChnlInfo,
int* pOutputNum);
接口描述:
获取设备通道信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iType
[in]
设备通道类型,报警IO:PLAT_RES_IO,防区:PLAT_RES_DEFENCE_AREA,消防点:PLAT_RES_FIRE_POINT,巡查点:PLAT_RES_PATROL_POINT
iNeedGetNum
[in]
需要获取的数目
pOutDevChnlInfo
[in][out]
报警设备通道信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutDevHostInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.7.3 报警控制
接口名称:
int Plat_VSS_AlarmControl (
int iUserHandle,
int iResourceID,
int iCommand);
接口描述:
获取设备通道信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iResourceID
[in]
资源ID
iCommand
[in]
控制命令,报警输出关闭:PLAT_CMD_IOCLOSE,报警输出打开:PLAT_CMD_IOOPEN;报警主机撤防:PLAT_CMD_ALMHOST_DISDEFENCE,
报警主机布防:PLAT_CMD_ALMHOST_DEFENCE;防区旁路恢复:PLAT_CMD_AREA_UNBYPASS,防区旁路:PLAT_CMD_AREA_BYPASS
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.7.4 获取报警状态
接口名称:
int Plat_VSS_GetAlarmState(
int iUserHandle,
int iType,
int* iRtnState);
接口描述:
获取设备通道信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iResourceID
[in]
资源ID
iType
[in]
资源类型:报警主机:PLAT_DEVICE_ALARM_HOST,报警IO:PLAT_RES_IO,防区:PLAT_RES_DEFENCE_AREA
iRtnState
[out]
返回资源的状态
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.8 一卡通接口定义
2.8.1 根据卡号获取人员信息
接口名称:
int Plat_ACS_GetPersonInfo (
int iUserHandle,
const char* csCardNo,
LPPLAT_ACS_PERSONINFO pOutPersonInfo);
接口描述:
根据卡号获取人员信息(获取一个人员信息)
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
csCardNo
[in]
卡号
pOutPersonInfo
[in]
单个人员信息输出缓冲区
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.8.2 获取所有人员信息
接口名称:
int Plat_ACS_GetAllPersonInfo (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ACS_PERSONINFO pOutPersonInfo,
int* pOutputNum);
接口描述:
获取所有人员信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutPersonInfo
[in][out]
需要获取的人员信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutPersonInfo为NULL时,pOutputNum的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.8.3 获取所有卡片信息
接口名称:
int Plat_ACS_GetCardInfo (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ACS_CARDINFO pOutCardInfo,
int* pOutputNum);
接口描述:
获取所有卡片信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutCardInfo
[in][out]
需要获取的门禁点信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutCardInfo为NULL时,pOutputNum的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.8.4 获取部门信息
接口名称:
int Plat_ATT_GetAllDepartments (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ATT_DEPARTMENT pOutputInfo,
int* pOutputNum);
接口描述:
获取所有部门信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutputInfo
[in][out]
需要获取的所有部门输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutputInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.9 门禁接口定义
2.9.1 获取门禁设备接口
接口名称:
int Plat_ACS_GetACDeviceInfo (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ACS_ACDEVICEINFO pOutACDeviceInfo,
int* pOutputNum);
接口描述:
获取所有人员信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutACDeviceInfo
[in][out]
需要获取的门禁设备信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutACDeviceInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.9.2 获取门禁点接口
接口名称:
int Plat_ACS_GetACDoorInfo (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ACS_ACCESSDOORINFO pOutACDoorInfo,
int* pOutputNum);
接口描述:
获取所有门禁点信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutACDoorInfo
[in][out]
需要获取的门禁点信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutACDoorInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.9.3 门禁点控制接口
接口名称:
int Plat_ACS_ACDoorControl (
int iUserHandle,
int iACDoorID,
int iCommand);
接口描述:
门禁点控制接口
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iACDoorID
[in]
门禁点ID
iCommand
[in]
控制命令,开门一次:PLAT_ACS_CMD_OPEN,关门:PLAT_ACS_CMD_CLOSE, 常开:PLAT_ACS_CMD_RELEASE,常闭:PLAT_ACS_CMD_LOCK
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.9.4 获取门禁点状态接口
接口名称:
int Plat_ACS_GetDoorState (
int iUserHandle,
int iACDoorID,
int* iRtnState);
接口描述:
获取门禁点状态
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iACDoorID
[in]
门禁点ID
iRtnState
[out]
返回的状态值
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.9.5 门禁设备参数配置接口
接口名称:
int Plat_ACS_SetDevConfig (
int iUserHandle,
int iACDevID,
const char* szConfXml);
接口描述:
门禁设备参数配置
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iACDevID
[in]
门禁设备ID
szConfXml
[out]
配置参数XML
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.10 考勤接口定义
2.10.1 查询刷卡记录数目接口
接口名称:
int Plat_ATT_QueryClockRecord (
int iUserHandle,
LPPLAT_ATT_SEARCHCONDITION pCondition,
int* pOutputNum);
接口描述:
查询刷卡记录数目
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
pCondition
[in]
查询条件
pOutputNum
[out]
输出资源数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.10.2 获取刷卡记录接口
接口名称:
int Plat_ATT_GetClockRecord (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ATT_CLOCKRECORD pOutputInfo,
int* pOutputNum);
接口描述:
获取刷卡记录
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目,Plat_ATT_QueryClockRecord接口中pOutputNum的值
pOutputInfo
[in] [out]
查询结果输出缓冲区
pOutputNum
[out]
输出数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.10.3 查询考勤结果接口
接口名称:
int Plat_ATT_QueryAttendResult (
int iUserHandle,
LPPLAT_ATT_SEARCHCONDITION pCondition,
int* pOutputNum);
接口描述:
查询考勤结果
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
pCondition
[in]
查询条件
pOutputNum
[out]
输出数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.10.4 获取考勤结果接口
接口名称:
int Plat_ATT_GetAttendResult (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ATT_ATTENDRESULT pOutputInfo,
int* pOutputNum);
接口描述:
获取考勤结果
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目,Plat_ATT_QueryAttendResult接口中pOutputNum的值
pOutputInfo
[in] [out]
查询结果输出缓冲区
pOutputNum
[out]
输出数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.11 梯控接口定义
2.11.1 获取梯控设备接口
接口名称:
int Plat_ECS_GetAllECDevices (
int iUserHandle,
int iNeedGetNum,
LPPLAT_ECS_ECDEVICEINFO pOutputInfo,
int* pOutputNum);
接口描述:
获取所有梯控设备信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutputInfo
[in] [out]
需要获取的所有梯控设备输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutputInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目。
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.12 巡查接口定义
2.12.1 获取所有巡查计划接口
接口名称:
int Plat_OPS_GetAllPatrolPlan (
int iUserHandle,
int iNeedGetNum,
LPPLAT_OPS_PATROLPLANINFO pOutputInfo,
int* pOutputNum);
接口描述:
获取所有巡查计划信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutputInfo
[in] [out]
需要获取的所有巡查计划信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutputInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.12.2 查询班次数目接口
接口名称:
int Plat_OPS_QuerySchdlNum (
int iUserHandle,
__int64 lStartTime,
__int64 lEndTime,
int* pOutputNum);
接口描述:
查询班次数目
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
lStartTime
[in]
开始时间
lEndTime
[in]
结束时间
pOutputNum
[out]
输出数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.12.3 获取所有班次信息接口
接口名称:
int Plat_OPS_GetAllSchedulings (
int iUserHandle,
int iNeedGetNum,
LPPLAT_OPS_SCHEDULINGINFO pOutputInfo,
int* pOutputNum);
接口描述:
获取所有班次信息
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目,Plat_OPS_QuerySchdlNum接口中pOutputNum的返回值
pOutputInfo
[in] [out]
需要获取的所有巡查班次信息输出缓冲区
pOutputNum
[out]
输出数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.12.4 获取所有巡查路线接口
接口名称:
int Plat_OPS_GetAllRoutes (
int iUserHandle,
int iNeedGetNum,
LPPLAT_OPS_ROUTEINFO pOutputInfo,
int* pOutputNum);
接口描述:
获取所有巡查路线
参数说明:
参数名
输入/输出
描述
iUserHandle
[in]
Plat_LoginCMS返回的句柄
iNeedGetNum
[in]
需要获取的数目
pOutputInfo
[in] [out]
需要获取的所有巡查路线信息输出缓冲区
pOutputNum
[out]
输出资源数目,当pOutputInfo为NULL时,pOutputNum保存的值为资源的总的数目,其他情况下pOutputNum为成功输出资源的数目
返回值:
0 调用成功, -1 调用失败,通过Plat_GetLastError()查看错误码
备注:
无
2.
展开阅读全文