GNU Radio's SATELLITES Package
crc_check_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2022 Daniel Estevez <daniel@destevez.net>.
4  *
5  * This file is part of gr-satellites
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_SATELLITES_CRC_CHECK_IMPL_H
12 #define INCLUDED_SATELLITES_CRC_CHECK_IMPL_H
13 
14 #include <satellites/crc.h>
15 #include <satellites/crc_check.h>
16 
17 namespace gr {
18 namespace satellites {
19 
20 class crc_check_impl : public crc_check
21 {
22 private:
23  unsigned d_num_bits;
24  bool d_swap_endianness;
25  bool d_discard_crc;
26  crc d_crc;
27  unsigned d_header_bytes;
28 
29 public:
30  crc_check_impl(unsigned num_bits,
31  uint64_t poly,
32  uint64_t initial_value,
33  uint64_t final_xor,
34  bool input_reflected,
35  bool result_reflected,
36  bool swap_endianness,
37  bool discard_crc,
38  unsigned skip_header_bytes);
40 
41  // Where all the action really happens
42  void forecast(int noutput_items, gr_vector_int& ninput_items_required);
43 
44  int general_work(int noutput_items,
45  gr_vector_int& ninput_items,
46  gr_vector_const_void_star& input_items,
47  gr_vector_void_star& output_items);
48  void msg_handler(pmt::pmt_t pmt_msg);
49 };
50 
51 } // namespace satellites
52 } // namespace gr
53 
54 #endif /* INCLUDED_SATELLITES_CRC_CHECK_IMPL_H */
Definition: crc_check_impl.h:21
crc_check_impl(unsigned num_bits, uint64_t poly, uint64_t initial_value, uint64_t final_xor, bool input_reflected, bool result_reflected, bool swap_endianness, bool discard_crc, unsigned skip_header_bytes)
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
void msg_handler(pmt::pmt_t pmt_msg)
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Check the CRC at the end of a PDU.
Definition: crc_check.h:34
Calculates a CRC.
Definition: crc.h:33
Definition: ax100_decode.h:17