Commit 76efcc81 authored by Don Gagne's avatar Don Gagne

Remove 0 test

parent 8d7acf62
...@@ -721,30 +721,25 @@ void Vehicle::_handleAutopilotVersion(LinkInterface *link, mavlink_message_t& me ...@@ -721,30 +721,25 @@ void Vehicle::_handleAutopilotVersion(LinkInterface *link, mavlink_message_t& me
setFirmwareVersion(majorVersion, minorVersion, patchVersion, versionType); setFirmwareVersion(majorVersion, minorVersion, patchVersion, versionType);
} }
// Git hash if (px4Firmware()) {
if (*((uint64_t*)(&autopilotVersion.flight_custom_version[0])) != 0) { // Lower 3 bytes is custom version
int majorVersion, minorVersion, patchVersion;
majorVersion = autopilotVersion.flight_custom_version[2];
minorVersion = autopilotVersion.flight_custom_version[1];
patchVersion = autopilotVersion.flight_custom_version[0];
setFirmwareCustomVersion(majorVersion, minorVersion, patchVersion);
// PX4 Firmware stores the first 16 characters of the git hash as binary, with the individual bytes in reverse order // PX4 Firmware stores the first 16 characters of the git hash as binary, with the individual bytes in reverse order
if (px4Firmware()) { _gitHash = "";
// Lower 3 bytes is custom version QByteArray array((char*)autopilotVersion.flight_custom_version, 8);
int majorVersion, minorVersion, patchVersion; for (int i = 7; i >= 0; i--) {
majorVersion = autopilotVersion.flight_custom_version[2]; _gitHash.append(QString("%1").arg(autopilotVersion.flight_custom_version[i], 2, 16, QChar('0')));
minorVersion = autopilotVersion.flight_custom_version[1];
patchVersion = autopilotVersion.flight_custom_version[0];
setFirmwareCustomVersion(majorVersion, minorVersion, patchVersion);
qDebug() << majorVersion << minorVersion << patchVersion;
_gitHash = "";
QByteArray array((char*)autopilotVersion.flight_custom_version, 8);
for (int i = 7; i >= 0; i--) {
_gitHash.append(QString("%1").arg(autopilotVersion.flight_custom_version[i], 2, 16, QChar('0')));
}
} else {
// APM Firmware stores the first 8 characters of the git hash as an ASCII character string
_gitHash = QString::fromUtf8((char*)autopilotVersion.flight_custom_version, 8);
} }
emit gitHashChanged(_gitHash); } else {
// APM Firmware stores the first 8 characters of the git hash as an ASCII character string
_gitHash = QString::fromUtf8((char*)autopilotVersion.flight_custom_version, 8);
} }
emit gitHashChanged(_gitHash);
_setCapabilities(autopilotVersion.capabilities); _setCapabilities(autopilotVersion.capabilities);
_startPlanRequest(); _startPlanRequest();
......
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