Loading...
Searching...
No Matches
metadata.hpp
Go to the documentation of this file.
//
// Copyright 2010-2012,2014 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/types/time_spec.hpp>
#include <stdint.h>
#include <string>
namespace uhd {
struct UHD_API rx_metadata_t
{
rx_metadata_t()
{
reset();
}
void reset()
{
has_time_spec = false;
time_spec = time_spec_t(0.0);
more_fragments = false;
fragment_offset = 0;
start_of_burst = false;
end_of_burst = false;
eov_positions = nullptr;
eov_positions_size = 0;
eov_positions_count = 0;
error_code = ERROR_CODE_NONE;
out_of_sequence = false;
}
bool has_time_spec;
time_spec_t time_spec;
bool more_fragments;
size_t fragment_offset;
bool start_of_burst;
bool end_of_burst;
size_t* eov_positions;
size_t eov_positions_size;
size_t eov_positions_count;
enum error_code_t {
ERROR_CODE_NONE = 0x0,
ERROR_CODE_TIMEOUT = 0x1,
ERROR_CODE_LATE_COMMAND = 0x2,
ERROR_CODE_BROKEN_CHAIN = 0x4,
ERROR_CODE_OVERFLOW = 0x8,
ERROR_CODE_ALIGNMENT = 0xc,
ERROR_CODE_BAD_PACKET = 0xf
} error_code;
bool out_of_sequence;
std::string to_pp_string(bool compact = true) const;
std::string strerror(void) const;
};
struct UHD_API tx_metadata_t
{
bool has_time_spec;
time_spec_t time_spec;
bool start_of_burst;
bool end_of_burst;
size_t* eov_positions = nullptr;
size_t eov_positions_size = 0;
tx_metadata_t(void);
};
struct UHD_API async_metadata_t
{
size_t channel;
bool has_time_spec;
time_spec_t time_spec;
enum event_code_t {
EVENT_CODE_OK = 0,
EVENT_CODE_BURST_ACK = 0x1,
EVENT_CODE_UNDERFLOW = 0x2,
EVENT_CODE_SEQ_ERROR = 0x4,
EVENT_CODE_TIME_ERROR = 0x8,
EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
EVENT_CODE_USER_PAYLOAD = 0x40
} event_code;
uint32_t user_payload[4];
std::string to_pp_string(bool compact = true) const;
std::string strevent(void) const;
};
} // namespace uhd
uhd::time_spec_t
Definition time_spec.hpp:31
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
uhd
Definition build_info.hpp:12
uhd::async_metadata_t
Definition metadata.hpp:203
uhd::async_metadata_t::event_code_t
event_code_t
Definition metadata.hpp:216
uhd::async_metadata_t::EVENT_CODE_BURST_ACK
@ EVENT_CODE_BURST_ACK
A burst was successfully transmitted.
Definition metadata.hpp:220
uhd::async_metadata_t::EVENT_CODE_UNDERFLOW_IN_PACKET
@ EVENT_CODE_UNDERFLOW_IN_PACKET
Underflow occurred inside a packet.
Definition metadata.hpp:228
uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR
@ EVENT_CODE_SEQ_ERROR
Packet loss between host and device.
Definition metadata.hpp:224
uhd::async_metadata_t::EVENT_CODE_UNDERFLOW
@ EVENT_CODE_UNDERFLOW
An internal send buffer has emptied.
Definition metadata.hpp:222
uhd::async_metadata_t::EVENT_CODE_TIME_ERROR
@ EVENT_CODE_TIME_ERROR
Packet had time that was late.
Definition metadata.hpp:226
uhd::async_metadata_t::EVENT_CODE_USER_PAYLOAD
@ EVENT_CODE_USER_PAYLOAD
Some kind of custom user payload.
Definition metadata.hpp:232
uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR_IN_BURST
@ EVENT_CODE_SEQ_ERROR_IN_BURST
Packet loss within a burst.
Definition metadata.hpp:230
uhd::async_metadata_t::EVENT_CODE_OK
@ EVENT_CODE_OK
Status report without error code.
Definition metadata.hpp:218
uhd::async_metadata_t::has_time_spec
bool has_time_spec
Has time specification?
Definition metadata.hpp:208
uhd::async_metadata_t::user_payload
uint32_t user_payload[4]
Definition metadata.hpp:238
uhd::async_metadata_t::strevent
std::string strevent(void) const
uhd::async_metadata_t::to_pp_string
std::string to_pp_string(bool compact=true) const
uhd::async_metadata_t::channel
size_t channel
The channel number in a mimo configuration.
Definition metadata.hpp:205
uhd::async_metadata_t::time_spec
time_spec_t time_spec
When the async event occurred.
Definition metadata.hpp:211
uhd::rx_metadata_t::rx_metadata_t
rx_metadata_t()
Default constructor.
Definition metadata.hpp:25
uhd::rx_metadata_t::more_fragments
bool more_fragments
Definition metadata.hpp:59
uhd::rx_metadata_t::time_spec
time_spec_t time_spec
Time of the first sample.
Definition metadata.hpp:50
uhd::rx_metadata_t::out_of_sequence
bool out_of_sequence
Definition metadata.hpp:140
uhd::rx_metadata_t::strerror
std::string strerror(void) const
uhd::rx_metadata_t::end_of_burst
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition metadata.hpp:72
uhd::rx_metadata_t::has_time_spec
bool has_time_spec
Has time specification?
Definition metadata.hpp:47
uhd::rx_metadata_t::to_pp_string
std::string to_pp_string(bool compact=true) const
uhd::rx_metadata_t::reset
void reset()
Reset values.
Definition metadata.hpp:31
uhd::rx_metadata_t::eov_positions
size_t * eov_positions
Definition metadata.hpp:90
uhd::rx_metadata_t::start_of_burst
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition metadata.hpp:69
uhd::rx_metadata_t::eov_positions_size
size_t eov_positions_size
Definition metadata.hpp:91
uhd::rx_metadata_t::error_code
enum uhd::rx_metadata_t::error_code_t error_code
uhd::rx_metadata_t::error_code_t
error_code_t
Definition metadata.hpp:113
uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND
@ ERROR_CODE_LATE_COMMAND
A stream command was issued in the past.
Definition metadata.hpp:119
uhd::rx_metadata_t::ERROR_CODE_BROKEN_CHAIN
@ ERROR_CODE_BROKEN_CHAIN
Expected another stream command.
Definition metadata.hpp:121
uhd::rx_metadata_t::ERROR_CODE_ALIGNMENT
@ ERROR_CODE_ALIGNMENT
Multi-channel alignment failed.
Definition metadata.hpp:133
uhd::rx_metadata_t::ERROR_CODE_NONE
@ ERROR_CODE_NONE
No error associated with this metadata.
Definition metadata.hpp:115
uhd::rx_metadata_t::ERROR_CODE_BAD_PACKET
@ ERROR_CODE_BAD_PACKET
The packet could not be parsed.
Definition metadata.hpp:135
uhd::rx_metadata_t::ERROR_CODE_TIMEOUT
@ ERROR_CODE_TIMEOUT
No packet received, implementation timed-out.
Definition metadata.hpp:117
uhd::rx_metadata_t::ERROR_CODE_OVERFLOW
@ ERROR_CODE_OVERFLOW
Definition metadata.hpp:131
uhd::rx_metadata_t::eov_positions_count
size_t eov_positions_count
Definition metadata.hpp:97
uhd::rx_metadata_t::fragment_offset
size_t fragment_offset
Definition metadata.hpp:66
uhd::tx_metadata_t::end_of_burst
bool end_of_burst
Set end of burst to true for the last packet in the chain.
Definition metadata.hpp:178
uhd::tx_metadata_t::tx_metadata_t
tx_metadata_t(void)
uhd::tx_metadata_t::eov_positions_size
size_t eov_positions_size
Definition metadata.hpp:190
uhd::tx_metadata_t::start_of_burst
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition metadata.hpp:175
uhd::tx_metadata_t::time_spec
time_spec_t time_spec
When to send the first sample.
Definition metadata.hpp:172
uhd::tx_metadata_t::eov_positions
size_t * eov_positions
Definition metadata.hpp:189
uhd::tx_metadata_t::has_time_spec
bool has_time_spec
Definition metadata.hpp:169
time_spec.hpp