GNU Radio 3.7.2git-47-g5cfb1151 C++ API
gr::blocks::repack_bits_bb Class Reference

Pack k bits from the input stream onto l bits of the output stream. More...

#include <repack_bits_bb.h>

Inheritance diagram for gr::blocks::repack_bits_bb:
gr::tagged_stream_block gr::block gr::basic_block gr::msg_accepter gr::messages::msg_accepter

Public Types

typedef boost::shared_ptr
< repack_bits_bb
sptr
 

Static Public Member Functions

static sptr make (int k, int l=8, const std::string &len_tag_key="", bool align_output=false)
 

Additional Inherited Members

- Public Member Functions inherited from gr::tagged_stream_block
void forecast (int noutput_items, gr_vector_int &ninput_items_required)
 Don't override this. More...
 
int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 
virtual int work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)=0
 Just like gr::block::general_work, but makes sure the input is valid. More...
 
- Protected Types inherited from gr::basic_block
enum  vcolor { WHITE, GREY, BLACK }
 
- Protected Member Functions inherited from gr::tagged_stream_block
 tagged_stream_block (void)
 
 tagged_stream_block (const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature, const std::string &length_tag_key)
 
virtual void parse_length_tags (const std::vector< std::vector< tag_t > > &tags, gr_vector_int &n_input_items_reqd)
 Parse all tags on the first sample of a PDU, return the number of items per input and prune the length tags. More...
 
virtual int calculate_output_stream_length (const gr_vector_int &ninput_items)
 Calculate the number of output items. More...
 
virtual void update_length_tags (int n_produced, int n_ports)
 Set the new length tags on the output stream. More...
 
- Protected Attributes inherited from gr::tagged_stream_block
std::string d_length_tag_key_str
 

Detailed Description

Pack k bits from the input stream onto l bits of the output stream.

No bits are lost here; any value for k and l (within [1, 8]) is allowed. On every fresh input byte, it starts reading on the LSB, and starts copying to the LSB as well.

If a packet length tag is given, this block assumes a tagged stream. In this case, the tag with the packet length is updated accordingly. Also, the number of input bits is padded with zeros if the number of input bits is not an integer multiple of l, or bits are truncated from the input if align_output is set to true.

Member Typedef Documentation

Member Function Documentation

static sptr gr::blocks::repack_bits_bb::make ( int  k,
int  l = 8,
const std::string &  len_tag_key = "",
bool  align_output = false 
)
static
Parameters
kNumber of relevant bits on the input stream
lNumber of relevant bits on the output stream
len_tag_keyIf not empty, this is the key for the length tag.
align_outputIf len_tag_key is given, this controls if the input or the output is aligned.

The documentation for this class was generated from the following file: