GNU Radio's SATNOGS Package
crc_async.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4 *
5 * Copyright (C) 2020,2022 Libre Space Foundation <http://libre.space/>
6 *
7 * This program 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 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef INCLUDE_SATNOGS_CRC_ASYNC_H_
22#define INCLUDE_SATNOGS_CRC_ASYNC_H_
23
24
25#include <gnuradio/block.h>
28
29namespace gr {
30namespace satnogs {
31
32/*!
33 * \brief An extended version of the CRC Async block of GNU Radio, supporting a wide range
34 * of different CRCs via the CRCpp
35 *
36 * \ingroup satnogs
37 *
38 */
39class SATNOGS_API crc_async : virtual public gr::block
40{
41public:
42 using sptr = std::shared_ptr<crc_async>;
43
44 /**
45 * @brief Creates a CRC check/append block
46 *
47 * @tparam CRCType the CRC datatyoe
48 * @tparam CRCWidth the CRC Width in bits. Currently only lengths multiple of 8 bits
49 * are supported
50 * @param crc the CRC parameters
51 * @param check true if the block should check for the CRC, false if the block should
52 * append the CRC
53 * @param nbo true if the CRC should be appended in Network Byte Order (big endian),
54 * false for little endian
55 * @return sptr a shared pointer to the block instance
56 */
57 template <typename CRCType, crcpp_uint16 CRCWidth>
59 bool check = false,
60 bool nbo = true);
61
62 /**
63 * @brief Creates a CRC check/append block
64 *
65 * @param crc the CRC type
66 * @param check true if the block should check for the CRC, false if the block should
67 * append the CRC
68 * @param nbo true if the CRC should be appended in Network Byte Order (big endian),
69 * false for little endian
70 * @return sptr a shared pointer to the block instance
71 */
72 static sptr make(crc::type crc, bool check = false, bool nbo = true);
73};
74
75
76} // namespace satnogs
77} // namespace gr
78
79
80#endif /* INCLUDE_SATNOGS_CRC_ASYNC_H_ */
#define SATNOGS_API
Definition: api.h:19
An extended version of the CRC Async block of GNU Radio, supporting a wide range of different CRCs vi...
Definition: crc_async.h:40
static sptr make(const CRC::Parameters< CRCType, CRCWidth > &crc, bool check=false, bool nbo=true)
Creates a CRC check/append block.
static sptr make(crc::type crc, bool check=false, bool nbo=true)
Creates a CRC check/append block.
std::shared_ptr< crc_async > sptr
Definition: crc_async.h:42
Definition: crc.h:44
type
Predefined CRC types.
Definition: crc.h:51
Definition: amsat_duv_decoder.h:29
CRC parameters.
Definition: CRC.h:160