USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-g13c32cef
UHD and USRP Manual
metadata.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Ettus Research
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_H
9 #define INCLUDED_UHD_TYPES_METADATA_H
10 
11 #include <uhd/config.h>
12 #include <uhd/error.h>
13 
14 #include <stdbool.h>
15 #include <stdint.h>
16 #include <stdlib.h>
17 #include <time.h>
18 
19 #ifdef __cplusplus
20 #include <uhd/types/metadata.hpp>
21 #include <string>
22 
23 struct uhd_rx_metadata_t {
24  uhd::rx_metadata_t rx_metadata_cpp;
25  std::string last_error;
26 };
27 
28 struct uhd_tx_metadata_t {
29  uhd::tx_metadata_t tx_metadata_cpp;
30  std::string last_error;
31 };
32 
33 struct uhd_async_metadata_t {
34  uhd::async_metadata_t async_metadata_cpp;
35  std::string last_error;
36 };
37 
38 extern "C" {
39 #else
40 struct uhd_rx_metadata_t;
41 struct uhd_tx_metadata_t;
42 struct uhd_async_metadata_t;
43 #endif
44 
46 
52 typedef struct uhd_rx_metadata_t* uhd_rx_metadata_handle;
53 
55 
61 typedef struct uhd_tx_metadata_t* uhd_tx_metadata_handle;
62 
64 
70 typedef struct uhd_async_metadata_t* uhd_async_metadata_handle;
71 
73 
76 typedef enum {
92 
93 
96  uhd_rx_metadata_handle* handle
97 );
98 
100 
104  uhd_rx_metadata_handle* handle
105 );
106 
109  uhd_rx_metadata_handle h,
110  bool *result_out
111 );
112 
115  uhd_rx_metadata_handle h,
116  time_t *full_secs_out,
117  double *frac_secs_out
118 );
119 
122  uhd_rx_metadata_handle h,
123  bool *result_out
124 );
125 
128  uhd_rx_metadata_handle h,
129  size_t *fragment_offset_out
130 );
131 
134  uhd_rx_metadata_handle h,
135  bool *result_out
136 );
137 
140  uhd_rx_metadata_handle h,
141  bool *result_out
142 );
143 
146  uhd_rx_metadata_handle h,
147  bool *result_out
148 );
149 
151 
160  uhd_rx_metadata_handle h,
161  char* pp_string_out,
162  size_t strbuffer_len
163 );
164 
167  uhd_rx_metadata_handle h,
168  uhd_rx_metadata_error_code_t *error_code_out
169 );
170 
172 
186  uhd_rx_metadata_handle h,
187  char* strerror_out,
188  size_t strbuffer_len
189 );
190 
192 
206  uhd_rx_metadata_handle h,
207  char* error_out,
208  size_t strbuffer_len
209 );
210 
213  uhd_tx_metadata_handle* handle,
214  bool has_time_spec,
215  time_t full_secs,
216  double frac_secs,
217  bool start_of_burst,
218  bool end_of_burst
219 );
220 
221 
223 
227  uhd_tx_metadata_handle* handle
228 );
229 
232  uhd_tx_metadata_handle h,
233  bool *result_out
234 );
235 
238  uhd_tx_metadata_handle h,
239  time_t *full_secs_out,
240  double *frac_secs_out
241 );
242 
245  uhd_tx_metadata_handle h,
246  bool *result_out
247 );
248 
251  uhd_tx_metadata_handle h,
252  bool *result_out
253 );
254 
256 
265  uhd_tx_metadata_handle h,
266  char* error_out,
267  size_t strbuffer_len
268 );
269 
271 
274 typedef enum {
290 
293  uhd_async_metadata_handle* handle
294 );
295 
297 
301  uhd_async_metadata_handle* handle
302 );
303 
306  uhd_async_metadata_handle h,
307  size_t *channel_out
308 );
309 
312  uhd_async_metadata_handle h,
313  bool *result_out
314 );
315 
318  uhd_async_metadata_handle h,
319  time_t *full_secs_out,
320  double *frac_secs_out
321 );
322 
325  uhd_async_metadata_handle h,
326  uhd_async_metadata_event_code_t *event_code_out
327 );
328 
331  uhd_async_metadata_handle h,
332  uint32_t user_payload_out[4]
333 );
334 
336 
345  uhd_async_metadata_handle h,
346  char* error_out,
347  size_t strbuffer_len
348 );
349 
350 #ifdef __cplusplus
351 }
352 #endif
353 
354 #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:52
uhd_rx_metadata_error_code_t
Error condition on a receive call.
Definition: metadata.h:76
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:61
uhd_async_metadata_event_code_t
The type of event for a receive async message call.
Definition: metadata.h:274
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:284
No error code associated with this metadata.
Definition: metadata.h:78
Some kind of custom user payload.
Definition: metadata.h:288
Expected another stream command.
Definition: metadata.h:84
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:88
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:282
Definition: metadata.hpp:23
Definition: metadata.hpp:132
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:70
Packet loss within a burst.
Definition: metadata.h:286
uhd_error
UHD error codes.
Definition: error.h:21
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:86
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:80
The packet could not be parsed.
Definition: metadata.h:90
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:82
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:276
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:63
An internal send buffer has emptied.
Definition: metadata.h:278
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:280
Definition: metadata.hpp:159
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.