USRP Hardware Driver and USRP Manual  Version: 003.009.004-0-g2b5a88bb
UHD and USRP Manual
metadata.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2012,2014 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_TYPES_METADATA_HPP
19 #define INCLUDED_UHD_TYPES_METADATA_HPP
20 
21 #include <uhd/config.hpp>
22 #include <uhd/types/time_spec.hpp>
23 #include <boost/cstdint.hpp>
24 #include <string>
25 
26 namespace uhd{
27 
34 
37  {
38  reset();
39  }
40 
42  void reset()
43  {
44  has_time_spec = false;
45  time_spec = time_spec_t(0.0);
46  more_fragments = false;
47  fragment_offset = 0;
48  start_of_burst = false;
49  end_of_burst = false;
50  error_code = ERROR_CODE_NONE;
51  out_of_sequence = false;
52  }
53 
56 
59 
67 
74 
77 
80 
95  enum error_code_t {
97  ERROR_CODE_NONE = 0x0,
99  ERROR_CODE_TIMEOUT = 0x1,
101  ERROR_CODE_LATE_COMMAND = 0x2,
103  ERROR_CODE_BROKEN_CHAIN = 0x4,
112  ERROR_CODE_OVERFLOW = 0x8,
114  ERROR_CODE_ALIGNMENT = 0xc,
116  ERROR_CODE_BAD_PACKET = 0xf
117  } error_code;
118 
121 
128  std::string to_pp_string(bool compact=true) const;
129 
134  std::string strerror(void) const;
135  };
136 
149 
152 
155 
158 
163  tx_metadata_t(void);
164  };
165 
171  size_t channel;
172 
175 
178 
184  EVENT_CODE_BURST_ACK = 0x1,
186  EVENT_CODE_UNDERFLOW = 0x2,
188  EVENT_CODE_SEQ_ERROR = 0x4,
190  EVENT_CODE_TIME_ERROR = 0x8,
192  EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
194  EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
196  EVENT_CODE_USER_PAYLOAD = 0x40
197  } event_code;
198 
202  boost::uint32_t user_payload[4];
203 
204  };
205 
206 } //namespace uhd
207 
208 #endif /* INCLUDED_UHD_TYPES_METADATA_HPP */
time_spec_t time_spec
Time of the first sample.
Definition: metadata.hpp:58
bool end_of_burst
Set end of burst to true for the last packet in the chain.
Definition: metadata.hpp:157
time_spec_t time_spec
When to send the first sample.
Definition: metadata.hpp:151
void reset()
Reset values.
Definition: metadata.hpp:42
Definition: time_spec.hpp:39
bool has_time_spec
Has time specification?
Definition: metadata.hpp:174
rx_metadata_t()
Default constructor.
Definition: metadata.hpp:36
size_t fragment_offset
Definition: metadata.hpp:73
event_code_t
Definition: metadata.hpp:182
Definition: metadata.hpp:33
Definition: metadata.hpp:142
Definition: convert.hpp:28
bool has_time_spec
Definition: metadata.hpp:148
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition: metadata.hpp:76
error_code_t
Definition: metadata.hpp:95
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition: metadata.hpp:154
bool has_time_spec
Has time specification?
Definition: metadata.hpp:55
#define UHD_API
Definition: config.h:66
Definition: metadata.hpp:169
size_t channel
The channel number in a mimo configuration.
Definition: metadata.hpp:171
bool more_fragments
Definition: metadata.hpp:66
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition: metadata.hpp:79
time_spec_t time_spec
When the async event occurred.
Definition: metadata.hpp:177
bool out_of_sequence
Out of sequence. The transport has either dropped a packet or received data out of order...
Definition: metadata.hpp:120