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
58eef4b2
Commit
58eef4b2
authored
Dec 09, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix create/destroy ordering problems between LinkManager and MAVLinkProtocol
parent
09286429
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
LinkManager.cc
src/comm/LinkManager.cc
+5
-3
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+5
-5
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+5
-1
No files found.
src/comm/LinkManager.cc
View file @
58eef4b2
...
...
@@ -68,10 +68,12 @@ LinkManager::LinkManager(QObject* parent, bool registerSingleton) :
_connectionsSuspended
(
false
),
_mavlink
(
NULL
)
{
Q_ASSERT
(
_instance
==
NULL
);
_instance
=
this
;
if
(
registerSingleton
)
{
Q_ASSERT
(
_instance
==
NULL
);
_instance
=
this
;
}
_mavlink
=
new
MAVLinkProtocol
;
_mavlink
=
new
MAVLinkProtocol
(
this
)
;
Q_CHECK_PTR
(
_mavlink
);
}
...
...
src/comm/MAVLinkProtocol.cc
View file @
58eef4b2
...
...
@@ -39,7 +39,7 @@ const char* MAVLinkProtocol::_logFileExtension = "mavlink"; ///< Ext
* The default constructor will create a new MAVLink object sending heartbeats at
* the MAVLINK_HEARTBEAT_DEFAULT_RATE to all connected links.
*/
MAVLinkProtocol
::
MAVLinkProtocol
()
:
MAVLinkProtocol
::
MAVLinkProtocol
(
LinkManager
*
linkMgr
)
:
heartbeatTimer
(
NULL
),
heartbeatRate
(
MAVLINK_HEARTBEAT_DEFAULT_RATE
),
m_heartbeatsEnabled
(
true
),
...
...
@@ -58,8 +58,8 @@ MAVLinkProtocol::MAVLinkProtocol() :
_logSuspendReplay
(
false
),
_tempLogFile
(
QString
(
"%2.%3"
).
arg
(
_tempLogFileTemplate
).
arg
(
_logFileExtension
)),
_protocolStatusMessageConnected
(
false
),
_saveTempFlightDataLogConnected
(
false
)
_saveTempFlightDataLogConnected
(
false
)
,
_linkMgr
(
linkMgr
)
{
qRegisterMetaType
<
mavlink_message_t
>
(
"mavlink_message_t"
);
...
...
@@ -452,7 +452,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
if
(
m_multiplexingEnabled
)
{
// Get all links connected to this unit
QList
<
LinkInterface
*>
links
=
LinkManager
::
instance
()
->
getLinks
();
QList
<
LinkInterface
*>
links
=
_linkMgr
->
getLinks
();
// Emit message on all links that are currently connected
foreach
(
LinkInterface
*
currLink
,
links
)
...
...
@@ -497,7 +497,7 @@ int MAVLinkProtocol::getComponentId()
void
MAVLinkProtocol
::
sendMessage
(
mavlink_message_t
message
)
{
// Get all links connected to this unit
QList
<
LinkInterface
*>
links
=
LinkManager
::
instance
()
->
getLinks
();
QList
<
LinkInterface
*>
links
=
_linkMgr
->
getLinks
();
// Emit message on all links that are currently connected
QList
<
LinkInterface
*>::
iterator
i
;
...
...
src/comm/MAVLinkProtocol.h
View file @
58eef4b2
...
...
@@ -43,6 +43,8 @@ This file is part of the QGROUNDCONTROL project
#include "QGC.h"
#include "QGCTemporaryFile.h"
class
LinkManager
;
/**
* @brief MAVLink micro air vehicle protocol reference implementation.
*
...
...
@@ -55,7 +57,7 @@ class MAVLinkProtocol : public QThread
Q_OBJECT
public:
MAVLinkProtocol
();
MAVLinkProtocol
(
LinkManager
*
linkMgr
);
~
MAVLinkProtocol
();
/** @brief Get the human-friendly name of this protocol */
...
...
@@ -297,6 +299,8 @@ private:
bool
_protocolStatusMessageConnected
;
///< true: protocolStatusMessage signal has been connected
bool
_saveTempFlightDataLogConnected
;
///< true: saveTempFlightDataLog signal has been connected
LinkManager
*
_linkMgr
;
};
#endif // MAVLINKPROTOCOL_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