Exemplo n.º 1
0
        private void ProcessSyndrome()
        {
            this._syndrome = SyndromeDetector.BuildSyndrome(this._raw);
            switch (this._sequence)
            {
            case BlockSequence.GotBitSync:
                this._syndrome ^= 984;
                this._sequence  = BlockSequence.GotA;
                break;

            case BlockSequence.GotA:
                this._syndrome ^= 980;
                this._sequence  = BlockSequence.GotB;
                break;

            case BlockSequence.GotB:
                this._syndrome ^= (ushort)(((this._blocks[1] & 0x800) == 0) ? 604 : 972);
                this._sequence  = BlockSequence.GotC;
                break;

            case BlockSequence.GotC:
                this._syndrome ^= 600;
                this._sequence  = BlockSequence.GotD;
                break;
            }
            int sequence = (int)this._sequence;

            if (this._syndrome != 0)
            {
                if (this._useFec)
                {
                    int num = this.ApplyFEC();
                    if (this._syndrome != 0 || num > 5)
                    {
                        this._sequence = BlockSequence.WaitBitSync;
                    }
                    else
                    {
                        this._blocks[sequence] = (ushort)(this._raw & 0xFFFF);
                    }
                }
                else
                {
                    this._sequence = BlockSequence.WaitBitSync;
                }
            }
            else
            {
                this._blocks[sequence] = (ushort)(this._raw >> 10 & 0xFFFF);
            }
        }
Exemplo n.º 2
0
 public void Clock(bool b)
 {
     this._raw <<= 1;
     this._raw  |= (uint)(b ? 1 : 0);
     this._count++;
     if (this._sequence == BlockSequence.WaitBitSync)
     {
         this._syndrome  = SyndromeDetector.BuildSyndrome(this._raw);
         this._syndrome ^= 984;
         this._sequence  = ((this._syndrome != 0) ? BlockSequence.WaitBitSync : BlockSequence.GotA);
         this._blocks[0] = (ushort)(this._raw >> 10 & 0xFFFF);
         this._count     = 0;
     }
     if (this._count == 26)
     {
         this.ProcessSyndrome();
         if (this._sequence == BlockSequence.GotD)
         {
             this._frame.GroupA = this._blocks[0];
             this._frame.GroupB = this._blocks[1];
             this._frame.GroupC = this._blocks[2];
             this._frame.GroupD = this._blocks[3];
             this._frame.Filter = false;
             RdsFrameAvailableDelegate frameAvailable = this.FrameAvailable;
             if (frameAvailable != null)
             {
                 frameAvailable(ref this._frame);
             }
             if (!this._frame.Filter)
             {
                 this._dumpGroups.AnalyseFrames(ref this._frame);
             }
             this._sequence = BlockSequence.GotBitSync;
         }
         this._count = 0;
     }
 }
Exemplo n.º 3
0
 public void Clock(bool b)
 {
     this._raw <<= 1;
     this._raw  |= (uint)(b ? 1 : 0);
     this._count++;
     if (this._sequence == BlockSequence.WaitBitSync)
     {
         this._syndrome  = SyndromeDetector.BuildSyndrome(this._raw);
         this._syndrome ^= 984;
         this._sequence  = ((this._syndrome != 0) ? BlockSequence.WaitBitSync : BlockSequence.GotA);
         this._blocks[0] = (ushort)(this._raw >> 10 & 0xFFFF);
         this._count     = 0;
     }
     if (this._count == 26)
     {
         this.ProcessSyndrome();
         if (this._sequence == BlockSequence.GotD)
         {
             this._dumpGroups.AnalyseFrames(this._blocks[0], this._blocks[1], this._blocks[2], this._blocks[3]);
             this._sequence = BlockSequence.GotBitSync;
         }
         this._count = 0;
     }
 }
Exemplo n.º 4
0
 public RdsDetectorBank()
 {
     this._dumpGroups = new RdsDumpGroups();
       this._detector = new SyndromeDetector(this._dumpGroups);
       this._detector.FrameAvailable += new RdsFrameAvailableDelegate(this.FrameAvailableHandler);
 }
Exemplo n.º 5
0
 public RdsDetectorBank()
 {
     this._dumpGroups = new RdsDumpGroups();
     this._detector   = new SyndromeDetector(this._dumpGroups);
 }
Exemplo n.º 6
0
 public RdsDetectorBank()
 {
     this._dumpGroups = new RdsDumpGroups();
     this._detector   = new SyndromeDetector(this._dumpGroups);
     this._detector.FrameAvailable += this.FrameAvailableHandler;
 }