Beispiel #1
0
 public void Clock(bool b)
 {
     this._raw <<= 1;
       this._raw |= b ? 1U : 0U;
       ++this._count;
       if (this._sequence == SyndromeDetector.BlockSequence.WaitBitSync)
       {
     this._syndrome = SyndromeDetector.BuildSyndrome(this._raw);
     this._syndrome ^= (ushort) 984;
     this._sequence = (int) this._syndrome == 0 ? SyndromeDetector.BlockSequence.GotA : SyndromeDetector.BlockSequence.WaitBitSync;
     this._blocks[0] = (ushort) (this._raw >> 10 & (uint) ushort.MaxValue);
     this._count = 0;
       }
       if (this._count != 26)
     return;
       this.ProcessSyndrome();
       if (this._sequence == SyndromeDetector.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 availableDelegate = this.FrameAvailable;
     if (availableDelegate != null)
       availableDelegate(ref this._frame);
     if (!this._frame.Filter)
       this._dumpGroups.AnalyseFrames(ref this._frame);
     this._sequence = SyndromeDetector.BlockSequence.GotBitSync;
       }
       this._count = 0;
 }
Beispiel #2
0
 private void ProcessSyndrome()
 {
     this._syndrome = SyndromeDetector.BuildSyndrome(this._raw);
       switch (this._sequence)
       {
     case SyndromeDetector.BlockSequence.GotA:
       this._syndrome ^= (ushort) 980;
       this._sequence = SyndromeDetector.BlockSequence.GotB;
       break;
     case SyndromeDetector.BlockSequence.GotB:
       this._syndrome ^= ((int) this._blocks[1] & 2048) == 0 ? (ushort) 604 : (ushort) 972;
       this._sequence = SyndromeDetector.BlockSequence.GotC;
       break;
     case SyndromeDetector.BlockSequence.GotC:
       this._syndrome ^= (ushort) 600;
       this._sequence = SyndromeDetector.BlockSequence.GotD;
       break;
     case SyndromeDetector.BlockSequence.GotBitSync:
       this._syndrome ^= (ushort) 984;
       this._sequence = SyndromeDetector.BlockSequence.GotA;
       break;
       }
       int index = (int) this._sequence;
       if ((int) this._syndrome != 0)
       {
     if (this._useFec)
     {
       if ((int) this._syndrome != 0 || this.ApplyFEC() > 5)
     this._sequence = SyndromeDetector.BlockSequence.WaitBitSync;
       else
     this._blocks[index] = (ushort) (this._raw & (uint) ushort.MaxValue);
     }
     else
       this._sequence = SyndromeDetector.BlockSequence.WaitBitSync;
       }
       else
     this._blocks[index] = (ushort) (this._raw >> 10 & (uint) ushort.MaxValue);
 }