From 4165c09fcb967ddd63f90155aa31e2c75012532d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 29 Sep 2016 11:35:31 +0200 Subject: [PATCH] px4firmwareplugin: fix minimum required version comparison before, with a version of eg. 1.5.0, the user was wrongly notified. --- src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc index 9cef3d6e3..4385d2e9f 100644 --- a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc +++ b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc @@ -459,7 +459,15 @@ void PX4FirmwarePlugin::_handleAutopilotVersion(Vehicle* vehicle, mavlink_messag minorVersion = (version.flight_sw_version >> (8*2)) & 0xFF; patchVersion = (version.flight_sw_version >> (8*1)) & 0xFF; - notifyUser = majorVersion < supportedMajorVersion || minorVersion < supportedMinorVersion || patchVersion < supportedPatchVersion; + if (majorVersion < supportedMajorVersion) { + notifyUser = true; + } else if (majorVersion == supportedMajorVersion) { + if (minorVersion < supportedMinorVersion) { + notifyUser = true; + } else if (minorVersion == supportedMinorVersion) { + notifyUser = patchVersion < supportedPatchVersion; + } + } } else { notifyUser = true; } -- 2.22.0