USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-g6563c537
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 #ifndef INCLUDED_UHD_TYPES_METADATA_HPP
9 #define INCLUDED_UHD_TYPES_METADATA_HPP
10 
11 #include <uhd/config.hpp>
12 #include <uhd/types/time_spec.hpp>
13 #include <stdint.h>
14 #include <string>
15 
16 namespace uhd {
17 
24 {
27  {
28  reset();
29  }
30 
32  void reset()
33  {
34  has_time_spec = false;
35  time_spec = time_spec_t(0.0);
36  more_fragments = false;
37  fragment_offset = 0;
38  start_of_burst = false;
39  end_of_burst = false;
40  error_code = ERROR_CODE_NONE;
41  out_of_sequence = false;
42  }
43 
46 
49 
58 
65 
68 
71 
86  enum error_code_t {
88  ERROR_CODE_NONE = 0x0,
90  ERROR_CODE_TIMEOUT = 0x1,
92  ERROR_CODE_LATE_COMMAND = 0x2,
94  ERROR_CODE_BROKEN_CHAIN = 0x4,
104  ERROR_CODE_OVERFLOW = 0x8,
106  ERROR_CODE_ALIGNMENT = 0xc,
108  ERROR_CODE_BAD_PACKET = 0xf
109  } error_code;
110 
114 
121  std::string to_pp_string(bool compact = true) const;
122 
127  std::string strerror(void) const;
128 };
129 
136 {
143 
146 
149 
152 
157  tx_metadata_t(void);
158 };
159 
164 {
166  size_t channel;
167 
170 
173 
179  EVENT_CODE_BURST_ACK = 0x1,
181  EVENT_CODE_UNDERFLOW = 0x2,
183  EVENT_CODE_SEQ_ERROR = 0x4,
185  EVENT_CODE_TIME_ERROR = 0x8,
187  EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
189  EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
191  EVENT_CODE_USER_PAYLOAD = 0x40
192  } event_code;
193 
197  uint32_t user_payload[4];
198 };
199 
200 } // namespace uhd
201 
202 #endif /* INCLUDED_UHD_TYPES_METADATA_HPP */
time_spec_t time_spec
Time of the first sample.
Definition: metadata.hpp:48
bool end_of_burst
Set end of burst to true for the last packet in the chain.
Definition: metadata.hpp:151
time_spec_t time_spec
When to send the first sample.
Definition: metadata.hpp:145
void reset()
Reset values.
Definition: metadata.hpp:32
Definition: time_spec.hpp:29
bool has_time_spec
Has time specification?
Definition: metadata.hpp:169
rx_metadata_t()
Default constructor.
Definition: metadata.hpp:26
size_t fragment_offset
Definition: metadata.hpp:64
event_code_t
Definition: metadata.hpp:177
Definition: metadata.hpp:23
Definition: metadata.hpp:135
Definition: build_info.hpp:13
bool has_time_spec
Definition: metadata.hpp:142
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition: metadata.hpp:67
error_code_t
Definition: metadata.hpp:86
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition: metadata.hpp:148
bool has_time_spec
Has time specification?
Definition: metadata.hpp:45
#define UHD_API
Definition: config.h:68
Definition: metadata.hpp:163
size_t channel
The channel number in a mimo configuration.
Definition: metadata.hpp:166
bool more_fragments
Definition: metadata.hpp:57
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition: metadata.hpp:70
time_spec_t time_spec
When the async event occurred.
Definition: metadata.hpp:172
bool out_of_sequence
Definition: metadata.hpp:113