USRP Hardware Driver and USRP Manual Version: 4.1.0.1
UHD and USRP Manual
metadata.hpp
Go to the documentation of this file.
1//
2// Copyright 2010-2012,2014 Ettus Research LLC
3// Copyright 2018 Ettus Research, a National Instruments Company
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
8#pragma once
9
10#include <uhd/config.hpp>
12#include <stdint.h>
13#include <string>
14
15namespace uhd {
16
23{
26 {
27 reset();
28 }
29
31 void reset()
32 {
33 has_time_spec = false;
34 time_spec = time_spec_t(0.0);
35 more_fragments = false;
36 fragment_offset = 0;
37 start_of_burst = false;
38 end_of_burst = false;
39 eov_positions = nullptr;
40 eov_positions_size = 0;
41 eov_positions_count = 0;
42 error_code = ERROR_CODE_NONE;
43 out_of_sequence = false;
44 }
45
48
51
60
67
70
73
92
98
115 ERROR_CODE_NONE = 0x0,
117 ERROR_CODE_TIMEOUT = 0x1,
119 ERROR_CODE_LATE_COMMAND = 0x2,
121 ERROR_CODE_BROKEN_CHAIN = 0x4,
131 ERROR_CODE_OVERFLOW = 0x8,
133 ERROR_CODE_ALIGNMENT = 0xc,
135 ERROR_CODE_BAD_PACKET = 0xf
136 } error_code;
137
141
148 std::string to_pp_string(bool compact = true) const;
149
154 std::string strerror(void) const;
155};
156
163{
170
173
176
179
189 size_t* eov_positions = nullptr;
190 size_t eov_positions_size = 0;
191
197};
198
203{
205 size_t channel;
206
209
212
218 EVENT_CODE_BURST_ACK = 0x1,
220 EVENT_CODE_UNDERFLOW = 0x2,
222 EVENT_CODE_SEQ_ERROR = 0x4,
224 EVENT_CODE_TIME_ERROR = 0x8,
226 EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
228 EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
230 EVENT_CODE_USER_PAYLOAD = 0x40
231 } event_code;
232
236 uint32_t user_payload[4];
237};
238
239} // namespace uhd
Definition: time_spec.hpp:31
#define UHD_API
Definition: config.h:70
Definition: build_info.hpp:12
Definition: metadata.hpp:203
event_code_t
Definition: metadata.hpp:216
bool has_time_spec
Has time specification?
Definition: metadata.hpp:208
size_t channel
The channel number in a mimo configuration.
Definition: metadata.hpp:205
time_spec_t time_spec
When the async event occurred.
Definition: metadata.hpp:211
Definition: metadata.hpp:23
rx_metadata_t()
Default constructor.
Definition: metadata.hpp:25
bool more_fragments
Definition: metadata.hpp:59
time_spec_t time_spec
Time of the first sample.
Definition: metadata.hpp:50
bool out_of_sequence
Definition: metadata.hpp:140
std::string strerror(void) const
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition: metadata.hpp:72
bool has_time_spec
Has time specification?
Definition: metadata.hpp:47
std::string to_pp_string(bool compact=true) const
void reset()
Reset values.
Definition: metadata.hpp:31
size_t * eov_positions
Definition: metadata.hpp:90
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition: metadata.hpp:69
size_t eov_positions_size
Definition: metadata.hpp:91
error_code_t
Definition: metadata.hpp:113
size_t eov_positions_count
Definition: metadata.hpp:97
size_t fragment_offset
Definition: metadata.hpp:66
Definition: metadata.hpp:163
bool end_of_burst
Set end of burst to true for the last packet in the chain.
Definition: metadata.hpp:178
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition: metadata.hpp:175
time_spec_t time_spec
When to send the first sample.
Definition: metadata.hpp:172
bool has_time_spec
Definition: metadata.hpp:169