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 
7 namespace gr {
8  namespace lora_sdr {
9 
11  {
12  private:
13  const uint8_t header_len = 5; ///< size of the header in nibbles
14 
15  bool m_impl_header;///< Specify if we use an explicit or implicit header
16  bool m_print_header; ///< print or not header information in terminal
17  uint8_t m_payload_len;///< The payload length in bytes
18  bool m_has_crc;///< Specify the usage of a payload CRC
19  uint8_t m_cr;///< Coding rate
20 
21  uint8_t header_chk; ///< The header checksum received in the header
22 
23  uint32_t pay_cnt;///< The number of payload nibbles received
24  uint32_t nout;///< The number of data nibbles to output
25  bool is_header ;///< Indicate that we need to decode the header
26 
27  /**
28  * \brief Reset the block variables for a new frame.
29  */
30  void new_frame_handler();
31  /**
32  * \brief publish decoding information contained in the header or provided to the block
33  */
34  void publish_frame_info(int cr, int pay_len, int crc, int err);
35 
36  public:
37  header_decoder_impl(bool impl_head, uint8_t cr, uint32_t pay_len, bool has_crc, bool print_header);
39 
40  void forecast (int noutput_items, gr_vector_int &ninput_items_required);
41 
42  int general_work(int noutput_items,
43  gr_vector_int &ninput_items,
44  gr_vector_const_void_star &input_items,
45  gr_vector_void_star &output_items);
46  };
47  } // namespace lora
48 } // namespace gr
49 
50 #endif /* INCLUDED_LORA_HEADER_DECODER_IMPL_H */
header_decoder_impl(bool impl_head, uint8_t cr, uint32_t pay_len, bool has_crc, bool print_header)
<+description of block+>
Definition: header_decoder.h:36
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
Definition: header_decoder_impl.h:10
Definition: add_crc.h:28
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)