GNU Radio's RDS Package
decoder_impl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Bastian Bloessl <bloessl@ccs-labs.org>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef INCLUDED_RDS_DECODER_IMPL_H
18 #define INCLUDED_RDS_DECODER_IMPL_H
19 
20 #include <rds/decoder.h>
21 
22 namespace gr {
23 namespace rds {
24 
25 class decoder_impl : public decoder
26 {
27 public:
28  decoder_impl(bool log, bool debug);
29 
30 private:
31  ~decoder_impl();
32 
33  int work(int noutput_items,
34  gr_vector_const_void_star &input_items,
35  gr_vector_void_star &output_items);
36 
37  void enter_no_sync();
38  void enter_sync(unsigned int);
39  unsigned int calc_syndrome(unsigned long, unsigned char);
40  void decode_group(unsigned int*);
41 
42  unsigned long bit_counter;
43  unsigned long lastseen_offset_counter, reg;
44  unsigned int block_bit_counter;
45  unsigned int wrong_blocks_counter;
46  unsigned int blocks_counter;
47  unsigned int group_good_blocks_counter;
48  unsigned int group[4];
49  bool debug;
50  bool log;
51  bool presync;
52  bool good_block;
53  bool group_assembly_started;
54  unsigned char lastseen_offset;
55  unsigned char block_number;
56  enum { NO_SYNC, SYNC } d_state;
57 
58 };
59 
60 } /* namespace rds */
61 } /* namespace gr */
62 
63 #endif /* INCLUDED_RDS_DECODER_IMPL_H */
64 
Definition: decoder.h:26
Definition: decoder_impl.h:25
Definition: decoder.h:23
decoder_impl(bool log, bool debug)