USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
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>
11 #include <uhd/types/time_spec.hpp>
12 #include <stdint.h>
13 #include <string>
14 
15 namespace 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 
90  size_t* eov_positions;
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 
196  tx_metadata_t(void);
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
uhd::rx_metadata_t::eov_positions_count
size_t eov_positions_count
Definition: metadata.hpp:97
uhd::rx_metadata_t::eov_positions
size_t * eov_positions
Definition: metadata.hpp:90
uhd::rx_metadata_t::out_of_sequence
bool out_of_sequence
Definition: metadata.hpp:140
uhd::rx_metadata_t::time_spec
time_spec_t time_spec
Time of the first sample.
Definition: metadata.hpp:50
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::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::reset
void reset()
Reset values.
Definition: metadata.hpp:31
uhd::rx_metadata_t::eov_positions_size
size_t eov_positions_size
Definition: metadata.hpp:91
time_spec.hpp
config.hpp
uhd::tx_metadata_t::time_spec
time_spec_t time_spec
When to send the first sample.
Definition: metadata.hpp:172
uhd::rx_metadata_t::fragment_offset
size_t fragment_offset
Definition: metadata.hpp:66
uhd::rx_metadata_t::rx_metadata_t
rx_metadata_t()
Default constructor.
Definition: metadata.hpp:25
UHD_API
#define UHD_API
Definition: config.h:87
uhd::async_metadata_t::channel
size_t channel
The channel number in a mimo configuration.
Definition: metadata.hpp:205
uhd::async_metadata_t
Definition: metadata.hpp:202
uhd::tx_metadata_t::has_time_spec
bool has_time_spec
Definition: metadata.hpp:169
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
Definition: build_info.hpp:12
uhd::time_spec_t
Definition: time_spec.hpp:28
uhd::rx_metadata_t::error_code_t
error_code_t
Definition: metadata.hpp:113
uhd::rx_metadata_t::has_time_spec
bool has_time_spec
Has time specification?
Definition: metadata.hpp:47
uhd::rx_metadata_t::more_fragments
bool more_fragments
Definition: metadata.hpp:59
uhd::async_metadata_t::time_spec
time_spec_t time_spec
When the async event occurred.
Definition: metadata.hpp:211
uhd::async_metadata_t::has_time_spec
bool has_time_spec
Has time specification?
Definition: metadata.hpp:208
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::async_metadata_t::event_code_t
event_code_t
Definition: metadata.hpp:216
uhd::rx_metadata_t
Definition: metadata.hpp:22
uhd::tx_metadata_t
Definition: metadata.hpp:162