diff --git a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc index 188e7f62d42571caa4da6372c30b0c57e760b422..f4a0015ce9f469c804240a42d69b1d39290967b4 100644 --- a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc +++ b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc @@ -313,7 +313,7 @@ bool APMFirmwarePlugin::_handleStatusText(Vehicle* vehicle, mavlink_message_t* m mavlink_statustext_t statusText; mavlink_msg_statustext_decode(message, &statusText); - if (vehicle->firmwareMajorVersion() == -1 || statusText.severity < MAV_SEVERITY_NOTICE) { + if (vehicle->firmwareMajorVersion() == Vehicle::versionNotSetValue || statusText.severity < MAV_SEVERITY_NOTICE) { messageText = _getMessageText(message); qCDebug(APMFirmwarePluginLog) << messageText; diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 0994aa23af070dd4ff57822db47679cd3ff33c58..594a80ee7d99c1bd23691eb0d1caea77129fdc69 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -121,9 +121,9 @@ Vehicle::Vehicle(LinkInterface* link, , _messageSeq(0) , _compID(0) , _heardFrom(false) - , _firmwareMajorVersion(-1) - , _firmwareMinorVersion(-1) - , _firmwarePatchVersion(-1) + , _firmwareMajorVersion(versionNotSetValue) + , _firmwareMinorVersion(versionNotSetValue) + , _firmwarePatchVersion(versionNotSetValue) , _rollFact (0, _rollFactName, FactMetaData::valueTypeDouble) , _pitchFact (0, _pitchFactName, FactMetaData::valueTypeDouble) , _headingFact (0, _headingFactName, FactMetaData::valueTypeDouble) @@ -291,9 +291,9 @@ Vehicle::Vehicle(QObject* parent) , _messageSeq(0) , _compID(0) , _heardFrom(false) - , _firmwareMajorVersion(-1) - , _firmwareMinorVersion(-1) - , _firmwarePatchVersion(-1) + , _firmwareMajorVersion(versionNotSetValue) + , _firmwareMinorVersion(versionNotSetValue) + , _firmwarePatchVersion(versionNotSetValue) , _rollFact (0, _rollFactName, FactMetaData::valueTypeDouble) , _pitchFact (0, _pitchFactName, FactMetaData::valueTypeDouble) , _headingFact (0, _headingFactName, FactMetaData::valueTypeDouble) diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index a739c6f4ef06906c25a8a61f92dd2e8f4c8b6918..8880214a45a6f692d872d73ec0636cc096d23551 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -524,6 +524,7 @@ public: int firmwareMinorVersion(void) const { return _firmwareMinorVersion; } int firmwarePatchVersion(void) const { return _firmwarePatchVersion; } void setFirmwareVersion(int majorVersion, int minorVersion, int patchVersion); + static const int versionNotSetValue = -1; public slots: void setLatitude(double latitude);