Beispiel #1
0
        void Server_ProcNotifyChannelInfo(IntPtr session, IntPtr ptPuId, IntPtr ptPuName, int iStatus, ref BVCU_PUOneChannelInfo channel, int iFinished)
        {
            string puId   = Marshal.PtrToStringAnsi(ptPuId, BVCU.BVCU_MAX_ID_LEN + 1).Split('\0')[0];
            string puName = Marshal.PtrToStringAnsi(ptPuName, BVCU.BVCU_MAX_NAME_LEN + 1).Split('\0')[0];

            if (iStatus == BVCU.BVCU_ONLINE_STATUS_OFFLINE)
            {
                m_session.OnRemovePu(puId);
            }
            if (BVCU.TRUE(iFinished))
            {
                m_session.OnGetPuListFinished();
            }
            Session.Channel chnl = new Session.Channel();
            getChannel(chnl, channel);
            m_session.OnGetPu(puName, puId, chnl);
            return;
        }
Beispiel #2
0
        void Cmd_OnGetPuList(IntPtr session, IntPtr ptPuId, IntPtr ptPuName, int iOnlineStatus, IntPtr ptPUOneChannelInfo, int iFinished)
        {
            BVCU_PUOneChannelInfo puOneChannelInfo = (BVCU_PUOneChannelInfo)Marshal.PtrToStructure(ptPUOneChannelInfo, typeof(BVCU_PUOneChannelInfo));

            Byte[] bpuid   = new Byte[BVCU.BVCU_MAX_ID_LEN + 1];
            Byte[] bpuname = new Byte[BVCU.BVCU_MAX_NAME_LEN + 1];
            Marshal.Copy(ptPuId, bpuid, 0, BVCU.BVCU_MAX_ID_LEN + 1);
            Marshal.Copy(ptPuName, bpuname, 0, BVCU.BVCU_MAX_ID_LEN + 1);
            string spuid   = System.Text.Encoding.UTF8.GetString(bpuid).Split('\0')[0];
            string spuname = System.Text.Encoding.UTF8.GetString(bpuname).Split('\0')[0];

            if (BVCU.TRUE(iFinished))
            {
                m_session.OnGetPuListFinished();
                return;
            }
            Channel chnl = new Channel();

            getChannel(chnl, puOneChannelInfo);
            m_session.OnGetPu(spuname, spuid, iOnlineStatus, chnl);
        }
Beispiel #3
0
        void Cmd_OnGetPuList(IntPtr session, IntPtr ptPuId, IntPtr ptPuName, int iStatus, ref BVCU_PUOneChannelInfo channel, int iFinished)
        {
            string puId   = Marshal.PtrToStringAnsi(ptPuId, BVCU.BVCU_MAX_ID_LEN + 1).Split('\0')[0];
            string puName = Marshal.PtrToStringAnsi(ptPuName, BVCU.BVCU_MAX_NAME_LEN + 1).Split('\0')[0];

            if (BVCU.TRUE(iFinished))
            {
                m_session.OnGetPuListFinished();
            }
            Session.Channel chnl = new Session.Channel();
            if (iStatus == BVCU.BVCU_ONLINE_STATUS_OFFLINE)
            {
                chnl.online = false;
            }
            else
            {
                chnl.online = true;
            }
            getChannel(chnl, channel);
            m_session.OnGetPu(puName, puId, chnl);

            /*if (channel.szName.Equals("gps"))
             * {
             *  chnl = new Session.Channel();
             *  channel.szName = "TSP";
             *  channel.iPTZIndex = 15;
             *  channel.iMediaDir = 32;
             *  channel.iChannelIndex = 65792;
             *  if (iStatus == BVCU.BVCU_ONLINE_STATUS_OFFLINE)
             *  {
             *      chnl.online = false;
             *  }
             *  else
             *  {
             *      chnl.online = true;
             *  }
             *  getChannel(chnl, channel);
             *  m_session.OnGetPu(puName, puId, chnl);
             * }*/
        }