GNU Radio's CCSDS Package
encodeTurbo_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 <+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_ENCODETURBO_IMPL_H
22 #define INCLUDED_CCSDS_ENCODETURBO_IMPL_H
23 
24 #include <ccsds/encodeTurbo.h>
25 #include <gnuradio/blocks/pack_k_bits.h>
26 extern "C"
27 {
28  #include "fec/turbo/libconvcodes.h"
29  #include "fec/turbo/libturbocodes.h"
30 }
31 #define MAX_COMPONENTS 4
32 namespace gr {
33  namespace ccsds {
34 
36  {
37  private:
38  blocks::kernel::pack_k_bits *d_pack;
39  pmt::pmt_t d_in_port;
40  pmt::pmt_t d_out_port;
41  int d_base;
42  int d_octets;
43  int d_code_type;
44 
45  float d_rate;
46  int d_info_length;
47  int d_encoded_length;
48 
49  int *d_pi;
50  const char *d_forward_upper[MAX_COMPONENTS];
51  const char *d_forward_lower[MAX_COMPONENTS];
52  const char *d_backward;
53  t_convcode d_code1;
54  t_convcode d_code2;
55  t_turbocode d_turbo;
56 
57 
58  void pmt_in_callback(pmt::pmt_t msg);
59  int puncturing(int k);
60 
61  protected:
62  int calculate_output_stream_length(const gr_vector_int &ninput_items);
63 
64  public:
65  encodeTurbo_impl(int base, int type, std::string len_tag_key);
67 
68  // Where all the action really happens
69  int work(int noutput_items,
70  gr_vector_int &ninput_items,
71  gr_vector_const_void_star &input_items,
72  gr_vector_void_star &output_items);
73  };
74 
75  } // namespace ccsds
76 } // namespace gr
77 
78 #endif /* INCLUDED_CCSDS_ENCODETURBO_IMPL_H */
79 
<+description of block+>
Definition: encodeTurbo.h:36
Definition: encodeTurbo_impl.h:35
#define MAX_COMPONENTS
Definition: encodeTurbo_impl.h:31
Definition: backup/libturbocodes.h:10
Definition: cc_depuncture.h:28
encodeTurbo_impl(int base, int type, std::string len_tag_key)
Definition: backup/libconvcodes.h:8
int calculate_output_stream_length(const gr_vector_int &ninput_items)
int work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)