USRP Hardware Driver and USRP Manual  Version: 3.12.0.0.rc1-3-gf95e7a901
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 
57 
64 
67 
70 
85  enum error_code_t {
87  ERROR_CODE_NONE = 0x0,
89  ERROR_CODE_TIMEOUT = 0x1,
91  ERROR_CODE_LATE_COMMAND = 0x2,
93  ERROR_CODE_BROKEN_CHAIN = 0x4,
102  ERROR_CODE_OVERFLOW = 0x8,
104  ERROR_CODE_ALIGNMENT = 0xc,
106  ERROR_CODE_BAD_PACKET = 0xf
107  } error_code;
108 
111 
118  std::string to_pp_string(bool compact=true) const;
119 
124  std::string strerror(void) const;
125  };
126 
139 
142 
145 
148 
153  tx_metadata_t(void);
154  };
155 
161  size_t channel;
162 
165 
168 
174  EVENT_CODE_BURST_ACK = 0x1,
176  EVENT_CODE_UNDERFLOW = 0x2,
178  EVENT_CODE_SEQ_ERROR = 0x4,
180  EVENT_CODE_TIME_ERROR = 0x8,
182  EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
184  EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
186  EVENT_CODE_USER_PAYLOAD = 0x40
187  } event_code;
188 
192  uint32_t user_payload[4];
193 
194  };
195 
196 } //namespace uhd
197 
198 #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:147
time_spec_t time_spec
When to send the first sample.
Definition: metadata.hpp:141
void reset()
Reset values.
Definition: metadata.hpp:32
Definition: time_spec.hpp:29
bool has_time_spec
Has time specification?
Definition: metadata.hpp:164
rx_metadata_t()
Default constructor.
Definition: metadata.hpp:26
size_t fragment_offset
Definition: metadata.hpp:63
event_code_t
Definition: metadata.hpp:172
Definition: metadata.hpp:23
Definition: metadata.hpp:132
Definition: build_info.hpp:14
bool has_time_spec
Definition: metadata.hpp:138
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition: metadata.hpp:66
error_code_t
Definition: metadata.hpp:85
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition: metadata.hpp:144
bool has_time_spec
Has time specification?
Definition: metadata.hpp:45
#define UHD_API
Definition: config.h:63
Definition: metadata.hpp:159
size_t channel
The channel number in a mimo configuration.
Definition: metadata.hpp:161
bool more_fragments
Definition: metadata.hpp:56
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition: metadata.hpp:69
time_spec_t time_spec
When the async event occurred.
Definition: metadata.hpp:167
bool out_of_sequence
Out of sequence. The transport has either dropped a packet or received data out of order...
Definition: metadata.hpp:110