GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
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 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
10 * any later version.
11 *
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
21 */
22
23
24#ifndef INCLUDED_DIGITAL_CRC32_ASYNC_BB_H
25#define INCLUDED_DIGITAL_CRC32_ASYNC_BB_H
26
27#include <gnuradio/block.h>
29
30namespace gr {
31namespace digital {
32
33/*!
34 * \brief Byte-stream CRC block for async messages
35 * \ingroup packet_operators_blk
36 *
37 * \details
38 *
39 * Processes packets (as async PDU messages) for CRC32. The \p
40 * check parameter determines if the block acts to check and strip
41 * the CRC or to calculate and append the CRC32.
42 *
43 * The input PDU is expected to be a message of packet bytes.
44 *
45 * When using check mode, if the CRC passes, the output is a
46 * payload of the message with the CRC stripped, so the output
47 * will be 4 bytes smaller than the input.
48 *
49 * When using calculate mode (check == false), then the CRC is
50 * calculated on the PDU and appended to it. The output is then 4
51 * bytes longer than the input.
52 *
53 * This block implements the CRC32 using the Boost crc_optimal
54 * class for 32-bit CRCs with the standard generator 0x04C11DB7.
55 */
56class DIGITAL_API crc32_async_bb : virtual public block
57{
58public:
59 typedef boost::shared_ptr<crc32_async_bb> sptr;
60
61 /*!
62 * \param check Set to true if you want to check CRC, false to create CRC.
63 */
64 static sptr make(bool check = false);
65};
66
67} // namespace digital
68} // namespace gr
69
70#endif /* INCLUDED_DIGITAL_CRC32_ASYNC_BB_H */
The abstract base class for all 'terminal' processing blocks.
Definition block.h:72
Byte-stream CRC block for async messages.
Definition crc32_async_bb.h:57
boost::shared_ptr< crc32_async_bb > sptr
Definition crc32_async_bb.h:59
static sptr make(bool check=false)
#define DIGITAL_API
Definition gr-digital/include/gnuradio/digital/api.h:30
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46