USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
metadata.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2012,2014 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_TYPES_METADATA_HPP
8 #define INCLUDED_UHD_TYPES_METADATA_HPP
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  error_code = ERROR_CODE_NONE;
40  out_of_sequence = false;
41  }
42 
45 
48 
56 
63 
66 
69 
84  enum error_code_t {
86  ERROR_CODE_NONE = 0x0,
88  ERROR_CODE_TIMEOUT = 0x1,
90  ERROR_CODE_LATE_COMMAND = 0x2,
92  ERROR_CODE_BROKEN_CHAIN = 0x4,
101  ERROR_CODE_OVERFLOW = 0x8,
103  ERROR_CODE_ALIGNMENT = 0xc,
105  ERROR_CODE_BAD_PACKET = 0xf
106  } error_code;
107 
110 
117  std::string to_pp_string(bool compact=true) const;
118 
123  std::string strerror(void) const;
124  };
125 
138 
141 
144 
147 
152  tx_metadata_t(void);
153  };
154 
160  size_t channel;
161 
164 
167 
173  EVENT_CODE_BURST_ACK = 0x1,
175  EVENT_CODE_UNDERFLOW = 0x2,
177  EVENT_CODE_SEQ_ERROR = 0x4,
179  EVENT_CODE_TIME_ERROR = 0x8,
181  EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
183  EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
185  EVENT_CODE_USER_PAYLOAD = 0x40
186  } event_code;
187 
191  uint32_t user_payload[4];
192 
193  };
194 
195 } //namespace uhd
196 
197 #endif /* INCLUDED_UHD_TYPES_METADATA_HPP */
time_spec_t time_spec
Time of the first sample.
Definition: metadata.hpp:47
bool end_of_burst
Set end of burst to true for the last packet in the chain.
Definition: metadata.hpp:146
time_spec_t time_spec
When to send the first sample.
Definition: metadata.hpp:140
void reset()
Reset values.
Definition: metadata.hpp:31
Definition: time_spec.hpp:28
bool has_time_spec
Has time specification?
Definition: metadata.hpp:163
rx_metadata_t()
Default constructor.
Definition: metadata.hpp:25
size_t fragment_offset
Definition: metadata.hpp:62
event_code_t
Definition: metadata.hpp:171
Definition: metadata.hpp:22
Definition: metadata.hpp:131
Definition: build_info.hpp:14
bool has_time_spec
Definition: metadata.hpp:137
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition: metadata.hpp:65
error_code_t
Definition: metadata.hpp:84
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition: metadata.hpp:143
bool has_time_spec
Has time specification?
Definition: metadata.hpp:44
#define UHD_API
Definition: config.h:62
Definition: metadata.hpp:158
size_t channel
The channel number in a mimo configuration.
Definition: metadata.hpp:160
bool more_fragments
Definition: metadata.hpp:55
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition: metadata.hpp:68
time_spec_t time_spec
When the async event occurred.
Definition: metadata.hpp:166
bool out_of_sequence
Out of sequence. The transport has either dropped a packet or received data out of order...
Definition: metadata.hpp:109