Commit 4165c09f authored by Beat Küng's avatar Beat Küng

px4firmwareplugin: fix minimum required version comparison

before, with a version of eg. 1.5.0, the user was wrongly notified.
parent d24e93d6
......@@ -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