USRP Hardware Driver and USRP Manual  Version: 003.009.004-0-g2b5a88bb
UHD and USRP Manual
metadata.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Ettus Research
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_H
19 #define INCLUDED_UHD_TYPES_METADATA_H
20 
21 #include <uhd/config.h>
22 #include <uhd/error.h>
23 
24 #include <stdbool.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 #include <time.h>
28 
29 #ifdef __cplusplus
30 #include <uhd/types/metadata.hpp>
31 #include <string>
32 
33 struct uhd_rx_metadata_t {
34  uhd::rx_metadata_t rx_metadata_cpp;
35  std::string last_error;
36 };
37 
38 struct uhd_tx_metadata_t {
39  uhd::tx_metadata_t tx_metadata_cpp;
40  std::string last_error;
41 };
42 
43 struct uhd_async_metadata_t {
44  uhd::async_metadata_t async_metadata_cpp;
45  std::string last_error;
46 };
47 
48 extern "C" {
49 #else
50 struct uhd_rx_metadata_t;
51 struct uhd_tx_metadata_t;
52 struct uhd_async_metadata_t;
53 #endif
54 
56 
62 typedef struct uhd_rx_metadata_t* uhd_rx_metadata_handle;
63 
65 
71 typedef struct uhd_tx_metadata_t* uhd_tx_metadata_handle;
72 
74 
80 typedef struct uhd_async_metadata_t* uhd_async_metadata_handle;
81 
83 
86 typedef enum {
102 
103 
106  uhd_rx_metadata_handle* handle
107 );
108 
110 
114  uhd_rx_metadata_handle* handle
115 );
116 
119  uhd_rx_metadata_handle h,
120  bool *result_out
121 );
122 
125  uhd_rx_metadata_handle h,
126  time_t *full_secs_out,
127  double *frac_secs_out
128 );
129 
132  uhd_rx_metadata_handle h,
133  bool *result_out
134 );
135 
138  uhd_rx_metadata_handle h,
139  size_t *fragment_offset_out
140 );
141 
144  uhd_rx_metadata_handle h,
145  bool *result_out
146 );
147 
150  uhd_rx_metadata_handle h,
151  bool *result_out
152 );
153 
156  uhd_rx_metadata_handle h,
157  bool *result_out
158 );
159 
161 
170  uhd_rx_metadata_handle h,
171  char* pp_string_out,
172  size_t strbuffer_len
173 );
174 
177  uhd_rx_metadata_handle h,
178  uhd_rx_metadata_error_code_t *error_code_out
179 );
180 
182 
196  uhd_rx_metadata_handle h,
197  char* strerror_out,
198  size_t strbuffer_len
199 );
200 
202 
216  uhd_rx_metadata_handle h,
217  char* error_out,
218  size_t strbuffer_len
219 );
220 
223  uhd_tx_metadata_handle* handle,
224  bool has_time_spec,
225  time_t full_secs,
226  double frac_secs,
227  bool start_of_burst,
228  bool end_of_burst
229 );
230 
231 
233 
237  uhd_tx_metadata_handle* handle
238 );
239 
242  uhd_tx_metadata_handle h,
243  bool *result_out
244 );
245 
248  uhd_tx_metadata_handle h,
249  time_t *full_secs_out,
250  double *frac_secs_out
251 );
252 
255  uhd_tx_metadata_handle h,
256  bool *result_out
257 );
258 
261  uhd_tx_metadata_handle h,
262  bool *result_out
263 );
264 
266 
275  uhd_tx_metadata_handle h,
276  char* error_out,
277  size_t strbuffer_len
278 );
279 
281 
284 typedef enum {
300 
303  uhd_async_metadata_handle* handle
304 );
305 
307 
311  uhd_async_metadata_handle* handle
312 );
313 
316  uhd_async_metadata_handle h,
317  size_t *channel_out
318 );
319 
322  uhd_async_metadata_handle h,
323  bool *result_out
324 );
325 
328  uhd_async_metadata_handle h,
329  time_t *full_secs_out,
330  double *frac_secs_out
331 );
332 
335  uhd_async_metadata_handle h,
336  uhd_async_metadata_event_code_t *event_code_out
337 );
338 
341  uhd_async_metadata_handle h,
342  uint32_t user_payload_out[4]
343 );
344 
346 
355  uhd_async_metadata_handle h,
356  char* error_out,
357  size_t strbuffer_len
358 );
359 
360 #ifdef __cplusplus
361 }
362 #endif
363 
364 #endif /* INCLUDED_UHD_TYPES_METADATA_H */
UHD_API uhd_error uhd_rx_metadata_fragment_offset(uhd_rx_metadata_handle h, size_t *fragment_offset_out)
Fragmentation offset.
struct uhd_rx_metadata_t * uhd_rx_metadata_handle
RX metadata interface for describing sent IF data.
Definition: metadata.h:62
uhd_rx_metadata_error_code_t
Error condition on a receive call.
Definition: metadata.h:86
UHD_API uhd_error uhd_async_metadata_user_payload(uhd_async_metadata_handle h, uint32_t user_payload_out[4])
Get payload from custom FPGA fabric.
UHD_API uhd_error uhd_tx_metadata_free(uhd_tx_metadata_handle *handle)
Free an TX metadata handle.
UHD_API uhd_error uhd_async_metadata_last_error(uhd_async_metadata_handle h, char *error_out, size_t strbuffer_len)
Get the last error logged by the async metadata object.
struct uhd_tx_metadata_t * uhd_tx_metadata_handle
TX metadata interface for describing received IF data.
Definition: metadata.h:71
uhd_async_metadata_event_code_t
The type of event for a receive async message call.
Definition: metadata.h:284
UHD_API uhd_error uhd_rx_metadata_start_of_burst(uhd_rx_metadata_handle h, bool *result_out)
Start of burst?
Underflow occurred inside a packet.
Definition: metadata.h:294
No error code associated with this metadata.
Definition: metadata.h:88
Some kind of custom user payload.
Definition: metadata.h:298
Expected another stream command.
Definition: metadata.h:94
UHD_API uhd_error uhd_rx_metadata_strerror(uhd_rx_metadata_handle h, char *strerror_out, size_t strbuffer_len)
Get a string representation of the last error state of the RX metadata object.
Multi-channel alignment failed.
Definition: metadata.h:98
UHD_API uhd_error uhd_rx_metadata_error_code(uhd_rx_metadata_handle h, uhd_rx_metadata_error_code_t *error_code_out)
Get the last error state of the RX metadata object.
UHD_API uhd_error uhd_rx_metadata_time_spec(uhd_rx_metadata_handle h, time_t *full_secs_out, double *frac_secs_out)
Time of first sample.
UHD_API uhd_error uhd_rx_metadata_make(uhd_rx_metadata_handle *handle)
Create a new RX metadata handle.
UHD_API uhd_error uhd_rx_metadata_more_fragments(uhd_rx_metadata_handle h, bool *result_out)
Fragmentation flag.
Packet had time that was late.
Definition: metadata.h:292
Definition: metadata.hpp:33
Definition: metadata.hpp:142
UHD_API uhd_error uhd_rx_metadata_last_error(uhd_rx_metadata_handle h, char *error_out, size_t strbuffer_len)
Get the last error logged by the RX metadata object.
struct uhd_async_metadata_t * uhd_async_metadata_handle
Interface for describing transmit-related events.
Definition: metadata.h:80
Packet loss within a burst.
Definition: metadata.h:296
uhd_error
UHD error codes.
Definition: error.h:31
UHD_API uhd_error uhd_async_metadata_channel(uhd_async_metadata_handle h, size_t *channel_out)
Channel number in a MIMO configuration.
UHD_API uhd_error uhd_tx_metadata_has_time_spec(uhd_tx_metadata_handle h, bool *result_out)
Has time specification?
UHD_API uhd_error uhd_rx_metadata_has_time_spec(uhd_rx_metadata_handle h, bool *result_out)
Has time specification?
Overflow or sequence error.
Definition: metadata.h:96
UHD_API uhd_error uhd_async_metadata_event_code(uhd_async_metadata_handle h, uhd_async_metadata_event_code_t *event_code_out)
Get last event code.
UHD_API uhd_error uhd_tx_metadata_make(uhd_tx_metadata_handle *handle, bool has_time_spec, time_t full_secs, double frac_secs, bool start_of_burst, bool end_of_burst)
Create a new TX metadata handle.
No packet received, implementation timed out.
Definition: metadata.h:90
The packet could not be parsed.
Definition: metadata.h:100
UHD_API uhd_error uhd_rx_metadata_end_of_burst(uhd_rx_metadata_handle h, bool *result_out)
End of burst?
A stream command was issued in the past.
Definition: metadata.h:92
UHD_API uhd_error uhd_tx_metadata_end_of_burst(uhd_tx_metadata_handle h, bool *result_out)
End of burst?
A burst was successfully transmitted.
Definition: metadata.h:286
UHD_API uhd_error uhd_async_metadata_make(uhd_async_metadata_handle *handle)
Create a new async metadata handle.
#define UHD_API
Definition: config.h:66
An internal send buffer has emptied.
Definition: metadata.h:288
UHD_API uhd_error uhd_tx_metadata_start_of_burst(uhd_tx_metadata_handle h, bool *result_out)
Start of burst?
Packet loss error between host and device.
Definition: metadata.h:290
Definition: metadata.hpp:169
UHD_API uhd_error uhd_tx_metadata_last_error(uhd_tx_metadata_handle h, char *error_out, size_t strbuffer_len)
Get the last error logged by the TX metadata object.
UHD_API uhd_error uhd_rx_metadata_out_of_sequence(uhd_rx_metadata_handle h, bool *result_out)
Result out of sequence?
UHD_API uhd_error uhd_rx_metadata_to_pp_string(uhd_rx_metadata_handle h, char *pp_string_out, size_t strbuffer_len)
Return a pretty-print representation of this metadata.
UHD_API uhd_error uhd_tx_metadata_time_spec(uhd_tx_metadata_handle h, time_t *full_secs_out, double *frac_secs_out)
Get time specification.
UHD_API uhd_error uhd_async_metadata_time_spec(uhd_async_metadata_handle h, time_t *full_secs_out, double *frac_secs_out)
Get time specification.
UHD_API uhd_error uhd_async_metadata_free(uhd_async_metadata_handle *handle)
Free an async metadata handle.
UHD_API uhd_error uhd_async_metadata_has_time_spec(uhd_async_metadata_handle h, bool *result_out)
Has time specification?
UHD_API uhd_error uhd_rx_metadata_free(uhd_rx_metadata_handle *handle)
Free an RX metadata handle.