SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
rdsdecoder.h
Go to the documentation of this file.
1 // Copyright (C) 2015 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef PLUGINS_CHANNEL_BFM_RDSDECODER_H_
20 #define PLUGINS_CHANNEL_BFM_RDSDECODER_H_
21 
23 {
24 public:
25  RDSDecoder();
26  ~RDSDecoder();
27 
28  bool frameSync(bool bit);
29  unsigned int *getGroup() { return m_group; }
30  bool synced() const { return m_sync == SYNC; }
31 
32  float m_qua;
33 
34 protected:
35  unsigned int calc_syndrome(unsigned long message, unsigned char mlen);
36  void enter_sync(unsigned int sync_block_number);
37  void enter_no_sync();
38 
39 private:
40  unsigned long m_reg;
41  enum { NO_SYNC, SYNC } m_sync;
42  bool m_presync;
43  unsigned long m_lastseenOffsetCounter;
44  unsigned long m_bitCounter;
45  unsigned char m_lastseenOffset;
46  unsigned int m_blockBitCounter;
47  unsigned int m_wrongBlocksCounter;
48  unsigned int m_blocksCounter;
50  unsigned char m_blockNumber;
53  unsigned int m_group[4];
54 
55  /* see page 59, Annex C, table C.1 in the standard
56  * offset word C' has been put at the end */
57  static const unsigned int offset_pos[5];
58  static const unsigned int offset_word[5];
59  static const unsigned int syndrome[5];
60 };
61 
62 
63 
64 #endif /* PLUGINS_CHANNEL_BFM_RDSDECODER_H_ */
unsigned int * getGroup()
Definition: rdsdecoder.h:29
bool m_goodBlock
Definition: rdsdecoder.h:52
static const unsigned int offset_word[5]
Definition: rdsdecoder.h:58
bool synced() const
Definition: rdsdecoder.h:30
unsigned int m_group[4]
Definition: rdsdecoder.h:53
void enter_no_sync()
Definition: rdsdecoder.cpp:231
bool m_groupAssemblyStarted
Definition: rdsdecoder.h:51
enum RDSDecoder::@0 m_sync
bool m_presync
Definition: rdsdecoder.h:42
unsigned long m_bitCounter
Definition: rdsdecoder.h:44
unsigned long m_lastseenOffsetCounter
Definition: rdsdecoder.h:43
unsigned int m_blockBitCounter
Definition: rdsdecoder.h:46
static const unsigned int offset_pos[5]
Definition: rdsdecoder.h:57
unsigned int m_blocksCounter
Definition: rdsdecoder.h:48
unsigned char m_blockNumber
Definition: rdsdecoder.h:50
unsigned int m_groupGoodBlocksCounter
Definition: rdsdecoder.h:49
bool frameSync(bool bit)
Definition: rdsdecoder.cpp:51
float m_qua
Definition: rdsdecoder.h:32
void enter_sync(unsigned int sync_block_number)
Definition: rdsdecoder.cpp:221
static const unsigned int syndrome[5]
Definition: rdsdecoder.h:59
unsigned int m_wrongBlocksCounter
Definition: rdsdecoder.h:47
unsigned int calc_syndrome(unsigned long message, unsigned char mlen)
Definition: rdsdecoder.cpp:240
unsigned long m_reg
Definition: rdsdecoder.h:40
unsigned char m_lastseenOffset
Definition: rdsdecoder.h:45