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
d3f6a08b
Commit
d3f6a08b
authored
Oct 15, 2016
by
Don Gagne
Committed by
GitHub
Oct 15, 2016
Browse files
Merge pull request #4136 from DonLakeFlyer/Mav2ChannelStatus
Use single mavlink_status_t array
parents
558bc825
16d16ac5
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/QGCApplication.cc
View file @
d3f6a08b
...
...
@@ -143,6 +143,9 @@ const char* QGCApplication::_lastKnownHomePositionAltKey = "LastKnownHomePosi
const
char
*
QGCApplication
::
_darkStyleFile
=
":/res/styles/style-dark.css"
;
const
char
*
QGCApplication
::
_lightStyleFile
=
":/res/styles/style-light.css"
;
// Mavlink status structures for entire app
mavlink_status_t
m_mavlink_status
[
MAVLINK_COMM_NUM_BUFFERS
];
// Qml Singleton factories
static
QObject
*
screenToolsControllerSingletonFactory
(
QQmlEngine
*
,
QJSEngine
*
)
...
...
src/Vehicle/Vehicle.cc
View file @
d3f6a08b
...
...
@@ -877,6 +877,12 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message)
return
;
}
#if 0
// Leaving in for ease in Mav 2.0 testing
mavlink_status_t* mavlinkStatus = mavlink_get_channel_status(link->mavlinkChannel());
qDebug() << "_sendMessageOnLink" << mavlinkStatus << link->mavlinkChannel() << mavlinkStatus->flags << message.magic;
#endif
// Give the plugin a chance to adjust
_firmwarePlugin
->
adjustOutgoingMavlinkMessage
(
this
,
link
,
&
message
);
...
...
src/comm/LinkManager.cc
View file @
d3f6a08b
...
...
@@ -192,7 +192,9 @@ void LinkManager::_addLink(LinkInterface* link)
mavlink_reset_channel_status
(
i
);
link
->
_setMavlinkChannel
(
i
);
// Start the channel on Mav 1 protocol
mavlink_get_channel_status
(
i
)
->
flags
=
mavlink_get_channel_status
(
i
)
->
flags
|
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
;
mavlink_status_t
*
mavlinkStatus
=
mavlink_get_channel_status
(
i
);
mavlinkStatus
->
flags
=
mavlink_get_channel_status
(
i
)
->
flags
|
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
;
qDebug
()
<<
"LinkManager mavlinkStatus"
<<
mavlinkStatus
<<
i
<<
mavlinkStatus
->
flags
;
_mavlinkChannelsUsedBitMask
|=
1
<<
i
;
channelSet
=
true
;
break
;
...
...
src/comm/MAVLinkProtocol.cc
View file @
d3f6a08b
...
...
@@ -216,10 +216,10 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
mavlink_status_t
*
mavlinkStatus
=
mavlink_get_channel_status
(
mavlinkChannel
);
if
(
!
(
mavlinkStatus
->
flags
&
MAVLINK_STATUS_FLAG_IN_MAVLINK1
)
&&
(
mavlinkStatus
->
flags
&
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
))
{
qDebug
()
<<
"switch to mavlink 2.0"
<<
mavlinkStatus
->
flags
;
qDebug
()
<<
"switch to mavlink 2.0"
<<
mavlinkStatus
<<
mavlinkChannel
<<
mavlinkStatus
->
flags
;
mavlinkStatus
->
flags
&=
~
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
;
}
else
if
((
mavlinkStatus
->
flags
&
MAVLINK_STATUS_FLAG_IN_MAVLINK1
)
&&
!
(
mavlinkStatus
->
flags
&
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
))
{
qDebug
()
<<
"switch to mavlink 1.0"
<<
mavlinkStatus
->
flags
;
qDebug
()
<<
"switch to mavlink 1.0"
<<
mavlinkStatus
<<
mavlinkChannel
<<
mavlinkStatus
->
flags
;
mavlinkStatus
->
flags
|=
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
;
}
...
...
src/comm/QGCMAVLink.h
View file @
d3f6a08b
...
...
@@ -17,6 +17,11 @@
#ifndef QGCMAVLINK_H
#define QGCMAVLINK_H
#define MAVLINK_USE_MESSAGE_INFO
#define MAVLINK_EXTERNAL_RX_STATUS // Single m_mavlink_status instance is in QGCApplication.cc
#include
<stddef.h>
// Hack workaround for Mav 2.0 header problem with respect to offsetof usage
#include
<mavlink_types.h>
extern
mavlink_status_t
m_mavlink_status
[
MAVLINK_COMM_NUM_BUFFERS
];
#include
<mavlink.h>
class
QGCMAVLink
{
...
...
src/ui/MAVLinkDecoder.cc
View file @
d3f6a08b
#define MAVLINK_USE_MESSAGE_INFO
#include
<stddef.h>
// Hack workaround for Mav 2.0 header problem with respect to offsetof usage
#include
"QGCMAVLink.h"
#include
"MAVLinkDecoder.h"
...
...
src/ui/QGCMAVLinkInspector.cc
View file @
d3f6a08b
#define MAVLINK_USE_MESSAGE_INFO
#include
<stddef.h>
// Hack workaround for Mav 2.0 header problem with respect to offsetof usage
#include
"QGCMAVLink.h"
#include
"QGCMAVLinkInspector.h"
#include
"MultiVehicleManager.h"
...
...
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