MAVLink 2
MAVLink 2 is a backward-compatible update to the MAVLink protocol that has been designed to bring more flexibility and security to MAVLink communication. MAVLink 2 bindings have been developed for C, C++11 and Python (see Supported Languages).
此主题与 MAVLink 2 的主要新功能链接,以及如何使用。
特性
The key new features of MAVLink 2 are:
- 24 位消息 ID - 允许 16 000多万枚独特的信息定义(MAVLink 1 仅限256)
- Packet signing - Authenticate that messages were sent by trusted systems.
- Message extensions - Add new fields to existing MAVLink message definitions without breaking binary compatibility for receivers that have not updated.
- Empty-byte payload truncation - Empty (zero-filled) bytes at the end of the serialized payload must be removed before sending (All bytes were sent in MAVLink 1, regardless of content).
- Compatibility Flags/Incompatibility Flags - Allow for backwards compatible evolution of the protocol by indicating frames that must be handled in a special/non-standard way (packets with compatibility flags can still be handled in the standard way, while packets with incompatibility flags must be dropped if the flage is not supported).
TIP
The MAVLink 2 design document provides additional background information about the changes.
升级到 MAVLink 2
版本对接/谈判
MAVLink Versions explains the handshaking used to determine the supported MAVLink version of either end of the channel, and how to negotiate the version to use.
C Implementation
MAVLink 2 C库向下兼容 MAVLink 1。 Information on how to upgrade the library and work with MAVLink 1 is covered in Using C MAVLink Libraries (mavgen).