Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
76efcc81
Commit
76efcc81
authored
May 13, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 0 test
parent
8d7acf62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
Vehicle.cc
src/Vehicle/Vehicle.cc
+16
-21
No files found.
src/Vehicle/Vehicle.cc
View file @
76efcc81
...
...
@@ -721,30 +721,25 @@ void Vehicle::_handleAutopilotVersion(LinkInterface *link, mavlink_message_t& me
setFirmwareVersion
(
majorVersion
,
minorVersion
,
patchVersion
,
versionType
);
}
// Git hash
if
(
*
((
uint64_t
*
)(
&
autopilotVersion
.
flight_custom_version
[
0
]))
!=
0
)
{
if
(
px4Firmware
())
{
// 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
if
(
px4Firmware
())
{
// 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
);
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
);
_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'
)));
}
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
);
_startPlanRequest
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment