GNU Radio's LORA_SDR Package
header_impl.h
Go to the documentation of this file.
1#ifndef INCLUDED_LORA_HEADER_IMPL_H
2#define INCLUDED_LORA_HEADER_IMPL_H
3
4#include <lora_sdr/header.h>
5
6namespace gr {
7namespace lora_sdr {
8
9class header_impl : public header {
10private:
11 /**
12 * @brief boolean variable to indicate implicit header mode is used
13 *
14 */
15 bool m_impl_head;
16
17 /**
18 * @brief boolean variable to indicate the presence of a payload crc
19 *
20 */
21 bool m_has_crc;
22
23 /**
24 * @brief Transmission coding rate
25 *
26 */
27 uint8_t m_cr;
28
29 /**
30 * @brief Payload length (i.e input data length)
31 *
32 */
33 uint8_t m_payload_len;
34
35 /**
36 * @brief count the processes nibbles in a frame
37 *
38 */
39 uint m_cnt_nibbles;
40
41 /**
42 * @brief count the number of explicit header nibbles output
43 *
44 */
45 uint m_cnt_header_nibbles;
46
47 /**
48 * @brief contain the header to prepend
49 *
50 */
51 std::vector<uint8_t> m_header;
52
53 /**
54 * @brief
55 *
56 */
57 std::vector<tag_t> m_tags;
58
59 /**
60 * @brief Function that handles on the input PMT message (i.e. input data from
61 * data source)
62 *
63 * @param message pmt message
64 */
65 void msg_handler(pmt::pmt_t message);
66
67public:
68 /**
69 * @brief Construct a new header impl object
70 *
71 * @param impl_head boolean variable to indicate implicit header mode is used
72 * @param has_crc boolean variable to indicate the presence of a payload crc
73 * @param cr Transmission coding rate
74 */
75 header_impl(bool impl_head, bool has_crc, uint8_t cr);
76
77 /**
78 * @brief Destroy the header impl object
79 *
80 */
82 /**
83 * @brief Gnuradio forecast function which tells the
84 * gnuradio system how many items are needed before it can continue to the
85 * work function
86 *
87 * @param noutput_items : number of output items
88 * @param ninput_items_required : number of required output items before
89 */
90 void forecast(int noutput_items, gr_vector_int &ninput_items_required);
91
92 /**
93 * @brief Main function where the actual computation is done.
94 * If impl_head is set to true the output will be the payload added with an header
95 *
96 * @param noutput_items : number of ouput items
97 * @param ninput_items : number of input items
98 * @param input_items : input items (output of whitening stage)
99 * @param output_items : output items (added header if applicable)
100 * @return int
101 */
102 int general_work(int noutput_items, gr_vector_int &ninput_items,
103 gr_vector_const_void_star &input_items,
104 gr_vector_void_star &output_items);
105};
106
107} // namespace lora_sdr
108} // namespace gr
109
110#endif /* INCLUDED_LORA_HEADER_IMPL_H */
Definition: header_impl.h:9
header_impl(bool impl_head, bool has_crc, uint8_t cr)
Construct a new header impl object.
~header_impl()
Destroy the header impl object.
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
Gnuradio forecast function which tells the gnuradio system how many items are needed before it can co...
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Main function where the actual computation is done. If impl_head is set to true the output will be th...
Encode the header of the data package if implicit header mode (denoted by m_impl_head) is turned on F...
Definition: header.h:38
Definition: add_crc.h:28