xwr.capture.types
¶
DCA1000EVM capture card API data types.
xwr.capture.types.DataPacket
dataclass
¶
Data packet protocol.
Source code in src/xwr/capture/types.py
from_bytes
classmethod
¶
from_bytes(packet: bytes) -> DataPacket
Read packet.
Packet format (Sec. 5.21):
<
: assumed to be little endian.L
: 4-byte sequence number (packet number).Q
: 6-byte byte count index; appended with x0000 to make a uint64.
Source code in src/xwr/capture/types.py
xwr.capture.types.RadarFrame
dataclass
¶
Radar frame, in IIQQ format (Fig 111).
Warning
Assuming the radar/capture card are configured for 16-bit capture and
SampleSwap.MSB_LSB_IQ
order,
the output data use an interleaved Complex32 format consisting of real
(I: in-phase) and complex (Q: quadrature) i16
parts.
Since the output is little-endian, MSB_LSB_IQ
indicates that I
is in the MSB, i.e., comes last, and the Q
in the LSB comes first.
For example, if there are two LVDS lanes (e.g., AWR1843, AWR2544), each lane takes the following structure:
These lanes are then interleaved by the capture card:
Code snippet: interpreting the data
Attributes:
Name | Type | Description |
---|---|---|
timestamp |
float
|
system timestamp of the first packet received for this frame. |
data |
bytes | bytearray
|
radar frame data. |
complete |
bool
|
whether the frame is "complete"; if |
Source code in src/xwr/capture/types.py
xwr.capture.types.Request
dataclass
¶
Command request protocol.
Source code in src/xwr/capture/types.py
to_bytes
¶
to_bytes() -> bytes
Form into a single packet.
Data format: <HHH{}sH
.
<
: assumed to be little endian. Not documented anywhere, but implied since mmWave API uses native linux/x86 structs, which are little endian.H
: Header is always0xA55A
(Table 131).H
: Command code (Table 121).H
: Data size; must be between 0 and 504 (Section 5.11).{}s
: Payload; can be empty.H
: Footer is always0xEEAA
(Table 131).
Source code in src/xwr/capture/types.py
xwr.capture.types.Response
dataclass
¶
Command response protocol.
Source code in src/xwr/capture/types.py
from_bytes
classmethod
¶
Read packet.
Source code in src/xwr/capture/types.py
xwr.capture.types.ipv4_to_int
¶
Parse ipv4 string as a tuple of 4 integers.
xwr.capture.types.mac_to_int
¶
Parse MAC address string as a tuple of 6 integers.