You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/guide/mavlink_version.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,6 @@ Legacy code may be present in generator and test code.
19
19
A library's MAVLink support can be determined in a number of ways:
20
20
21
21
-[AUTOPILOT_VERSION](../messages/common.md#AUTOPILOT_VERSION)`.capabilities` can be checked against the [MAV_PROTOCOL_CAPABILITY_MAVLINK2](../messages/common.md#MAV_PROTOCOL_CAPABILITY_MAVLINK2) flag to verify MAVLink 2 support.
22
-
-[PROTOCOL_VERSION](../messages/common.md#PROTOCOL_VERSION).`version` contains the MAVLink version number multiplied by 100: v1.0 is 100, <!-- v2.0 is 200, --> v2.3 is 203 etc.
23
-
-[HEARTBEAT](../messages/common.md#HEARTBEAT)`.mavlink_version` field contains the minor version number.
24
-
This is the `<version>` field defined in the [Message Definitions](../messages/index.md) (`version` in [common.xml](../messages/common.md) for dialects that depend on the common message set).
25
22
- The major version can be determined from the packet start marker byte:
26
23
27
24
- MAVLink 1: `0xFE`
@@ -32,24 +29,41 @@ A library's MAVLink support can be determined in a number of ways:
32
29
so no messages will even be detected (see [Serialization](../guide/serialization.md)).
33
30
:::
34
31
32
+
-[HEARTBEAT](../messages/common.md#HEARTBEAT)`.mavlink_version` field contains the minor version number.
33
+
This is the `<version>` field defined in the [Message Definitions](../messages/index.md) (`version` in [common.xml](../messages/common.md) for dialects that depend on the common message set).
34
+
-[PROTOCOL_VERSION](../messages/common.md#PROTOCOL_VERSION).`version` contains the MAVLink version number multiplied by 100: v1.0 is 100, <!-- v2.0 is 200, --> v2.3 is 203 etc.
35
+
Note that the message allows for additional version information, but is not supported on all flight stacks.
36
+
35
37
::: tip
36
38
While messages do not contain version information, an extra CRC is used to ensure that a library will only process compatible messages (see [Serialization > CRC_EXTRA](../guide/serialization.md)).
37
39
:::
38
40
39
41
## Version Handshaking {#version_handshaking}
40
42
41
43
Support for _MAVLink 2_ is indicated in the [AUTOPILOT_VERSION](../messages/common.md#AUTOPILOT_VERSION) message by the [MAV_PROTOCOL_CAPABILITY_MAVLINK2](../messages/common.md#MAV_PROTOCOL_CAPABILITY_MAVLINK2) flag.
44
+
It can also be inferred from the packet start marker byte.
42
45
43
46
This is sufficient if the communication link between autopilot and GCS is completely transparent.
44
-
However, most communication links are not completely transparent as they either include routing or in case of fixed-length wireless implementations on packetization.
45
-
In order to also test the link, the _MAVLink 2_ handshake protocol sends a _MAVLink 2_ frame to test the complete communication chain.
47
+
However, some communication links are not completely transparent as they include:
46
48
47
-
To do so, the GCS sends a [COMMAND_LONG](../messages/common.md#COMMAND_LONG) or [COMMAND_INT](../messages/common.md#COMMAND_INT) message with the command ID [MAV_CMD_REQUEST_MESSAGE](../messages/common.md#MAV_CMD_REQUEST_MESSAGE) and param1=300 (PROTOCOL_VERSION)
49
+
- Routing, which can can change or reserialize MAVLink packets (for example, there might be an intermediate router that converts between versions).
50
+
- Wireless links that rely on fixed length packetization may distort or truncate variable-length MAVLink 2 frames.
48
51
52
+
::: info
53
+
Some flight stacks assume MAVLink 2 support based on the protocol capability or packet start marker.
54
+
This is reasonable because the majority of systems and communication links now reliably support MAVLink 2.
55
+
:::
56
+
57
+
To be certain that a link supports _MAVLink 2_ transparently, a GCS or other component can use the _MAVLink 2_ handshake protocol to test the link.
58
+
This is done by sending the [MAV_CMD_REQUEST_MESSAGE](../messages/common.md#MAV_CMD_REQUEST_MESSAGE) command with `param1=300` ([PROTOCOL_VERSION](../messages/common.md#PROTOCOL_VERSION)).
49
59
If the system supports _MAVLink 2_ and the handshake it will respond with [PROTOCOL_VERSION](../messages/common.md#PROTOCOL_VERSION)**encoded as MAVLink 2 packet**.
50
60
If it does not support _MAVLink 2_ it should `NACK` the command.
51
61
The GCS should fall back to a timeout in case the command interface is not implemented properly.
52
62
63
+
::: tip
64
+
If the target system does not support `PROTOCOL_VERSION` you can request any other message that it is able to emit.
65
+
:::
66
+
53
67
The diagram below illustrates the complete sequence.
Some popular legacy radios (e.g. the SiK radio series) operate in semi-transparent mode by injecting [RADIO_STATUS](../messages/common.md#RADIO_STATUS) messages into the MAVLink message stream. Per MAVLink spec these should actually emit a heartbeat with the same system ID and a different component ID than the autopilot to be discoverable.
84
+
Some popular legacy radios (e.g. the SiK radio series) operate in semi-transparent mode by injecting [RADIO_STATUS](../messages/common.md#RADIO_STATUS) messages into the MAVLink message stream.
85
+
Per MAVLink spec these should actually emit a heartbeat with the same system ID and a different component ID than the autopilot to be discoverable.
71
86
However, an additional heartbeat could be an issue for deployed systems.
72
87
Therefore these radios can alternatively confirm their _MAVLink 2_ compliance by emitting `RADIO_STATUS` in v2 message format after receiving the first MAVLink v2 frame.
0 commit comments