GNU Radio's SATELLITES Package
encode_rs_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2018,2020, 2024 Daniel Estevez <daniel@destevez.net>
4  *
5  * This file is part of gr-satellites
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_SATELLITES_ENCODE_RS_IMPL_H
12 #define INCLUDED_SATELLITES_ENCODE_RS_IMPL_H
13 
14 #include <satellites/encode_rs.h>
15 
16 #include <cstdint>
17 #include <functional>
18 #include <vector>
19 
20 namespace gr {
21 namespace satellites {
22 
23 class encode_rs_impl : public encode_rs
24 {
25 private:
26  int d_interleave;
27  std::vector<uint8_t> d_rs_codeword;
28  std::vector<uint8_t> d_output_frame;
29  int d_nroots;
30  void* d_rs_p = NULL;
31  const int d_frame_size; // used only with vector stream IO
32 
33  std::function<void(uint8_t*)> d_encode_rs;
34 
35  constexpr static int d_ccsds_nn = 255;
36  constexpr static int d_ccsds_nroots = 32;
37 
38  void setup_ccsds(bool dual_basis);
39  void setup_generic(int symsize, int gfpoly, int fcr, int prim, int nroots);
40  void check_interleave();
41  void check_frame_size();
42  void set_message_ports();
43 
44 public:
45  encode_rs_impl(bool dual_basis, int interleave = 1);
46  encode_rs_impl(int frame_size, bool dual_basis, int interleave = 1);
48  int symsize, int gfpoly, int fcr, int prim, int nroots, int interleave = 1);
49  encode_rs_impl(int frame_size,
50  int symsize,
51  int gfpoly,
52  int fcr,
53  int prim,
54  int nroots,
55  int interleave);
56  ~encode_rs_impl() override;
57 
58  int work(int noutput_items,
59  gr_vector_const_void_star& input_items,
60  gr_vector_void_star& output_items) override;
61 
62  void msg_handler(pmt::pmt_t pmt_msg);
63 };
64 
65 } // namespace satellites
66 } // namespace gr
67 
68 #endif /* INCLUDED_SATELLITES_ENCODE_RS_IMPL_H */
Definition: encode_rs_impl.h:24
void msg_handler(pmt::pmt_t pmt_msg)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
encode_rs_impl(bool dual_basis, int interleave=1)
encode_rs_impl(int symsize, int gfpoly, int fcr, int prim, int nroots, int interleave=1)
encode_rs_impl(int frame_size, int symsize, int gfpoly, int fcr, int prim, int nroots, int interleave)
encode_rs_impl(int frame_size, bool dual_basis, int interleave=1)
Reed-Solomon encoder.
Definition: include/satellites/encode_rs.h:26
rs nroots
Definition: init_rs.h:80
rs fcr
Definition: init_rs.h:78
rs prim
Definition: init_rs.h:79
#define NULL
Definition: lib/libfec/decode_rs.h:63
Definition: ax100_decode.h:17