GNU Radio 3.7.2 C++ API
repack_bits_bb.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2012 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 #ifndef INCLUDED_BLOCKS_REPACK_BITS_BB_H
24 #define INCLUDED_BLOCKS_REPACK_BITS_BB_H
25 
26 #include <gnuradio/blocks/api.h>
28 
29 namespace gr {
30  namespace blocks {
31 
32  /*!
33  * \brief Pack \p k bits from the input stream onto \p l bits of the output stream.
34  * \ingroup byte_operators_blk
35  *
36  * \details
37  * No bits are lost here; any value for k and l (within [1, 8]) is allowed.
38  * On every fresh input byte, it starts reading on the LSB, and starts copying
39  * to the LSB as well.
40  *
41  * If a packet length tag is given, this block assumes a tagged stream.
42  * In this case, the tag with the packet length is updated accordingly.
43  * Also, the number of input bits is padded with zeros if the number of input
44  * bits is not an integer multiple of \p l, or bits are truncated from the input
45  * if \p align_output is set to true.
46  */
48  {
49  public:
51 
52  /*!
53  * \param k Number of relevant bits on the input stream
54  * \param l Number of relevant bits on the output stream
55  * \param len_tag_key If not empty, this is the key for the length tag.
56  * \param align_output If len_tag_key is given, this controls if the input
57  * or the output is aligned.
58  */
59  static sptr make(int k, int l=8, const std::string &len_tag_key="", bool align_output=false);
60  };
61 
62  } // namespace blocks
63 } // namespace gr
64 
65 #endif /* INCLUDED_BLOCKS_REPACK_BITS_BB_H */
66 
Block that operates on PDUs in form of tagged streamsOverride work to provide the signal processing i...
Definition: tagged_stream_block.h:37
Pack k bits from the input stream onto l bits of the output stream.
Definition: repack_bits_bb.h:47
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:30
boost::shared_ptr< repack_bits_bb > sptr
Definition: repack_bits_bb.h:50