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
22namespace gr {
23namespace rds {
24
25class decoder_impl : public decoder
26{
27public:
28 decoder_impl(bool log, bool debug);
29
30private:
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 unsigned char offset_chars[4]; // [ABCcDEx] (x=error)
50 bool log;
51 bool debug;
52 bool presync;
53 bool good_block;
54 bool group_assembly_started;
55 unsigned char lastseen_offset;
56 unsigned char block_number;
57 enum { NO_SYNC, SYNC } d_state;
58
59};
60
61} /* namespace rds */
62} /* namespace gr */
63
64#endif /* INCLUDED_RDS_DECODER_IMPL_H */
Definition: decoder_impl.h:26
decoder_impl(bool log, bool debug)
Definition: decoder.h:27
Definition: decoder.h:23