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
840b425c
Commit
840b425c
authored
May 24, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES support
parent
1deab759
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
MockLink.cc
src/comm/MockLink.cc
+29
-0
MockLink.h
src/comm/MockLink.h
+1
-0
No files found.
src/comm/MockLink.cc
View file @
840b425c
...
...
@@ -803,6 +803,10 @@ void MockLink::_handleCommandLong(const mavlink_message_t& msg)
case
MAV_CMD_PREFLIGHT_STORAGE
:
commandResult
=
MAV_RESULT_ACCEPTED
;
break
;
case
MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES
:
commandResult
=
MAV_RESULT_ACCEPTED
;
_respondWithAutopilotVersion
();
break
;
}
mavlink_message_t
commandAck
;
...
...
@@ -814,6 +818,31 @@ void MockLink::_handleCommandLong(const mavlink_message_t& msg)
respondWithMavlinkMessage
(
commandAck
);
}
void
MockLink
::
_respondWithAutopilotVersion
(
void
)
{
mavlink_message_t
msg
;
uint8_t
customVersion
[
8
];
memset
(
customVersion
,
0
,
sizeof
(
customVersion
));
// Only flight_sw_version is supported a this point
mavlink_msg_autopilot_version_pack
(
_vehicleSystemId
,
_vehicleComponentId
,
&
msg
,
0
,
// capabilities,
(
1
<<
(
8
*
3
))
|
FIRMWARE_VERSION_TYPE_DEV
,
// flight_sw_version,
0
,
// middleware_sw_version,
0
,
// os_sw_version,
0
,
// board_version,
(
uint8_t
*
)
&
customVersion
,
// flight_custom_version,
(
uint8_t
*
)
&
customVersion
,
// middleware_custom_version,
(
uint8_t
*
)
&
customVersion
,
// os_custom_version,
0
,
// vendor_id,
0
,
// product_id,
0
);
// uid
respondWithMavlinkMessage
(
msg
);
}
void
MockLink
::
setMissionItemFailureMode
(
MockLinkMissionItemHandler
::
FailureMode_t
failureMode
)
{
_missionItemHandler
.
setMissionItemFailureMode
(
failureMode
);
...
...
src/comm/MockLink.h
View file @
840b425c
...
...
@@ -185,6 +185,7 @@ private:
void
_sendGpsRawInt
(
void
);
void
_sendVibration
(
void
);
void
_sendStatusTextMessages
(
void
);
void
_respondWithAutopilotVersion
(
void
);
static
MockLink
*
_startMockLink
(
MockConfiguration
*
mockConfig
);
...
...
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