Header formatter that includes the payload length, packet number, and a CRC check on the header.
More...
#include <gnuradio/digital/header_format_ofdm.h>
|
| header_format_ofdm (const std::vector< std::vector< int > > &occupied_carriers, int n_syms, const std::string &len_key_name="packet_len", const std::string &frame_key_name="frame_len", const std::string &num_key_name="packet_num", int bits_per_header_sym=1, int bits_per_payload_sym=1, bool scramble_header=false) |
|
| ~header_format_ofdm () override |
|
bool | format (int nbytes_in, const unsigned char *input, pmt::pmt_t &output, pmt::pmt_t &info) override |
| Encodes the header information in the given tags into bits and places them into out . More...
|
|
bool | parse (int nbits_in, const unsigned char *input, std::vector< pmt::pmt_t > &info, int &nbits_processed) override |
|
size_t | header_nbits () const override |
|
|
static sptr | make (const std::vector< std::vector< int > > &occupied_carriers, int n_syms, const std::string &len_key_name="packet_len", const std::string &frame_key_name="frame_len", const std::string &num_key_name="packet_num", int bits_per_header_sym=1, int bits_per_payload_sym=1, bool scramble_header=false) |
|
Header formatter that includes the payload length, packet number, and a CRC check on the header.
Child class of header_format_base. This version's header format looks like:
- length (12 bits): length of the payload
- number (12 bits): packet number
- CRC8 (8 bits): A CRC8 check on the header contents
Instead of duplicating the payload length, we only add it once and use the CRC8 to make sure it's correctly received.
| 0 -- 11 | 12 -- 23 | 24 -- 31 |
| len | pkt len | CRC8 |
Reimplements packet_header_default in the style of the header_format_base.
◆ sptr
◆ header_format_ofdm()
gr::digital::header_format_ofdm::header_format_ofdm |
( |
const std::vector< std::vector< int > > & |
occupied_carriers, |
|
|
int |
n_syms, |
|
|
const std::string & |
len_key_name = "packet_len" , |
|
|
const std::string & |
frame_key_name = "frame_len" , |
|
|
const std::string & |
num_key_name = "packet_num" , |
|
|
int |
bits_per_header_sym = 1 , |
|
|
int |
bits_per_payload_sym = 1 , |
|
|
bool |
scramble_header = false |
|
) |
| |
◆ ~header_format_ofdm()
gr::digital::header_format_ofdm::~header_format_ofdm |
( |
| ) |
|
|
override |
◆ format()
bool gr::digital::header_format_ofdm::format |
( |
int |
nbytes_in, |
|
|
const unsigned char * |
input, |
|
|
pmt::pmt_t & |
output, |
|
|
pmt::pmt_t & |
info |
|
) |
| |
|
overridevirtual |
Encodes the header information in the given tags into bits and places them into out
.
Uses the following header format:
- Bits 0-11: The packet length (what was stored in the tag with key
len_tag_key
)
- Bits 12-23: The header number (counts up every time this function is called)
- Bit 24-31: 8-Bit CRC
Reimplemented from gr::digital::header_format_crc.
◆ header_nbits()
size_t gr::digital::header_format_ofdm::header_nbits |
( |
| ) |
const |
|
overridevirtual |
◆ header_payload()
int gr::digital::header_format_ofdm::header_payload |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ make()
static sptr gr::digital::header_format_ofdm::make |
( |
const std::vector< std::vector< int > > & |
occupied_carriers, |
|
|
int |
n_syms, |
|
|
const std::string & |
len_key_name = "packet_len" , |
|
|
const std::string & |
frame_key_name = "frame_len" , |
|
|
const std::string & |
num_key_name = "packet_num" , |
|
|
int |
bits_per_header_sym = 1 , |
|
|
int |
bits_per_payload_sym = 1 , |
|
|
bool |
scramble_header = false |
|
) |
| |
|
static |
Factory to create an async packet header formatter; returns an sptr to the object.
◆ parse()
bool gr::digital::header_format_ofdm::parse |
( |
int |
nbits_in, |
|
|
const unsigned char * |
input, |
|
|
std::vector< pmt::pmt_t > & |
info, |
|
|
int & |
nbits_processed |
|
) |
| |
|
overridevirtual |
Parses a header. This function is overloaded in the child class, which knows how to convert the incoming hard bits (0's and 1's) back into a packet header.
- Parameters
-
nbits_in | The number of bits in the input array. |
input | The input as hard decision bits. |
info | A vector of pmt::dicts to hold any meta data or info about the PDU. When parsing the header, the formatter can add info from the header into this dict. Each packet has a single PMT dictionary of info, so the vector length is the number of packets received extracted during one call to this parser function. |
nbits_processed | Number of input bits actually processed; If all goes well, this is nbits_in. A premature return after a bad header could be less than this. |
MUST be overloaded.
Reimplemented from gr::digital::header_format_crc.
◆ d_bits_per_payload_sym
int gr::digital::header_format_ofdm::d_bits_per_payload_sym |
|
protected |
◆ d_frame_key_name
pmt::pmt_t gr::digital::header_format_ofdm::d_frame_key_name |
|
protected |
Tag key of the additional frame length tag.
◆ d_header_len
size_t gr::digital::header_format_ofdm::d_header_len |
|
protected |
◆ d_occupied_carriers
const std::vector<std::vector<int> > gr::digital::header_format_ofdm::d_occupied_carriers |
|
protected |
Which carriers/symbols carry data.
◆ d_scramble_mask
std::vector<uint8_t> gr::digital::header_format_ofdm::d_scramble_mask |
|
protected |
Bits are xor'd with this before tx'ing.
◆ d_syms_per_set
int gr::digital::header_format_ofdm::d_syms_per_set |
|
protected |
Helper variable: Total number of elements in d_occupied_carriers.
The documentation for this class was generated from the following file: