GNU Radio's SATNOGS Package
ax25_encoder.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) 2020, Libre Space Foundation <http://libre.space>
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef INCLUDE_SATNOGS_AX25_ENCODER_H_
22#define INCLUDE_SATNOGS_AX25_ENCODER_H_
23
24
26
27
28namespace gr {
29namespace satnogs {
30
31/*!
32 * \brief AX.25 frame encoder definition
33 */
35{
36public:
37 using sptr = std::unique_ptr<ax25_encoder>;
38 static sptr make(const std::string& dest_addr,
39 uint8_t dest_ssid,
40 const std::string& src_addr,
41 uint8_t src_ssid,
42 size_t preamble_len = 16,
43 size_t postamble_len = 16,
44 bool scramble = true,
45 bool nrzi = true);
46
47 ax25_encoder(const std::string& dest_addr,
48 uint8_t dest_ssid,
49 const std::string& src_addr,
50 uint8_t src_ssid,
51 size_t preamble_len,
52 size_t postamble_len,
53 bool scramble = true,
54 bool nrzi = true);
56
57 pmt::pmt_t encode(pmt::pmt_t msg);
58
59private:
60 const std::string d_dest_addr;
61 const uint8_t d_dest_ssid;
62 const std::string d_src_addr;
63 const uint8_t d_src_ssid;
64 const size_t d_preamble_len = 16;
65 const size_t d_postamble_len = 16;
66 const bool d_scramble;
67 const bool d_nrzi;
68
69 size_t insert_address(uint8_t* out);
70
71 size_t insert_ctrl(uint8_t* out);
72
73 size_t insert_pid(uint8_t* out);
74};
75
76} // namespace satnogs
77} // namespace gr
78
79#endif /* INCLUDE_SATNOGS_AX25_ENCODER_H_ */
#define SATNOGS_API
Definition: api.h:19
AX.25 frame encoder definition.
Definition: ax25_encoder.h:35
pmt::pmt_t encode(pmt::pmt_t msg)
static sptr make(const std::string &dest_addr, uint8_t dest_ssid, const std::string &src_addr, uint8_t src_ssid, size_t preamble_len=16, size_t postamble_len=16, bool scramble=true, bool nrzi=true)
ax25_encoder(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=true, bool nrzi=true)
std::unique_ptr< ax25_encoder > sptr
Definition: ax25_encoder.h:37
Abstract class defining the API of the SatNOGS Encoders.
Definition: encoder.h:44
Definition: amsat_duv_decoder.h:29