Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
89c77bf6
Commit
89c77bf6
authored
Jul 10, 2016
by
Don Gagne
Browse files
Return supported versions
parent
563189ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/MockLink.cc
View file @
89c77bf6
...
...
@@ -794,24 +794,34 @@ void MockLink::_respondWithAutopilotVersion(void)
{
mavlink_message_t
msg
;
uint8_t
customVersion
[
8
];
memset
(
customVersion
,
0
,
sizeof
(
customVersion
));
uint8_t
customVersion
[
8
]
=
{
};
uint32_t
flightVersion
=
0
;
if
(
_firmwareType
==
MAV_AUTOPILOT_ARDUPILOTMEGA
)
{
flightVersion
|=
3
<<
(
8
*
3
);
flightVersion
|=
3
<<
(
8
*
2
);
flightVersion
|=
0
<<
(
8
*
1
);
flightVersion
|=
FIRMWARE_VERSION_TYPE_DEV
<<
(
8
*
0
);
}
else
if
(
_firmwareType
==
MAV_AUTOPILOT_PX4
)
{
flightVersion
|=
1
<<
(
8
*
3
);
flightVersion
|=
4
<<
(
8
*
2
);
flightVersion
|=
1
<<
(
8
*
1
);
flightVersion
|=
FIRMWARE_VERSION_TYPE_DEV
<<
(
8
*
0
);
}
// 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
0
,
// capabilities,
flightVersion
,
// 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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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