USRP Hardware Driver and USRP Manual  Version:
UHD and USRP Manual
uhd::rx_metadata_t Struct Reference

#include <uhd/types/metadata.hpp>

Public Types

enum  error_code_t {

Public Member Functions

 rx_metadata_t ()
 Default constructor. More...
void reset ()
 Reset values. More...
std::string to_pp_string (bool compact=true) const
std::string strerror (void) const

Public Attributes

bool has_time_spec
 Has time specification? More...
time_spec_t time_spec
 Time of the first sample. More...
bool more_fragments
size_t fragment_offset
bool start_of_burst
 Start of burst will be true for the first packet in the chain. More...
bool end_of_burst
 End of burst will be true for the last packet in the chain. More...
size_t * eov_positions
size_t eov_positions_size
size_t eov_positions_count
enum uhd::rx_metadata_t::error_code_t error_code
bool out_of_sequence

Detailed Description

RX metadata structure for describing sent IF data. Includes time specification, fragmentation flags, burst flags, and error codes. The receive routines will convert IF data headers into metadata.

Member Enumeration Documentation

◆ error_code_t

The error condition on a receive call.

Note: When an overrun occurs in continuous streaming mode, the device will continue to send samples to the host. For other streaming modes, streaming will discontinue until the user issues a new stream command.

The metadata fields have meaning for the following error codes:

  • none
  • late command
  • broken chain
  • overflow

No error associated with this metadata.


No packet received, implementation timed-out.


A stream command was issued in the past.


Expected another stream command.


An internal receive buffer has filled or a sequence error has been detected. So, why is this overloaded? Simple: legacy support. It would have been much cleaner to create a separate error code for a sequence error, but that would have broken legacy applications. So, the out_of_sequence flag was added to differentiate between the two error cases. In either case, data is missing between this time_spec and the and the time_spec of the next successful receive.


Multi-channel alignment failed.


The packet could not be parsed.

Constructor & Destructor Documentation

◆ rx_metadata_t()

uhd::rx_metadata_t::rx_metadata_t ( )

Default constructor.

Member Function Documentation

◆ reset()

void uhd::rx_metadata_t::reset ( )

Reset values.

◆ strerror()

std::string uhd::rx_metadata_t::strerror ( void  ) const

Similar to C's strerror() function, creates a std::string describing the error code.

a printable string representing the error.

◆ to_pp_string()

std::string uhd::rx_metadata_t::to_pp_string ( bool  compact = true) const

Convert a rx_metadata_t into a pretty print string.

compactSet to false for a more verbose output.
a printable string representing the metadata.

Member Data Documentation

◆ end_of_burst

bool uhd::rx_metadata_t::end_of_burst

End of burst will be true for the last packet in the chain.

◆ eov_positions

size_t* uhd::rx_metadata_t::eov_positions

If this pointer is not null, it specifies the address of an array of size_ts into which the sample offset relative to the beginning of a call to recv() of each vector (as denoted by packets with the eov header byte set) will be written.

The caller is responsible for allocating and deallocating the storage for the array and for indicating the maximum number of elements in the array via the eov_positions_size value below.

Upon return from recv(), eov_positions_count will be updated to indicate the number of valid entries written to the end_of_vector_positions array. It shall never exceed the value of eov_positions_size. However, if in the process of recv(), storage for new positions is exhausted, then recv() shall return.

◆ eov_positions_count

size_t uhd::rx_metadata_t::eov_positions_count

Upon return from recv(), holds the number of end-of-vector indications in the eov_positions array.

◆ eov_positions_size

size_t uhd::rx_metadata_t::eov_positions_size

◆ error_code

enum uhd::rx_metadata_t::error_code_t uhd::rx_metadata_t::error_code

◆ fragment_offset

size_t uhd::rx_metadata_t::fragment_offset

Fragmentation offset: The fragment offset is the sample number at the start of the receive buffer. For non-fragmented receives, the fragment offset should always be zero.

◆ has_time_spec

bool uhd::rx_metadata_t::has_time_spec

Has time specification?

◆ more_fragments

bool uhd::rx_metadata_t::more_fragments

Fragmentation flag: Similar to IPv4 fragmentation: More fragments is true when the input buffer has insufficient size to fit an entire received packet. More fragments will be false for the last fragment.

◆ out_of_sequence

bool uhd::rx_metadata_t::out_of_sequence

Out of sequence. The transport has either dropped a packet or received data out of order.

◆ start_of_burst

bool uhd::rx_metadata_t::start_of_burst

Start of burst will be true for the first packet in the chain.

◆ time_spec

time_spec_t uhd::rx_metadata_t::time_spec

Time of the first sample.

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