Namespace MavNet.Transport.Udp
Classes
- ConnectionString
Parses the URI form used throughout MavNet to describe a MAVLink endpoint:
udp://localHost:localPort?rhost=remoteHost&rport=remotePort.Defaults if not specified:
localHost=0.0.0.0,localPort=14550,rhost=127.0.0.1,rport=18570. Onlyudp://is supported today; the scheme prefix is reserved for future TCP/serial transports.
- MavlinkConnection
A MAVLink v2 UDP transport. Owns one socket, runs one receive loop, and broadcasts a GCS heartbeat at a fixed rate. Exposes inbound MAVLink as strongly-typed events keyed on the sender's MavId.
Thread model. Inbound events fire on the receive thread, synchronously. Consumers that need to marshal to a UI thread (e.g. Blazor) must do so themselves (
InvokeAsync(StateHasChanged)). Subscriber exceptions are caught — a buggy subscriber cannot break the receive loop.Sending. Use Send<T>(T) with any generated MAVLink message. The connection knows the message's MsgId, CrcExtra, and MaxPayloadLength at the call site — no runtime lookup.
Lifetime. Implements IAsyncDisposable; safe to dispose multiple times. Disposing closes the socket and stops the receive loop.
Interfaces
- IMavlinkConnection
Abstraction over a MAVLink transport that publishes inbound messages as typed events and accepts outbound messages via Send<T>(T). MavlinkConnection is the production implementation; tests substitute a fake that drives the same events synthetically.