pub struct LinkFeedback {
pub loss_percent: f64,
pub rssi_dbm: f64,
pub snr_db: f64,
pub packets_received: u32,
pub fec_failed: u32,
pub bitrate_kbps: u32,
pub has_measurement: bool,
pub target_slot: u8,
}Expand description
A ground-measured sample of the drone’s downlink.
Fields§
§loss_percent: f64Percent of expected packets that did not arrive, 0.0–100.0.
rssi_dbm: f64Received signal strength, whole dBm (negative).
snr_db: f64Signal-to-noise ratio in dB.
packets_received: u32Packets decoded this interval. Zero with FLAG_HAS_MEASUREMENT clear
means the receiver heard nothing at all.
fec_failed: u32FEC blocks that could not be recovered this interval. This is the counter that distinguishes a busy-but-fine link from a lossy one, and the one the local transmit queue can never see.
bitrate_kbps: u32Delivered application bitrate in kbps, as measured at the receiver.
has_measurement: boolWhether the sender actually decoded anything this interval.
target_slot: u8The fleet slot this measurement describes.
The uplink is one transmission for the whole fleet, so every drone receives every record; this is what tells a drone whether the record is about its own link. A drone acts only on its own slot.
Implementations§
Source§impl LinkFeedback
impl LinkFeedback
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode as a v1 record.
Saturating conversions throughout: a nonsense input (a wild RSSI from a driver glitch, a loss above 100) clamps to the representable edge rather than wrapping into a value of the opposite meaning.
Sourcepub fn decode(buf: &[u8]) -> Result<Self, LinkFeedbackError>
pub fn decode(buf: &[u8]) -> Result<Self, LinkFeedbackError>
Decode a v1 record. Trailing bytes are ignored; a short record is an error.