USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
metadata.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Ettus Research
3  *
4  * SPDX-License-Identifier: GPL-3.0
5  */
6 
7 #ifndef INCLUDED_UHD_TYPES_METADATA_H
8 #define INCLUDED_UHD_TYPES_METADATA_H
9 
10 #include <uhd/config.h>
11 #include <uhd/error.h>
12 
13 #include <stdbool.h>
14 #include <stdint.h>
15 #include <stdlib.h>
16 #include <time.h>
17 
18 #ifdef __cplusplus
19 #include <uhd/types/metadata.hpp>
20 #include <string>
21 
22 struct uhd_rx_metadata_t {
23  uhd::rx_metadata_t rx_metadata_cpp;
24  std::string last_error;
25 };
26 
27 struct uhd_tx_metadata_t {
28  uhd::tx_metadata_t tx_metadata_cpp;
29  std::string last_error;
30 };
31 
32 struct uhd_async_metadata_t {
33  uhd::async_metadata_t async_metadata_cpp;
34  std::string last_error;
35 };
36 
37 extern "C" {
38 #else
39 struct uhd_rx_metadata_t;
40 struct uhd_tx_metadata_t;
41 struct uhd_async_metadata_t;
42 #endif
43 
45 
51 typedef struct uhd_rx_metadata_t* uhd_rx_metadata_handle;
52 
54 
60 typedef struct uhd_tx_metadata_t* uhd_tx_metadata_handle;
61 
63 
69 typedef struct uhd_async_metadata_t* uhd_async_metadata_handle;
70 
72 
75 typedef enum {
91 
92 
95  uhd_rx_metadata_handle* handle
96 );
97 
99 
103  uhd_rx_metadata_handle* handle
104 );
105 
108  uhd_rx_metadata_handle h,
109  bool *result_out
110 );
111 
114  uhd_rx_metadata_handle h,
115  time_t *full_secs_out,
116  double *frac_secs_out
117 );
118 
121  uhd_rx_metadata_handle h,
122  bool *result_out
123 );
124 
127  uhd_rx_metadata_handle h,
128  size_t *fragment_offset_out
129 );
130 
133  uhd_rx_metadata_handle h,
134  bool *result_out
135 );
136 
139  uhd_rx_metadata_handle h,
140  bool *result_out
141 );
142 
145  uhd_rx_metadata_handle h,
146  bool *result_out
147 );
148 
150 
159  uhd_rx_metadata_handle h,
160  char* pp_string_out,
161  size_t strbuffer_len
162 );
163 
166  uhd_rx_metadata_handle h,
167  uhd_rx_metadata_error_code_t *error_code_out
168 );
169 
171 
185  uhd_rx_metadata_handle h,
186  char* strerror_out,
187  size_t strbuffer_len
188 );
189 
191 
205  uhd_rx_metadata_handle h,
206  char* error_out,
207  size_t strbuffer_len
208 );
209 
212  uhd_tx_metadata_handle* handle,
213  bool has_time_spec,
214  time_t full_secs,
215  double frac_secs,
216  bool start_of_burst,
217  bool end_of_burst
218 );
219 
220 
222 
226  uhd_tx_metadata_handle* handle
227 );
228 
231  uhd_tx_metadata_handle h,
232  bool *result_out
233 );
234 
237  uhd_tx_metadata_handle h,
238  time_t *full_secs_out,
239  double *frac_secs_out
240 );
241 
244  uhd_tx_metadata_handle h,
245  bool *result_out
246 );
247 
250  uhd_tx_metadata_handle h,
251  bool *result_out
252 );
253 
255 
264  uhd_tx_metadata_handle h,
265  char* error_out,
266  size_t strbuffer_len
267 );
268 
270 
273 typedef enum {
289 
292  uhd_async_metadata_handle* handle
293 );
294 
296 
300  uhd_async_metadata_handle* handle
301 );
302 
305  uhd_async_metadata_handle h,
306  size_t *channel_out
307 );
308 
311  uhd_async_metadata_handle h,
312  bool *result_out
313 );
314 
317  uhd_async_metadata_handle h,
318  time_t *full_secs_out,
319  double *frac_secs_out
320 );
321 
324  uhd_async_metadata_handle h,
325  uhd_async_metadata_event_code_t *event_code_out
326 );
327 
330  uhd_async_metadata_handle h,
331  uint32_t user_payload_out[4]
332 );
333 
335 
344  uhd_async_metadata_handle h,
345  char* error_out,
346  size_t strbuffer_len
347 );
348 
349 #ifdef __cplusplus
350 }
351 #endif
352 
353 #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:51
uhd_rx_metadata_error_code_t
Error condition on a receive call.
Definition: metadata.h:75
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:60
uhd_async_metadata_event_code_t
The type of event for a receive async message call.
Definition: metadata.h:273
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:283
No error code associated with this metadata.
Definition: metadata.h:77
Some kind of custom user payload.
Definition: metadata.h:287
Expected another stream command.
Definition: metadata.h:83
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:87
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:281
Definition: metadata.hpp:22
Definition: metadata.hpp:131
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:69
Packet loss within a burst.
Definition: metadata.h:285
uhd_error
UHD error codes.
Definition: error.h:20
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:85
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:79
The packet could not be parsed.
Definition: metadata.h:89
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:81
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:275
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:62
An internal send buffer has emptied.
Definition: metadata.h:277
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:279
Definition: metadata.hpp:158
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.