GNU Radio Manual and C++ API Reference  3.7.5
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
gr::blocks::short_to_char Class Reference

Convert stream of shorts to a stream of chars. More...

#include <gnuradio/blocks/short_to_char.h>

Public Types

typedef boost::shared_ptr
< short_to_char
sptr

Static Public Member Functions

static sptr make (size_t vlen=1)

Additional Inherited Members

- Public Member Functions inherited from gr::sync_block
virtual int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)=0
 just like gr::block::general_work, only this arranges to call consume_each for you
void forecast (int noutput_items, gr_vector_int &ninput_items_required)
 Estimate input requirements given output request.
int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 compute output items from input items
int fixed_rate_ninput_to_noutput (int ninput)
 Given ninput samples, return number of output samples that will be produced. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.
int fixed_rate_noutput_to_ninput (int noutput)
 Given noutput samples, return number of input samples required to produce noutput. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.
- Protected Types inherited from gr::basic_block
enum  vcolor { WHITE, GREY, BLACK }
- Protected Member Functions inherited from gr::sync_block
 sync_block (void)
 sync_block (const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature)
- Protected Attributes inherited from gr::block
std::vector< long > d_max_output_buffer
std::vector< long > d_min_output_buffer
gr::thread::mutex d_setlock
gr::logger_ptr d_logger
gr::logger_ptr d_debug_logger

Detailed Description

Convert stream of shorts to a stream of chars.

This block strips off the least significant byte from the short value.

[0x00ff, 0x0ff0, 0xff00] => [0x00, 0x0f, 0xff]

Converts vlen length vectors of input short samples to chars, dividing each element by 256.

Member Typedef Documentation

Member Function Documentation

static sptr gr::blocks::short_to_char::make ( size_t  vlen = 1)
static

Build a short to char block.

Parameters
vlenvector length of data streams.

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