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
d3f6a08b
Commit
d3f6a08b
authored
Oct 15, 2016
by
Don Gagne
Committed by
GitHub
Oct 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
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
Showing
7 changed files
with
19 additions
and
7 deletions
+19
-7
QGCApplication.cc
src/QGCApplication.cc
+3
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+6
-0
LinkManager.cc
src/comm/LinkManager.cc
+3
-1
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+2
-2
QGCMAVLink.h
src/comm/QGCMAVLink.h
+5
-0
MAVLinkDecoder.cc
src/ui/MAVLinkDecoder.cc
+0
-2
QGCMAVLinkInspector.cc
src/ui/QGCMAVLinkInspector.cc
+0
-2
No files found.
src/QGCApplication.cc
View file @
d3f6a08b
...
@@ -143,6 +143,9 @@ const char* QGCApplication::_lastKnownHomePositionAltKey = "LastKnownHomePosi
...
@@ -143,6 +143,9 @@ const char* QGCApplication::_lastKnownHomePositionAltKey = "LastKnownHomePosi
const
char
*
QGCApplication
::
_darkStyleFile
=
":/res/styles/style-dark.css"
;
const
char
*
QGCApplication
::
_darkStyleFile
=
":/res/styles/style-dark.css"
;
const
char
*
QGCApplication
::
_lightStyleFile
=
":/res/styles/style-light.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
// Qml Singleton factories
static
QObject
*
screenToolsControllerSingletonFactory
(
QQmlEngine
*
,
QJSEngine
*
)
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)
...
@@ -877,6 +877,12 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message)
return
;
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
// Give the plugin a chance to adjust
_firmwarePlugin
->
adjustOutgoingMavlinkMessage
(
this
,
link
,
&
message
);
_firmwarePlugin
->
adjustOutgoingMavlinkMessage
(
this
,
link
,
&
message
);
...
...
src/comm/LinkManager.cc
View file @
d3f6a08b
...
@@ -192,7 +192,9 @@ void LinkManager::_addLink(LinkInterface* link)
...
@@ -192,7 +192,9 @@ void LinkManager::_addLink(LinkInterface* link)
mavlink_reset_channel_status
(
i
);
mavlink_reset_channel_status
(
i
);
link
->
_setMavlinkChannel
(
i
);
link
->
_setMavlinkChannel
(
i
);
// Start the channel on Mav 1 protocol
// 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
;
_mavlinkChannelsUsedBitMask
|=
1
<<
i
;
channelSet
=
true
;
channelSet
=
true
;
break
;
break
;
...
...
src/comm/MAVLinkProtocol.cc
View file @
d3f6a08b
...
@@ -216,10 +216,10 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
...
@@ -216,10 +216,10 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
mavlink_status_t
*
mavlinkStatus
=
mavlink_get_channel_status
(
mavlinkChannel
);
mavlink_status_t
*
mavlinkStatus
=
mavlink_get_channel_status
(
mavlinkChannel
);
if
(
!
(
mavlinkStatus
->
flags
&
MAVLINK_STATUS_FLAG_IN_MAVLINK1
)
&&
(
mavlinkStatus
->
flags
&
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
))
{
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
;
mavlinkStatus
->
flags
&=
~
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
;
}
else
if
((
mavlinkStatus
->
flags
&
MAVLINK_STATUS_FLAG_IN_MAVLINK1
)
&&
!
(
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
;
mavlinkStatus
->
flags
|=
MAVLINK_STATUS_FLAG_OUT_MAVLINK1
;
}
}
...
...
src/comm/QGCMAVLink.h
View file @
d3f6a08b
...
@@ -17,6 +17,11 @@
...
@@ -17,6 +17,11 @@
#ifndef QGCMAVLINK_H
#ifndef QGCMAVLINK_H
#define 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>
#include <mavlink.h>
class
QGCMAVLink
{
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 "QGCMAVLink.h"
#include "MAVLinkDecoder.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 "QGCMAVLink.h"
#include "QGCMAVLinkInspector.h"
#include "QGCMAVLinkInspector.h"
#include "MultiVehicleManager.h"
#include "MultiVehicleManager.h"
...
...
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