Commit 03b02749 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4086 from bkueng/fix_px4_version_comparison

px4firmwareplugin: fix minimum required version comparison
parents d24e93d6 4165c09f
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment