GNU Radio's SATNOGS Package
ax25_encoder_mb_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4  *
5  * Copyright (C) 2016,2018
6  * Libre Space Foundation <http://librespacefoundation.org/>
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef INCLUDED_SATNOGS_AX25_ENCODER_MB_IMPL_H
23 #define INCLUDED_SATNOGS_AX25_ENCODER_MB_IMPL_H
24 
26 #include <gnuradio/digital/lfsr.h>
27 
28 namespace gr {
29 namespace satnogs {
30 
32 private:
33  const size_t d_preamble_len;
34  const size_t d_postamble_len;
35  const bool d_scramble;
36  size_t d_remaining;
37  size_t d_produced;
38  uint8_t d_prev_bit;
39  uint8_t *d_encoded_frame;
40  uint8_t *d_tmp_buf;
41  uint8_t *d_addr_field;
42  size_t d_addr_len;
43  digital::lfsr d_lfsr;
44 
45  void
46  add_sob(uint64_t item);
47  void
48  add_eob(uint64_t item);
49 
50 public:
51  ax25_encoder_mb_impl(const std::string &dest_addr, uint8_t dest_ssid,
52  const std::string &src_addr, uint8_t src_ssid,
53  size_t preamble_len, size_t postamble_len,
54  bool scramble);
56 
57  // Where all the action really happens
58  int
59  work(int noutput_items, gr_vector_const_void_star &input_items,
60  gr_vector_void_star &output_items);
61 };
62 
63 } // namespace satnogs
64 } // namespace gr
65 
66 #endif /* INCLUDED_SATNOGS_AX25_ENCODER_MB_IMPL_H */
67 
ax25_encoder_mb_impl(const std::string &dest_addr, uint8_t dest_ssid, const std::string &src_addr, uint8_t src_ssid, size_t preamble_len, size_t postamble_len, bool scramble)
AX.25 encoder block that supports the legacy hardware radios.
Definition: ax25_encoder_mb.h:40
Definition: ax25_encoder_mb_impl.h:31
Definition: amsat_duv_decoder.h:29
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)