From 962eaaaf16a674eddaca90dd4f1857f02be924a1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 4 Jun 2017 22:05:14 +0200 Subject: [PATCH] MAVLink: Set v2 state also on incoming MAVLink 2 packets --- src/comm/MAVLinkProtocol.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 2be1915..16a9522 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -221,6 +221,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b) if (!(mavlinkStatus->flags & MAVLINK_STATUS_FLAG_IN_MAVLINK1) && (mavlinkStatus->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1)) { qDebug() << "Switching outbound to mavlink 2.0 due to incoming mavlink 2.0 packet:" << mavlinkStatus << mavlinkChannel << mavlinkStatus->flags; mavlinkStatus->flags &= ~MAVLINK_STATUS_FLAG_OUT_MAVLINK1; + _current_version = 200; } link->setDecodedFirstMavlinkPacket(true); }