GNU Radio's SATNOGS Package
gr::satnogs::code::scrambler Class Reference

#include <scrambler.h>

Inheritance diagram for gr::satnogs::code::scrambler:

Public Types

using sptr = fec::generic_encoder::sptr
 

Public Member Functions

int unique_id ()
 
 scrambler (uint32_t mask, uint32_t seed, uint32_t order, bool msb=false, bool self_sync=false)
 
 ~scrambler ()
 
void reset ()
 
void scramble (uint8_t *out, const uint8_t *in, size_t len)
 
void descramble (uint8_t *out, const uint8_t *in, size_t len)
 
void scramble_one_bit_per_byte (uint8_t *out, const uint8_t *in, size_t bits_num)
 
void descramble_one_bit_per_byte (uint8_t *out, const uint8_t *in, size_t bits_num)
 
double rate () override
 
int get_input_size () override
 
int get_output_size () override
 
const char * get_input_conversion () override
 
const char * get_output_conversion () override
 
bool set_frame_size (unsigned int frame_size) override
 
void generic_work (fec_input_buffer_type inbuffer, void *outbuffer) override
 

Static Public Member Functions

static sptr make (uint32_t mask, uint32_t seed, uint32_t order, bool msb=false, bool self_sync=false)
 
static sptr make_ccsds (bool msb=false)
 
static sptr make_g3ruh (bool msb=false)
 
static sptr make_none ()
 

Static Public Attributes

static int base_unique_id
 

Member Typedef Documentation

◆ sptr

using gr::satnogs::code::scrambler::sptr = fec::generic_encoder::sptr

Constructor & Destructor Documentation

◆ scrambler()

gr::satnogs::code::scrambler::scrambler ( uint32_t  mask,
uint32_t  seed,
uint32_t  order,
bool  msb = false,
bool  self_sync = false 
)

◆ ~scrambler()

gr::satnogs::code::scrambler::~scrambler ( )

Member Function Documentation

◆ descramble()

void gr::satnogs::code::scrambler::descramble ( uint8_t *  out,
const uint8_t *  in,
size_t  len 
)

◆ descramble_one_bit_per_byte()

void gr::satnogs::code::scrambler::descramble_one_bit_per_byte ( uint8_t *  out,
const uint8_t *  in,
size_t  bits_num 
)

◆ generic_work()

void gr::satnogs::code::scrambler::generic_work ( fec_input_buffer_type  inbuffer,
void *  outbuffer 
)
override

◆ get_input_conversion()

const char * gr::satnogs::code::scrambler::get_input_conversion ( )
override

Set up a conversion type required to setup the data properly for this encoder. The encoder itself will not implement the conversion and expects an external wrapper (e.g., fec.extended_encoder) to read this value and "do the right thing" to format the data.

The default behavior is 'none', which means no conversion is required. Whatever the get_input_item_size() value returns, the input is expected to conform directly to this. Generally, this means unpacked bytes.

If 'pack', the block expects the inputs to be packed bytes. The wrapper should implement a gr::blocks::pack_k_bits_bb(8) block for this.

The child class MAY implement this function. If not reimplemented, it returns "none".

◆ get_input_size()

int gr::satnogs::code::scrambler::get_input_size ( )
override

Returns the input size in items that the encoder object uses to encode a full frame. Often, this number is the number of bits per frame if the input format is unpacked. If the block expects packed bytes, then this value should be the number of bytes (number of bits / 8) per input frame.

The child class MUST implement this function.

◆ get_output_conversion()

const char * gr::satnogs::code::scrambler::get_output_conversion ( )
override

Set up a conversion type required to understand the output style of this encoder. Generally an encoder will produce unpacked bytes with a bit set in the LSB.

The default behavior is 'none', which means no conversion is required and the encoder produces unpacked bytes.

If 'packed_bits', the block produces packed bits and the wrapper should unpack these (using, for instance, gr::block::unpack_k_bits_bb(8)).

The child class MAY implement this function. If not reimplemented, it returns "none".

◆ get_output_size()

int gr::satnogs::code::scrambler::get_output_size ( )
override

Returns the output size in items that the encoder object produces after encoding a full frame. Often, this number is the number of bits in the outputted frame if the input format is unpacked. If the block produces packed bytes, then this value should be the number of bytes (number of bits / 8) per frame produced. This value is generally something like R*get_input_size() for a 1/R rate code.

The child class MUST implement this function.

◆ make()

static sptr gr::satnogs::code::scrambler::make ( uint32_t  mask,
uint32_t  seed,
uint32_t  order,
bool  msb = false,
bool  self_sync = false 
)
static

◆ make_ccsds()

static sptr gr::satnogs::code::scrambler::make_ccsds ( bool  msb = false)
static

◆ make_g3ruh()

static sptr gr::satnogs::code::scrambler::make_g3ruh ( bool  msb = false)
static

◆ make_none()

static sptr gr::satnogs::code::scrambler::make_none ( )
static

◆ rate()

double gr::satnogs::code::scrambler::rate ( )
override

◆ reset()

void gr::satnogs::code::scrambler::reset ( )

◆ scramble()

void gr::satnogs::code::scrambler::scramble ( uint8_t *  out,
const uint8_t *  in,
size_t  len 
)

◆ scramble_one_bit_per_byte()

void gr::satnogs::code::scrambler::scramble_one_bit_per_byte ( uint8_t *  out,
const uint8_t *  in,
size_t  bits_num 
)

◆ set_frame_size()

bool gr::satnogs::code::scrambler::set_frame_size ( unsigned int  frame_size)
override

Updates the size of the frame to encode.

The child class MUST implement this function and interpret how the frame_size information affects the block's behavior. It should also provide bounds checks.

◆ unique_id()

int gr::satnogs::code::scrambler::unique_id ( )

Member Data Documentation

◆ base_unique_id

int gr::satnogs::code::scrambler::base_unique_id
static

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