USRP Hardware Driver and USRP Manual  Version: 003.008.001-0-g2474ac32
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 
25 namespace uhd{
26 
33 
36  {
37  reset();
38  }
39 
41  void reset()
42  {
43  has_time_spec = false;
44  time_spec = time_spec_t(0.0);
45  more_fragments = false;
46  fragment_offset = 0;
47  start_of_burst = false;
48  end_of_burst = false;
49  error_code = ERROR_CODE_NONE;
50  out_of_sequence = false;
51  }
52 
55 
58 
66 
73 
76 
79 
94  enum error_code_t {
96  ERROR_CODE_NONE = 0x0,
98  ERROR_CODE_TIMEOUT = 0x1,
100  ERROR_CODE_LATE_COMMAND = 0x2,
102  ERROR_CODE_BROKEN_CHAIN = 0x4,
111  ERROR_CODE_OVERFLOW = 0x8,
113  ERROR_CODE_ALIGNMENT = 0xc,
115  ERROR_CODE_BAD_PACKET = 0xf
116  } error_code;
117 
120 
127  std::string to_pp_string(bool compact=true) const;
128 
133  std::string strerror(void) const;
134  };
135 
148 
151 
154 
157 
162  tx_metadata_t(void);
163  };
164 
170  size_t channel;
171 
174 
177 
183  EVENT_CODE_BURST_ACK = 0x1,
185  EVENT_CODE_UNDERFLOW = 0x2,
187  EVENT_CODE_SEQ_ERROR = 0x4,
189  EVENT_CODE_TIME_ERROR = 0x8,
191  EVENT_CODE_UNDERFLOW_IN_PACKET = 0x10,
193  EVENT_CODE_SEQ_ERROR_IN_BURST = 0x20,
195  EVENT_CODE_USER_PAYLOAD = 0x40
196  } event_code;
197 
201  boost::uint32_t user_payload[4];
202 
203  };
204 
205 } //namespace uhd
206 
207 #endif /* INCLUDED_UHD_TYPES_METADATA_HPP */
time_spec_t time_spec
Time of the first sample.
Definition: metadata.hpp:57
bool end_of_burst
Set end of burst to true for the last packet in the chain.
Definition: metadata.hpp:156
time_spec_t time_spec
When to send the first sample.
Definition: metadata.hpp:150
void reset()
Reset values.
Definition: metadata.hpp:41
Definition: time_spec.hpp:39
bool has_time_spec
Has time specification?
Definition: metadata.hpp:173
rx_metadata_t()
Default constructor.
Definition: metadata.hpp:35
size_t fragment_offset
Definition: metadata.hpp:72
event_code_t
Definition: metadata.hpp:181
Definition: metadata.hpp:32
Definition: metadata.hpp:141
#define UHD_API
Definition: config.hpp:79
Definition: convert.hpp:28
bool has_time_spec
Definition: metadata.hpp:147
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition: metadata.hpp:75
error_code_t
Definition: metadata.hpp:94
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition: metadata.hpp:153
bool has_time_spec
Has time specification?
Definition: metadata.hpp:54
Definition: metadata.hpp:168
size_t channel
The channel number in a mimo configuration.
Definition: metadata.hpp:170
bool more_fragments
Definition: metadata.hpp:65
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition: metadata.hpp:78
time_spec_t time_spec
When the async event occurred.
Definition: metadata.hpp:176
bool out_of_sequence
Out of sequence. The transport has either dropped a packet or received data out of order...
Definition: metadata.hpp:119