gr::digital::header_format_counter
gr::digital::header_format_default
gnuradio/digital/header_format_counter.h
std::shared_ptr< header_format_counter > typedef std::shared_ptr<header_format_counter> gr::digital::header_format_counter::sptr sptr gr::digital::header_format_counter::sptr
uint16_t uint16_t gr::digital::header_format_counter::d_counter d_counter gr::digital::header_format_counter::d_counter

keeps track of the number of packets transmitted

gr::digital::header_format_counter::header_format_counter
(const std::string &access_code, int threshold, int bps)
header_format_counter
gr::digital::header_format_counter::header_format_counter
const std::string & access_code
int threshold
int bps
gr::digital::header_format_default::access_code
gr::digital::header_format_default::threshold
gr::digital::header_format_counter::~header_format_counter
() override
~header_format_counter
gr::digital::header_format_counter::~header_format_counter
bool bool gr::digital::header_format_counter::format (int nbytes_in, const unsigned char *input, pmt::pmt_t &output, pmt::pmt_t &info) override format gr::digital::header_format_counter::format format int nbytes_in const unsigned char * input pmt::pmt_t & output pmt::pmt_t & info

Creates a header from the access code and packet length to build an output packet in the form:

| access code | pkt len | pkt len | bps | counter |

nbytes_in

The length (in bytes) of the `input` payload

input

An array of unsigned chars of the packet payload

output

A pmt::u8vector with the new header prepended onto the input data.

info

A pmt::dict containing meta data and info about the PDU (generally from the metadata portion of the input PDU). Data can be extracted from this for the header formatting or inserted.

size_t size_t gr::digital::header_format_counter::header_nbits () const override header_nbits gr::digital::header_format_counter::header_nbits header_nbits

Returns the length of the formatted header in bits.

sptr static sptr gr::digital::header_format_counter::make (const std::string &access_code, int threshold, int bps) make gr::digital::header_format_counter::make const std::string & access_code int threshold int bps

Factory to create an async packet header formatter; returns an sptr to the object.

access_code

An access code that is used to find and synchronize the start of a packet. Used in the parser and in other blocks like a corr_est block that helps trigger the receiver. Can be up to 64-bits long.

threshold

How many bits can be wrong in the access code and still count as correct.

bps

The number of bits/second used in the payload's modulator.

gr::digital::header_format_default::access_code
gr::digital::header_format_default::threshold
bool bool gr::digital::header_format_counter::header_ok () override header_ok gr::digital::header_format_counter::header_ok header_ok

Verify that the header is valid.

int int gr::digital::header_format_counter::header_payload () override header_payload gr::digital::header_format_counter::header_payload header_payload

Get info from the header; return payload length and package rest of data in d_info dictionary.

Extracts the header of the form:

| access code | pkt len | pkt len | bps | counter | payload |

Header formatter that adds the payload bits/symbol format and a packet number counter.

Child class of header_format_default. This version adds two fields to the header:

- bps (16 bits): bits/symbol used when modulating the payload.

- count (16 bits): a counter for the packet number.

Like the default packet formatter, the length is encoded as a 16-bit value repeated twice. The full packet looks like: | access code | hdr | payload |

Where the access code is <= 64 bits and hdr is: | 0 -- 15 | 16 -- 31 | | pkt len | pkt len | | bits/sym | counter |

The access code and header are formatted for network byte order.

header_format_default

gr::digital::header_format_base
gr::digital::header_format_counter
gr::digital::header_format_default
std::enable_shared_from_this< gr::digital::header_format_base >
gr::digital::header_buffer
gr::digital::header_format_base
d_hdr_reg
d_info
d_debug_logger
d_logger
gr::digital::header_format_counter
gr::digital::header_format_default
std::enable_shared_from_this< gr::digital::header_format_base >
std::shared_ptr< logger >
std::shared_ptr< pmt_base >
- gr::digital::header_format_counter
  access_code
- gr::digital::header_format_counter
  base
- gr::digital::header_format_counter
  d_access_code
- gr::digital::header_format_counter
  d_access_code_len
- gr::digital::header_format_counter
  d_bps
- gr::digital::header_format_counter
  d_counter
- gr::digital::header_format_counter
  d_data_reg
- gr::digital::header_format_counter
  d_debug_logger
- gr::digital::header_format_counter
  d_hdr_reg
- gr::digital::header_format_counter
  d_info
- gr::digital::header_format_counter
  d_logger
- gr::digital::header_format_counter
  d_mask
- gr::digital::header_format_counter
  d_nbits
- gr::digital::header_format_counter
  d_pkt_count
- gr::digital::header_format_counter
  d_pkt_len
- gr::digital::header_format_counter
  d_state
- gr::digital::header_format_counter
  d_threshold
- gr::digital::header_format_counter
  enter_have_header
- gr::digital::header_format_counter
  enter_have_sync
- gr::digital::header_format_counter
  enter_search
- gr::digital::header_format_counter
  format
- gr::digital::header_format_counter
  formatter
- gr::digital::header_format_counter
  header_format_base
- gr::digital::header_format_counter
  header_format_counter
- gr::digital::header_format_counter
  header_format_default
- gr::digital::header_format_counter
  header_nbits
- gr::digital::header_format_counter
  header_nbytes
- gr::digital::header_format_counter
  header_ok
- gr::digital::header_format_counter
  header_payload
- gr::digital::header_format_counter
  make
- gr::digital::header_format_counter
  parse
- gr::digital::header_format_counter
  set_access_code
- gr::digital::header_format_counter
  set_threshold
- gr::digital::header_format_counter
  sptr
- gr::digital::header_format_counter
  STATE_HAVE_SYNC
- gr::digital::header_format_counter
  STATE_SYNC_SEARCH
- gr::digital::header_format_counter
  state_t
- gr::digital::header_format_counter
  threshold
- gr::digital::header_format_counter
  ~header_format_base
- gr::digital::header_format_counter
  ~header_format_counter
- gr::digital::header_format_counter
  ~header_format_default