Expand description
The MAVLink broadcast socket wire (/run/ados/mavlink.sock, contract
mavlink.socket).
Every record in both directions is a 4-byte big-endian length followed by
the body (crate::frame). Router → client bodies (version 2) start with
an 8-byte little-endian rx_mono_ns, the host CLOCK_MONOTONIC time the
router read that frame off the flight-controller transport (or received it
from any other source), followed by one raw MAVLink frame. Client → router
bodies are one raw MAVLink frame with no header.
Ungated (no MAVLink dialect dependency), so a consumer that only moves raw frames reads the socket without building the codec.
Structs§
- Socket
Frame - One frame as a client receives it.
Constants§
- MAVLINK_
SOCKET_ HEADER_ LEN - Length of the
rx_mono_nsheader that leads every router → client body. - MAVLINK_
SOCKET_ MAX_ BODY - Largest router → client body: the frame cap plus the header.
- MAVLINK_
SOCKET_ VERSION - Wire version of the router → client record; mirrors the
mavlink.socketrow incontracts.toml.
Functions§
- decode_
body - Split a router → client body into
(rx_mono_ns, frame).Nonewhen the body is too short to carry the header. - encode_
body - The router → client body: header then frame (no length prefix).
- encode_
record - The complete router → client record: length prefix, header, frame.
- read_
frame - Read one router → client record.
Ok(None)on clean EOF; a body shorter than the header isInvalidData.