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
da71154c
Commit
da71154c
authored
Aug 28, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vehicle UID
parent
2f17ab70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+21
-0
Vehicle.h
src/Vehicle/Vehicle.h
+6
-0
No files found.
src/Vehicle/Vehicle.cc
View file @
da71154c
...
...
@@ -147,6 +147,7 @@ Vehicle::Vehicle(LinkInterface* link,
,
_firmwareCustomPatchVersion
(
versionNotSetValue
)
,
_firmwareVersionType
(
FIRMWARE_VERSION_TYPE_OFFICIAL
)
,
_gitHash
(
versionNotSetValue
)
,
_uid
(
0
)
,
_lastAnnouncedLowBatteryPercent
(
100
)
,
_rollFact
(
0
,
_rollFactName
,
FactMetaData
::
valueTypeDouble
)
,
_pitchFact
(
0
,
_pitchFactName
,
FactMetaData
::
valueTypeDouble
)
...
...
@@ -310,6 +311,7 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType,
,
_firmwareCustomPatchVersion
(
versionNotSetValue
)
,
_firmwareVersionType
(
FIRMWARE_VERSION_TYPE_OFFICIAL
)
,
_gitHash
(
versionNotSetValue
)
,
_uid
(
0
)
,
_lastAnnouncedLowBatteryPercent
(
100
)
,
_rollFact
(
0
,
_rollFactName
,
FactMetaData
::
valueTypeDouble
)
,
_pitchFact
(
0
,
_pitchFactName
,
FactMetaData
::
valueTypeDouble
)
...
...
@@ -745,6 +747,9 @@ void Vehicle::_handleAutopilotVersion(LinkInterface *link, mavlink_message_t& me
mavlink_autopilot_version_t
autopilotVersion
;
mavlink_msg_autopilot_version_decode
(
&
message
,
&
autopilotVersion
);
_uid
=
(
quint64
)
autopilotVersion
.
uid
;
emit
vehicleUIDChanged
();
if
(
autopilotVersion
.
flight_sw_version
!=
0
)
{
int
majorVersion
,
minorVersion
,
patchVersion
;
FIRMWARE_VERSION_TYPE
versionType
;
...
...
@@ -780,6 +785,22 @@ void Vehicle::_handleAutopilotVersion(LinkInterface *link, mavlink_message_t& me
_startPlanRequest
();
}
QString
Vehicle
::
vehicleUIDStr
()
{
QString
uid
;
uint8_t
*
pUid
=
(
uint8_t
*
)(
void
*
)
&
_uid
;
uid
.
sprintf
(
"%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X"
,
pUid
[
0
]
&
0xff
,
pUid
[
1
]
&
0xff
,
pUid
[
2
]
&
0xff
,
pUid
[
3
]
&
0xff
,
pUid
[
4
]
&
0xff
,
pUid
[
5
]
&
0xff
,
pUid
[
6
]
&
0xff
,
pUid
[
7
]
&
0xff
);
return
uid
;
}
void
Vehicle
::
_handleHilActuatorControls
(
mavlink_message_t
&
message
)
{
mavlink_hil_actuator_controls_t
hil
;
...
...
src/Vehicle/Vehicle.h
View file @
da71154c
...
...
@@ -361,6 +361,8 @@ public:
Q_PROPERTY
(
int
firmwareCustomMinorVersion
READ
firmwareCustomMinorVersion
NOTIFY
firmwareCustomVersionChanged
)
Q_PROPERTY
(
int
firmwareCustomPatchVersion
READ
firmwareCustomPatchVersion
NOTIFY
firmwareCustomVersionChanged
)
Q_PROPERTY
(
QString
gitHash
READ
gitHash
NOTIFY
gitHashChanged
)
Q_PROPERTY
(
quint64
vehicleUID
READ
vehicleUID
NOTIFY
vehicleUIDChanged
)
Q_PROPERTY
(
QString
vehicleUIDStr
READ
vehicleUIDStr
NOTIFY
vehicleUIDChanged
)
/// Resets link status counters
Q_INVOKABLE
void
resetCounters
();
...
...
@@ -643,6 +645,8 @@ public:
static
const
int
versionNotSetValue
=
-
1
;
QString
gitHash
(
void
)
const
{
return
_gitHash
;
}
quint64
vehicleUID
(
void
)
const
{
return
_uid
;
}
QString
vehicleUIDStr
();
bool
soloFirmware
(
void
)
const
{
return
_soloFirmware
;
}
void
setSoloFirmware
(
bool
soloFirmware
);
...
...
@@ -754,6 +758,7 @@ signals:
void
firmwareVersionChanged
(
void
);
void
firmwareCustomVersionChanged
(
void
);
void
gitHashChanged
(
QString
hash
);
void
vehicleUIDChanged
();
/// New RC channel values
/// @param channelCount Number of available channels, cMaxRcChannels max
...
...
@@ -1008,6 +1013,7 @@ private:
FIRMWARE_VERSION_TYPE
_firmwareVersionType
;
QString
_gitHash
;
quint64
_uid
;
int
_lastAnnouncedLowBatteryPercent
;
...
...
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