GNU Radio's SATNOGS Package
upsat_fsk_frame_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) 2016, Libre Space Foundation <http://librespacefoundation.org/>
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 INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ENCODER_H
22 #define INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ENCODER_H
23 
24 #include <satnogs/api.h>
25 #include <gnuradio/sync_block.h>
26 
27 namespace gr {
28 namespace satnogs {
29 
30 /*!
31  * \brief This block implements a FSK frame encoder for the UPSAT satellite.
32  * It takes as input a message containing the PDU and performs the NRZ
33  * encoding. The resulting float samples can be passed from a FM modulation
34  * block and then to the SDR device.
35  *
36  * \ingroup satnogs
37  *
38  */
39 class SATNOGS_API upsat_fsk_frame_encoder : virtual public gr::sync_block {
40 public:
41  typedef boost::shared_ptr<upsat_fsk_frame_encoder> sptr;
42 
43  /*!
44  * Creates an FSK encoding block. Note that this block does NOT perform
45  * the frequency modulation. You can use the existing frequency modulation
46  * block shipped with the GNU Radio.
47  *
48  * @param preamble the bytes that consist the preamble of the frame
49  *
50  * @param sync_word the byte synchronization word
51  *
52  * @param append_crc if set to true the encoder will append a two byte
53  * CRC field at the end of the frame. The CRC algorithm is compatible
54  * with the CC1120 chip.
55  *
56  * @param whitening true if the transmitted data have been processed by
57  * the whitening algorithm of the CC1120 chip. False otherwise.
58  *
59  * @param manchester true if the transmitted data have been processed by
60  * the Manchester algorithm of the CC1120 chip. False otherwise.
61  *
62  * @param msb_first if set to true, the the treansmission starts from the
63  * MSB of each byte. In case the AX.25 encapuslation is selected, this
64  * parameter is NOT taken into consideration for the AX.25 part,
65  * as the AX.25 dictates that the LS bit should be sent first.
66  *
67  * @param ax25_format if set to true the frame payload will be encoded
68  * using AX.25 encapsulation.
69  *
70  * @param settling_samples the number of zero samples that the encoder
71  * should append after the end of the FSK frame. This is especially
72  * important when an arbitrary in-out ratio resampler is used. The
73  * arbitrary in-out ratio of samples will cause the stream tags to be
74  * delivered at the sink block out-of-sync causing the frame transmission
75  * to terminate sooner.
76  *
77  * @param ax25_dest_addr the destination AX.25 address
78  * @param ax25_dest_ssid the destination AX.25 SSID
79  * @param ax25_src_addr the source AX.25 address
80  * @param ax25_src_ssid the source AX.25 SSID
81  *
82  */
83  static sptr
84  make(const std::vector<uint8_t> &preamble,
85  const std::vector<uint8_t> &sync_word, bool append_crc,
86  bool whitening, bool manchester, bool msb_first, bool ax25_format,
87  const std::string &ax25_dest_addr, uint8_t ax25_dest_ssid,
88  const std::string &ax25_src_addr, uint8_t ax25_src_ssid,
89  size_t settling_samples);
90 };
91 
92 } // namespace satnogs
93 } // namespace gr
94 
95 #endif /* INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ENCODER_H */
96 
Performs data whitening and de-whitening.
Definition: whitening.h:35
Definition: amsat_duv_decoder.h:29
boost::shared_ptr< upsat_fsk_frame_encoder > sptr
Definition: upsat_fsk_frame_encoder.h:41
#define SATNOGS_API
Definition: api.h:30
This block implements a FSK frame encoder for the UPSAT satellite. It takes as input a message contai...
Definition: upsat_fsk_frame_encoder.h:39