GNU Radio's CCSDS Package
generateCLTU_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2018 <+YOU OR YOUR COMPANY+>.
4  *
5  * This 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; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software 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 for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef INCLUDED_CCSDS_GENERATECLTU_IMPL_H
22 #define INCLUDED_CCSDS_GENERATECLTU_IMPL_H
23 
24 #include <ccsds/generateCLTU.h>
26 #define BCH_INFORMATION_BLOCK 7
27 typedef unsigned char uint8_t;
28 typedef unsigned char crc;
29 #define WIDTH (8 * sizeof(crc))
30 #define TOPBIT (1 << (WIDTH - 1))
31 #define POLYNOMIAL 0x8A
32 #define INITIAL_REMAINDER 0x00
33 namespace gr {
34  namespace ccsds {
35 
37  {
38  private:
39  unsigned char *crcTable;
40  void crcInit();
41  void cltu(pmt::pmt_t pmt_msg);
42  bool d_scramble;
43  Scrambler S;
44  void bchEncoder(std::vector<unsigned char> &message);
45  void crcEncoder(std::vector<unsigned char> &message, const crc initial_remainder);
46  public:
49 
50  // Where all the action really happens
51  int work(int noutput_items,
52  gr_vector_const_void_star &input_items,
53  gr_vector_void_star &output_items);
54  };
55 
56  } // namespace ccsds
57 } // namespace gr
58 
59 #endif /* INCLUDED_CCSDS_GENERATECLTU_IMPL_H */
60 
Definition: Scrambler.h:23
Definition: cc_depuncture.h:28
<+description of block+>
Definition: generateCLTU.h:36
unsigned char crc
Definition: generateCLTU_impl.h:28
unsigned char uint8_t
Definition: generateCLTU_impl.h:27
void scramble(uint8_t *data, uint32_t length)
Definition: Scrambler_CCSDS.h:44
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition: generateCLTU_impl.h:36