USRP Hardware Driver and USRP Manual
Version: 3.15.0.0-MacPorts-Release
UHD and USRP Manual
Loading...
Searching...
No Matches
metadata.hpp
Go to the documentation of this file.
1
//
2
// Copyright 2010-2012,2014 Ettus Research LLC
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_HPP
9
#define INCLUDED_UHD_TYPES_METADATA_HPP
10
11
#include <
uhd/config.hpp
>
12
#include <
uhd/types/time_spec.hpp
>
13
#include <stdint.h>
14
#include <string>
15
16
namespace
uhd
{
17
23
struct
UHD_API
rx_metadata_t
24
{
26
rx_metadata_t
()
27
{
28
reset
();
29
}
30
32
void
reset
()
33
{
34
has_time_spec
=
false
;
35
time_spec
=
time_spec_t
(0.0);
36
more_fragments
=
false
;
37
fragment_offset
= 0;
38
start_of_burst
=
false
;
39
end_of_burst
=
false
;
40
error_code
=
ERROR_CODE_NONE
;
41
out_of_sequence
=
false
;
42
}
43
45
bool
has_time_spec
;
46
48
time_spec_t
time_spec
;
49
57
bool
more_fragments
;
58
64
size_t
fragment_offset
;
65
67
bool
start_of_burst
;
68
70
bool
end_of_burst
;
71
86
enum
error_code_t
{
88
ERROR_CODE_NONE
= 0x0,
90
ERROR_CODE_TIMEOUT
= 0x1,
92
ERROR_CODE_LATE_COMMAND
= 0x2,
94
ERROR_CODE_BROKEN_CHAIN
= 0x4,
104
ERROR_CODE_OVERFLOW
= 0x8,
106
ERROR_CODE_ALIGNMENT
= 0xc,
108
ERROR_CODE_BAD_PACKET
= 0xf
109
} error_code;
110
113
bool
out_of_sequence
;
114
121
std::string
to_pp_string
(
bool
compact =
true
)
const
;
122
127
std::string
strerror
(
void
)
const
;
128
};
129
135
struct
UHD_API
tx_metadata_t
136
{
142
bool
has_time_spec
;
143
145
time_spec_t
time_spec
;
146
148
bool
start_of_burst
;
149
151
bool
end_of_burst
;
152
157
tx_metadata_t
(
void
);
158
};
159
163
struct
UHD_API
async_metadata_t
164
{
166
size_t
channel
;
167
169
bool
has_time_spec
;
170
172
time_spec_t
time_spec
;
173
177
enum
event_code_t
{
179
EVENT_CODE_BURST_ACK
= 0x1,
181
EVENT_CODE_UNDERFLOW
= 0x2,
183
EVENT_CODE_SEQ_ERROR
= 0x4,
185
EVENT_CODE_TIME_ERROR
= 0x8,
187
EVENT_CODE_UNDERFLOW_IN_PACKET
= 0x10,
189
EVENT_CODE_SEQ_ERROR_IN_BURST
= 0x20,
191
EVENT_CODE_USER_PAYLOAD
= 0x40
192
} event_code;
193
197
uint32_t
user_payload
[4];
198
};
199
200
}
// namespace uhd
201
202
#endif
/* INCLUDED_UHD_TYPES_METADATA_HPP */
uhd::time_spec_t
Definition
time_spec.hpp:32
UHD_API
#define UHD_API
Definition
config.h:68
config.hpp
uhd
Definition
build_info.hpp:13
uhd::async_metadata_t
Definition
metadata.hpp:164
uhd::async_metadata_t::event_code_t
event_code_t
Definition
metadata.hpp:177
uhd::async_metadata_t::EVENT_CODE_BURST_ACK
@ EVENT_CODE_BURST_ACK
A burst was successfully transmitted.
Definition
metadata.hpp:179
uhd::async_metadata_t::EVENT_CODE_UNDERFLOW_IN_PACKET
@ EVENT_CODE_UNDERFLOW_IN_PACKET
Underflow occurred inside a packet.
Definition
metadata.hpp:187
uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR
@ EVENT_CODE_SEQ_ERROR
Packet loss between host and device.
Definition
metadata.hpp:183
uhd::async_metadata_t::EVENT_CODE_UNDERFLOW
@ EVENT_CODE_UNDERFLOW
An internal send buffer has emptied.
Definition
metadata.hpp:181
uhd::async_metadata_t::EVENT_CODE_TIME_ERROR
@ EVENT_CODE_TIME_ERROR
Packet had time that was late.
Definition
metadata.hpp:185
uhd::async_metadata_t::EVENT_CODE_USER_PAYLOAD
@ EVENT_CODE_USER_PAYLOAD
Some kind of custom user payload.
Definition
metadata.hpp:191
uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR_IN_BURST
@ EVENT_CODE_SEQ_ERROR_IN_BURST
Packet loss within a burst.
Definition
metadata.hpp:189
uhd::async_metadata_t::has_time_spec
bool has_time_spec
Has time specification?
Definition
metadata.hpp:169
uhd::async_metadata_t::user_payload
uint32_t user_payload[4]
Definition
metadata.hpp:197
uhd::async_metadata_t::channel
size_t channel
The channel number in a mimo configuration.
Definition
metadata.hpp:166
uhd::async_metadata_t::time_spec
time_spec_t time_spec
When the async event occurred.
Definition
metadata.hpp:172
uhd::rx_metadata_t::rx_metadata_t
rx_metadata_t()
Default constructor.
Definition
metadata.hpp:26
uhd::rx_metadata_t::more_fragments
bool more_fragments
Definition
metadata.hpp:57
uhd::rx_metadata_t::time_spec
time_spec_t time_spec
Time of the first sample.
Definition
metadata.hpp:48
uhd::rx_metadata_t::out_of_sequence
bool out_of_sequence
Definition
metadata.hpp:113
uhd::rx_metadata_t::strerror
std::string strerror(void) const
uhd::rx_metadata_t::end_of_burst
bool end_of_burst
End of burst will be true for the last packet in the chain.
Definition
metadata.hpp:70
uhd::rx_metadata_t::has_time_spec
bool has_time_spec
Has time specification?
Definition
metadata.hpp:45
uhd::rx_metadata_t::to_pp_string
std::string to_pp_string(bool compact=true) const
uhd::rx_metadata_t::reset
void reset()
Reset values.
Definition
metadata.hpp:32
uhd::rx_metadata_t::start_of_burst
bool start_of_burst
Start of burst will be true for the first packet in the chain.
Definition
metadata.hpp:67
uhd::rx_metadata_t::error_code
enum uhd::rx_metadata_t::error_code_t error_code
uhd::rx_metadata_t::error_code_t
error_code_t
Definition
metadata.hpp:86
uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND
@ ERROR_CODE_LATE_COMMAND
A stream command was issued in the past.
Definition
metadata.hpp:92
uhd::rx_metadata_t::ERROR_CODE_BROKEN_CHAIN
@ ERROR_CODE_BROKEN_CHAIN
Expected another stream command.
Definition
metadata.hpp:94
uhd::rx_metadata_t::ERROR_CODE_ALIGNMENT
@ ERROR_CODE_ALIGNMENT
Multi-channel alignment failed.
Definition
metadata.hpp:106
uhd::rx_metadata_t::ERROR_CODE_NONE
@ ERROR_CODE_NONE
No error associated with this metadata.
Definition
metadata.hpp:88
uhd::rx_metadata_t::ERROR_CODE_BAD_PACKET
@ ERROR_CODE_BAD_PACKET
The packet could not be parsed.
Definition
metadata.hpp:108
uhd::rx_metadata_t::ERROR_CODE_TIMEOUT
@ ERROR_CODE_TIMEOUT
No packet received, implementation timed-out.
Definition
metadata.hpp:90
uhd::rx_metadata_t::ERROR_CODE_OVERFLOW
@ ERROR_CODE_OVERFLOW
Definition
metadata.hpp:104
uhd::rx_metadata_t::fragment_offset
size_t fragment_offset
Definition
metadata.hpp:64
uhd::tx_metadata_t::end_of_burst
bool end_of_burst
Set end of burst to true for the last packet in the chain.
Definition
metadata.hpp:151
uhd::tx_metadata_t::tx_metadata_t
tx_metadata_t(void)
uhd::tx_metadata_t::start_of_burst
bool start_of_burst
Set start of burst to true for the first packet in the chain.
Definition
metadata.hpp:148
uhd::tx_metadata_t::time_spec
time_spec_t time_spec
When to send the first sample.
Definition
metadata.hpp:145
uhd::tx_metadata_t::has_time_spec
bool has_time_spec
Definition
metadata.hpp:142
time_spec.hpp
include
uhd
types
metadata.hpp
Generated by
1.14.0