GNU Radio's LORA_SDR Package
header_decoder_impl.h
Go to the documentation of this file.
1
2#ifndef INCLUDED_LORA_HEADER_DECODER_IMPL_H
3#define INCLUDED_LORA_HEADER_DECODER_IMPL_H
4
6
7namespace gr {
8namespace lora_sdr {
9
11private:
12 /**
13 * @brief ize of the header in nibbles
14 *
15 */
16 const uint8_t header_len = 5;
17 /**
18 * @brief Specify if we use an explicit or implicit header
19 *
20 */
21 bool m_impl_header;
22
23 /**
24 * @brief The payload length in bytes
25 *
26 */
27 uint8_t m_payload_len;
28 /**
29 * @brief Specify the usage of a payload CRC
30 *
31 */
32 bool m_has_crc;
33
34 /**
35 * @brief Coding rate
36 *
37 */
38 uint8_t m_cr;
39
40 /**
41 * @brief
42 *
43 */
44 uint8_t header_chk; ///< The header checksum received in the header
45
46 /**
47 * @brief
48 *
49 */
50 uint32_t pay_cnt; ///< The number of payload nibbles received
51
52 /**
53 * @brief
54 *
55 */
56 uint32_t nout; ///< The number of data nibbles to output
57 /**
58 * @brief
59 *
60 */
61 bool is_header; ///< Indicate that we need to decode the header
62
63 /**
64 * @brief Reset the block variables for a new frame.
65 *
66 */
67 void new_frame_handler();
68
69 /**
70 * @brief publish decoding information contained in the header or provided to
71 * the block
72 *
73 * @param cr
74 * @param pay_len
75 * @param crc
76 * @param err
77 */
78 void publish_frame_info(int cr, int pay_len, int crc, int err);
79
80public:
81 /**
82 * @brief Construct a new header decoder impl object
83 *
84 * @param impl_head
85 * @param cr
86 * @param pay_len
87 * @param has_crc
88 */
89 header_decoder_impl(bool impl_head, uint8_t cr, uint32_t pay_len,
90 bool has_crc);
91 /**
92 * @brief Destroy the header decoder impl object
93 *
94 */
96
97 /**
98 * @brief
99 *
100 * @param noutput_items
101 * @param ninput_items_required
102 */
103 void forecast(int noutput_items, gr_vector_int &ninput_items_required);
104
105 /**
106 * @brief
107 *
108 * @param noutput_items
109 * @param ninput_items
110 * @param input_items
111 * @param output_items
112 * @return int
113 */
114 int general_work(int noutput_items, gr_vector_int &ninput_items,
115 gr_vector_const_void_star &input_items,
116 gr_vector_void_star &output_items);
117};
118} // namespace lora_sdr
119} // namespace gr
120
121#endif /* INCLUDED_LORA_HEADER_DECODER_IMPL_H */
Definition: header_decoder_impl.h:10
~header_decoder_impl()
Destroy the header decoder impl object.
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
header_decoder_impl(bool impl_head, uint8_t cr, uint32_t pay_len, bool has_crc)
Construct a new header decoder impl object.
Decode the header of the data spackage. For more information about the implementation visit header_de...
Definition: header_decoder.h:38
Definition: add_crc.h:28