大华相机-相关功能sdk 说明使用
扩展云台控制,对云台控制函数功能的增强控制;
BOOL CLIENT_DHPTZControlEx2( LLONG lLoginID, int nChannelID, DWORD dwPTZCommand, LONG lParam1, LONG lParam2, LONG lParam3, BOOL dwStop, void* param4 = NULL };
代码示例(上干货):
NetSDKLib.LLong loginUserId = loginUserId;//登录返回值
boolean dResult1 = netSDKLib.CLIENT_DHPTZControlEx2(loginUserId, channel, DahuaUtils.PTZCommand("EXACT_GOTO"), camera.getPanPos(), camera.getTiltPos(), camera.getZoomPos(), 0, null);
if (dResult1) {
System.out.println("大华-成功跳转到点位!");
return AjaxResult.success();
} else {
System.out.println("大华-跳转失败!");
}
说明:调用前请确保相机登录返回值和通道号可以使用.
-------------------------------------------------------------------------------------------------------------------------------
海康相机-相关功能sdk 说明使用
设置设备的配置信息。
BOOL NET_DVR_SetDVRConfig( LONG lUserID, DWORD dwCommand, LONG lChannel, LPVOID lpInBuffer, DWORD dwInBufferSize );
上货:
int lUserID = (int) lUserID;//登录返回值
//1.跳转到PTZ位置
HCNetSDK.NET_DVR_PTZPOS netDvrPtzpos = new HCNetSDK.NET_DVR_PTZPOS();
netDvrPtzpos.wAction = 1;
netDvrPtzpos.wPanPos = (short) Integer.parseInt(camera.getPanPos().toString(), 16);
netDvrPtzpos.wTiltPos = (short) Integer.parseInt(camera.getTiltPos().toString(), 16);
netDvrPtzpos.wZoomPos = (short) Integer.parseInt(camera.getZoomPos().toString(), 16);
netDvrPtzpos.write();
//设置水平、垂直参数点位跳转
boolean goToPreset = hcNetSDK.NET_DVR_SetDVRConfig(lUserID, HCNetSDK.NET_DVR_SET_PTZPOS, channel(), netDvrPtzpos.getPointer(), netDvrPtzpos.size());
if (goToPreset) {
System.out.println("海康-成功跳转到点位!");
return AjaxResult.success();
} else {
System.out.println("海康-跳转失败,错误码:" + hcNetSDK.NET_DVR_GetLastError());
return AjaxResult.error(hcNetSDK.NET_DVR_GetErrorMsg(new IntByReference(hcNetSDK.NET_DVR_GetLastError())));
}
###希望对您有帮助。谢谢观看!!!