Ejemplo n.º 1
0
        private void CmdDmxSetFilter(BinaryReader r)
        {
            int adapter = r.ReadByte();
            int demux   = r.ReadByte();
            int filter  = r.ReadByte();
            int pid     = IPAddress.NetworkToHostOrder(r.ReadInt16());

            byte[] fData   = r.ReadBytes(3 * 16);
            int    timeout = IPAddress.NetworkToHostOrder(r.ReadInt32());
            int    flags   = IPAddress.NetworkToHostOrder(r.ReadInt32());

            ChannelSession c = _ChanSessions[adapter - _AdapterOffset];

            if (c != null)
            {
                c.SetFilter(demux, filter, pid, timeout, flags, fData);
                LogProvider.Add(DebugLevel.DvbApi, cLogSection, Message.DvbapiSetFilter, demux, filter, pid);
            }
            else
            {
                LogProvider.Add(DebugLevel.Warning, cLogSection, Message.DvbapiSetFilterFailed, adapter);
            }
        }
Ejemplo n.º 2
0
        private void ChannelUpdated(ChannelSession sender, bool add)
        {
            CaPmtSection capmt = null;

            if (!add)
            {
                if (sender.CurrentSid > 0) // dann Update.
                {
                    capmt = sender.GetCaPmt(ListManagement.Update);
                }
                else
                {
                    // dann ist raus, also remove. hier bietet Oscam dvbapi ein stop command
                    StopDmx((byte)sender.AdapterId);
                }
            }
            else
            {
                // wenn noch keiner läuft dann als only senden. ansonsten add
                int c = ActiveChannels().Length;

                if (c > 1) // eigenen abziehen
                {
                    capmt = sender.GetCaPmt(ListManagement.Add);
                }
                else
                {
                    capmt = sender.GetCaPmt(ListManagement.Only);
                }
            }

            if (capmt != null)
            {
                SendCaPmt(capmt);
            }
        }