This page documents the communication system within Mission Planner, which is responsible for all interactions between the ground control station and connected vehicles. The system provides a multi-layered abstraction for MAVLink telemetry, command/control, parameter management, and high-level services like the HTTP telemetry server.
The communication system abstracts the physical transport layer (Serial, UDP, TCP, BLE) from the logical MAVLink protocol. It manages vehicle discovery, state tracking, and specialized sub-protocols like MavFTP.
Sources: ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs27-67 ExtLibs/Comms/CommsSerialPort.cs14-25 Utilities/httpserver.cs18-40 ExtLibs/ArduPilot/Mavlink/MAVState.cs53-114
All communication physical layers implement the ICommsSerial interface, providing a unified BaseStream for the MAVLink parser. This allows the core application to interact with a radio, a network socket, or a simulation link identically.
| Class | Transport Type | Key Implementation Detail |
|---|---|---|
SerialPort | Physical Serial/USB | Wraps ICommsSerial via DefaultType (usually WinSerialPort) with custom buffer handling ExtLibs/Comms/CommsSerialPort.cs14-35 |
UdpSerial | UDP (Server/Listen) | Listens on a local port (default 14550) and locks onto the first sender's endpoint ExtLibs/Comms/CommsUdpSerial.cs39-46 |
UdpSerialConnect | UDP (Client) | Connects to a specific remote host/port; supports Multicast groups (224.0.0.0 - 239.255.255.255) ExtLibs/Comms/CommsUDPSerialConnect.cs74-95 |
CommsTCPSerial | TCP (Client) | Implements a TCP client for networked telemetry radios or SITL. |
CommsNTRIP | NTRIP (GNSS) | Specialized transport for RTK correction data via HTTP/NTRIP protocols ExtLibs/Comms/CommsNTRIP.cs137-155 |
Sources: ExtLibs/Comms/CommsSerialPort.cs14-63 ExtLibs/Comms/CommsUdpSerial.cs16-100 ExtLibs/Comms/CommsUDPSerialConnect.cs16-121 ExtLibs/Comms/CommsNTRIP.cs17-135
The engine is centered around MAVLinkInterface, which handles the lifecycle of a connection and dispatches data to vehicle-specific containers.
The interface reads raw bytes from the BaseStream and processes them into MAVLinkMessage objects.
MAVLinkInterface monitors the BaseStream for incoming bytes ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs32-67OnPacketReceived event ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs69-86MAVState objects (one per unique System ID) process these packets to update the CurrentState telemetry model ExtLibs/ArduPilot/Mavlink/MAVState.cs131-135CurrentState extracts fields from messages like VFR_HUD or ATTITUDE to update UI-bound properties like airspeed or yaw ExtLibs/ArduPilot/CurrentState.cs52-98Mission Planner supports multiple vehicles simultaneously. Each vehicle is represented by a MAVState instance.
sysid is seen, a new MAVState is created ExtLibs/ArduPilot/Mavlink/MAVState.cs53-63MAVState maintains its own MAVLinkParamList and CurrentState ExtLibs/ArduPilot/Mavlink/MAVState.cs179-185Sources: ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs27-105 ExtLibs/ArduPilot/Mavlink/MAVState.cs23-114 ExtLibs/ArduPilot/CurrentState.cs17-154
The MAVFtp class implements a file system abstraction over MAVLink, allowing Mission Planner to read/write files (like logs or Lua scripts) on the vehicle's SD card.
mavlink_file_transfer_protocol_t message type ExtLibs/ArduPilot/Mavlink/MAVFtp.cs39-40kCmdListDirectory), reading, and writing in small chunks (typically 80 bytes) to maintain link stability ExtLibs/ArduPilot/Mavlink/MAVFtp.cs23-33MavFTPUI control provides a tree-view interface for navigating the vehicle's remote file system Controls/MavFTPUI.cs69-92Sources: ExtLibs/ArduPilot/Mavlink/MAVFtp.cs20-55 Controls/MavFTPUI.cs28-70
The httpserver class provides a mini-web server (running on port 56781) that exposes Mission Planner's data to external applications and web browsers.
/websocket/server endpoint for real-time telemetry streaming to web-based HUDs Utilities/httpserver.cs180-197Sources: Utilities/httpserver.cs58-120 Utilities/httpserver.cs180-210
Parameters are managed via MAVLinkParamList, which acts as a dictionary of MAVLinkParam objects.
MAVLinkParam handles the conversion between raw MAVLink bytes (e.g., MAV_PARAM_TYPE.REAL32) and double-precision values used in the UI ExtLibs/Mavlink/MAVLinkParam.cs109-136ParamCachePath ExtLibs/ArduPilot/Mavlink/MAVState.cs27-47MAVState automatically saves the parameter list to disk whenever a property changes, using a 2-second debounced timer ExtLibs/ArduPilot/Mavlink/MAVState.cs65-94Sources: ExtLibs/Mavlink/MAVLinkParam.cs6-50 ExtLibs/ArduPilot/Mavlink/MAVState.cs63-95