/// <summary>
        /// 控制前端设备
        /// </summary>
        /// <param name="_iCommond">控制命令</param>
        /// <param name="_iValue">速度值</param>
        /// <param name="_iPriority">控制优先级</param>
        /// <returns>成功返回 0 失败返回 -1</returns>
        public Int32 PTZCtrl(Int32 _iCommond, Int32 _iValue, Int32 _iPriority)
        {
            Int32 iRet = -1;

            DefVsClient.CHANNEL_CONINFOR sChConInfor = new DefVsClient.CHANNEL_CONINFOR();
            sChConInfor.m_sNetLinkInfo.m_pchFromID = Encoding.Default.GetBytes("900000000001");
            sChConInfor.m_sNetLinkInfo.m_pchToID   = Encoding.Default.GetBytes(m_strDevId + "000");
            byte[] temp  = null;
            byte[] bUser = new byte[12];
            Array.Clear(bUser, 0, 12);
            temp = Encoding.Default.GetBytes("888888");
            Array.Copy(temp, bUser, temp.Length);
            sChConInfor.m_sNetLinkInfo.m_pchUser = bUser;
            byte[] bPass = new byte[12];
            Array.Clear(bPass, 0, 12);
            temp = Encoding.Default.GetBytes("888888");
            Array.Copy(temp, bPass, temp.Length);
            sChConInfor.m_sNetLinkInfo.m_pchPsw    = bPass;
            sChConInfor.m_sNetLinkInfo.m_iTranType = 1;
            byte[] bUrl = new byte[20];
            Array.Clear(bUrl, 0, 20);
            temp = Encoding.Default.GetBytes(m_strMMIp);
            Array.Copy(temp, bUrl, temp.Length);
            sChConInfor.m_sNetLinkInfo.m_pchUrl = bUrl;
            sChConInfor.m_sNetLinkInfo.m_iPort  = 3004;
            sChConInfor.m_iType    = 0x0201018;
            sChConInfor.m_iChNo    = 0;
            sChConInfor.m_iBuffNum = 50;

            iRet = VsClientAPI.VSSP_ClientPTZCtrl(ref sChConInfor.m_sNetLinkInfo, sChConInfor.m_iChNo, _iCommond, _iValue, _iPriority, /*m_iExclusivedTime*/ 10);
            return(iRet);
        }
Example #2
0
        // 控制前端设备
        public Int32 PTZCtrl(Int32 _iCommond, Int32 _iValue, Int32 _iPriority)
        {
            Int32 iRet = -1;

            DefVsClient.CHANNEL_CONINFOR sChConInfor = GetChConInfor();
            iRet = VsClientAPI.VSSP_ClientPTZCtrl(ref sChConInfor.m_sNetLinkInfo, sChConInfor.m_iChNo, _iCommond, _iValue, _iPriority, /*m_iExclusivedTime*/ 10);
            return(iRet);
        }