GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
pack_k_bits_bb.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2012-2013 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 #ifndef INCLUDED_GR_PACK_K_BITS_BB_H
12 #define INCLUDED_GR_PACK_K_BITS_BB_H
13 
14 #include <gnuradio/blocks/api.h>
16 
17 namespace gr {
18 namespace blocks {
19 
20 /*!
21  * \brief Converts a stream of bytes with 1 bit in the LSB to a
22  * byte with k relevant bits.
23  *
24  * This block takes in K bytes at a time, and uses the least significant
25  * bit to form a new byte.
26  *
27  * Example:
28  * k = 4
29  * in = [0,1,0,1, 0x81,0x00,0x00,0x00]
30  * out = [0x05, 0x08]
31  *
32  * \ingroup byte_operators_blk
33  */
35 {
36 public:
37  // gr::blocks::pack_k_bits_bb::sptr
38  typedef std::shared_ptr<pack_k_bits_bb> sptr;
39 
40  /*!
41  * \brief Make a pack_k_bits block.
42  * \param k number of bits to be packed.
43  */
44  static sptr make(unsigned k);
45 };
46 
47 } /* namespace blocks */
48 } /* namespace gr */
49 
50 #endif /* INCLUDED_GR_PACK_K_BITS_BB_H */
Converts a stream of bytes with 1 bit in the LSB to a byte with k relevant bits.
Definition: pack_k_bits_bb.h:35
static sptr make(unsigned k)
Make a pack_k_bits block.
std::shared_ptr< pack_k_bits_bb > sptr
Definition: pack_k_bits_bb.h:38
synchronous N:1 input to output with history
Definition: sync_decimator.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29