GNU Radio Manual and C++ API Reference 3.10.2.0
The Free & Open Software Radio Ecosystem
crc32_async_bb.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2014 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11
12#ifndef INCLUDED_DIGITAL_CRC32_ASYNC_BB_H
13#define INCLUDED_DIGITAL_CRC32_ASYNC_BB_H
14
15#include <gnuradio/block.h>
17
18namespace gr {
19namespace digital {
20
21/*!
22 * \brief Byte-stream CRC block for async messages
23 * \ingroup packet_operators_blk
24 *
25 * \details
26 *
27 * Processes packets (as async PDU messages) for CRC32. The \p
28 * check parameter determines if the block acts to check and strip
29 * the CRC or to calculate and append the CRC32.
30 *
31 * The input PDU is expected to be a message of packet bytes.
32 *
33 * When using check mode, if the CRC passes, the output is a
34 * payload of the message with the CRC stripped, so the output
35 * will be 4 bytes smaller than the input.
36 *
37 * When using calculate mode (check == false), then the CRC is
38 * calculated on the PDU and appended to it. The output is then 4
39 * bytes longer than the input.
40 *
41 * This block implements the CRC32 using the Boost crc_optimal
42 * class for 32-bit CRCs with the standard generator 0x04C11DB7.
43 */
44class DIGITAL_API crc32_async_bb : virtual public block
45{
46public:
47 typedef std::shared_ptr<crc32_async_bb> sptr;
48
49 /*!
50 * \param check Set to true if you want to check CRC, false to create CRC.
51 */
52 static sptr make(bool check = false);
53};
54
55} // namespace digital
56} // namespace gr
57
58#endif /* INCLUDED_DIGITAL_CRC32_ASYNC_BB_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Byte-stream CRC block for async messages.
Definition: crc32_async_bb.h:45
static sptr make(bool check=false)
std::shared_ptr< crc32_async_bb > sptr
Definition: crc32_async_bb.h:47
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29