public void H264_DVR_Check_Device_Exist_V2Test() { int iLogin = -1; int intResult = 0; bool bolResult = false; SDKState.XMSDK_Init(); H264_DVR_DEVICEINFO OutDev; int nError = 0; VideoInfo v = TestDataSource.TestDataSource.XMDataSource2(); SDK_XMSDK.SDK_SDevicesState state = new SDK_XMSDK.SDK_SDevicesState(); state.nun = 2; state.state = new int[32]; state.state[0] = 1; state.state[1] = 1; state.uuid = new SDK_XMSDK.SDK_UUID[32]; state.uuid[0].uuid = v.DVSAddress; state.uuid[1].uuid = "4bba3f71cdd143cb"; IntPtr iUserData = Marshal.StringToHGlobalAnsi("hongdongcheng"); SDK_XMSDK.OnFoundDevCB callBack = new SDK_XMSDK.OnFoundDevCB(OnFoundDevCB); Ezviz_gchMsgBack = GCHandle.Alloc(callBack); IntPtr iData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SDK_XMSDK.SDK_SDevicesState))); Marshal.StructureToPtr(state, iData, true); int intResut = SDK_XMSDK.H264_DVR_Check_Device_Exist_V2(ref iData, 3, callBack, iUserData); var result = Marshal.PtrToStructure(iData, typeof(SDK_XMSDK.SDK_SDevicesState)); SDK_XMSDK.SDK_SDevicesState A = (SDK_XMSDK.SDK_SDevicesState)result; int error = SDK_XMSDK.H264_DVR_GetLastError(); iLogin = SDK_XMSDK.H264_DVR_Login_Cloud(v.DVSAddress, 34567, v.UserName, v.Password, out OutDev, out nError, ""); //H264_DVR_CLIENTINFO playstru = new H264_DVR_CLIENTINFO(); //playstru.nChannel = 0; //playstru.nStream = 0; //playstru.nMode = 1; //playstru.hWnd = IntPtr.Zero; //int m_iPlayhandle = SDK_XMSDK.H264_DVR_RealPlay(Convert.ToInt32(iLogin), ref playstru); bolResult = SDK_XMSDK.H264_DVR_PTZControlEx(iLogin, 0, Convert.ToInt32(SDK_XMSDK.PTZ_ControlType.EXTPTZ_POINT_MOVE_CONTROL), 1, 0, 0, false); SDK_XMSDK.H264_DVR_Logout(Convert.ToInt32(intResult)); SDKState.XMSDK_Release(); Assert.IsTrue(bolResult); }
public void H264_DVR_PTZControlExTest() { int iLogin = -1; int intResult = 0; bool bolResult = false; SDKState.XMSDK_Init(); H264_DVR_DEVICEINFO OutDev; int nError = 0; iLogin = SDK_XMSDK.H264_DVR_Login_Cloud("4bba3f71cdd143cb", 34567, "admin", "123456", out OutDev, out nError, ""); //H264_DVR_CLIENTINFO playstru = new H264_DVR_CLIENTINFO(); //playstru.nChannel = 0; //playstru.nStream = 0; //playstru.nMode = 1; //playstru.hWnd = IntPtr.Zero; //int m_iPlayhandle = SDK_XMSDK.H264_DVR_RealPlay(Convert.ToInt32(iLogin), ref playstru); bolResult = SDK_XMSDK.H264_DVR_PTZControlEx(iLogin, 0, Convert.ToInt32(SDK_XMSDK.PTZ_ControlType.EXTPTZ_POINT_MOVE_CONTROL), 1, 0, 0, false); SDK_XMSDK.H264_DVR_Logout(Convert.ToInt32(intResult)); SDKState.XMSDK_Release(); Assert.IsTrue(bolResult); }