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
3440bc7c
Commit
3440bc7c
authored
Jan 03, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PX4 Firmware no longer requires mavlink USB start
parent
05092fe2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
55 deletions
+0
-55
LinkInterface.h
src/comm/LinkInterface.h
+0
-4
LinkManager.cc
src/comm/LinkManager.cc
+0
-2
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+0
-35
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+0
-4
SerialLink.cc
src/comm/SerialLink.cc
+0
-9
SerialLink.h
src/comm/SerialLink.h
+0
-1
No files found.
src/comm/LinkInterface.h
View file @
3440bc7c
...
...
@@ -131,10 +131,6 @@ public:
/// set into the link when it is added to LinkManager
uint8_t
getMavlinkChannel
(
void
)
const
{
Q_ASSERT
(
_mavlinkChannelSet
);
return
_mavlinkChannel
;
}
/// @return true: "sh /etc/init.d/rc.usb" must be sent on link to start mavlink
virtual
bool
requiresUSBMavlinkStart
(
void
)
const
{
return
false
;
}
// These are left unimplemented in order to cause linker errors which indicate incorrect usage of
// connect/disconnect on link directly. All connect/disconnect calls should be made through LinkManager.
bool
connect
(
void
);
...
...
src/comm/LinkManager.cc
View file @
3440bc7c
...
...
@@ -189,8 +189,6 @@ void LinkManager::_addLink(LinkInterface* link)
connect
(
link
,
&
LinkInterface
::
communicationError
,
_app
,
&
QGCApplication
::
criticalMessageBoxOnMainThread
);
connect
(
link
,
&
LinkInterface
::
bytesReceived
,
_mavlinkProtocol
,
&
MAVLinkProtocol
::
receiveBytes
);
connect
(
link
,
&
LinkInterface
::
connected
,
_mavlinkProtocol
,
&
MAVLinkProtocol
::
linkConnected
);
connect
(
link
,
&
LinkInterface
::
disconnected
,
_mavlinkProtocol
,
&
MAVLinkProtocol
::
linkDisconnected
);
_mavlinkProtocol
->
resetMetadataForLink
(
link
);
...
...
src/comm/MAVLinkProtocol.cc
View file @
3440bc7c
...
...
@@ -173,41 +173,6 @@ void MAVLinkProtocol::resetMetadataForLink(const LinkInterface *link)
currLossCounter
[
channel
]
=
0
;
}
void
MAVLinkProtocol
::
linkConnected
(
void
)
{
LinkInterface
*
link
=
qobject_cast
<
LinkInterface
*>
(
QObject
::
sender
());
Q_ASSERT
(
link
);
_linkStatusChanged
(
link
,
true
);
}
void
MAVLinkProtocol
::
linkDisconnected
(
void
)
{
LinkInterface
*
link
=
qobject_cast
<
LinkInterface
*>
(
QObject
::
sender
());
Q_ASSERT
(
link
);
_linkStatusChanged
(
link
,
false
);
}
void
MAVLinkProtocol
::
_linkStatusChanged
(
LinkInterface
*
link
,
bool
connected
)
{
qCDebug
(
MAVLinkProtocolLog
)
<<
"_linkStatusChanged"
<<
QString
(
"%1"
).
arg
((
long
)
link
,
0
,
16
)
<<
connected
;
Q_ASSERT
(
link
);
if
(
connected
)
{
if
(
link
->
requiresUSBMavlinkStart
())
{
// Send command to start MAVLink
// XXX hacky but safe
// Start NSH
const
char
init
[]
=
{
0x0d
,
0x0d
,
0x0d
,
0x0d
};
link
->
writeBytes
(
init
,
sizeof
(
init
));
const
char
*
cmd
=
"sh /etc/init.d/rc.usb
\n
"
;
link
->
writeBytes
(
cmd
,
strlen
(
cmd
));
link
->
writeBytes
(
init
,
4
);
}
}
}
/**
* This method parses all incoming bytes and constructs a MAVLink packet.
* It can handle multiple links in parallel, as each link has it's own buffer/
...
...
src/comm/MAVLinkProtocol.h
View file @
3440bc7c
...
...
@@ -155,9 +155,6 @@ public slots:
/** @brief Receive bytes from a communication interface */
void
receiveBytes
(
LinkInterface
*
link
,
QByteArray
b
);
void
linkConnected
(
void
);
void
linkDisconnected
(
void
);
/** @brief Set the rate at which heartbeats are emitted */
void
setHeartbeatRate
(
int
rate
);
/** @brief Set the system id of this application */
...
...
@@ -285,7 +282,6 @@ private slots:
void
_vehicleCountChanged
(
int
count
);
private:
void
_linkStatusChanged
(
LinkInterface
*
link
,
bool
connected
);
void
_sendMessage
(
mavlink_message_t
message
);
void
_sendMessage
(
LinkInterface
*
link
,
mavlink_message_t
message
);
void
_sendMessage
(
LinkInterface
*
link
,
mavlink_message_t
message
,
quint8
systemid
,
quint8
componentid
);
...
...
src/comm/SerialLink.cc
View file @
3440bc7c
...
...
@@ -377,15 +377,6 @@ LinkConfiguration* SerialLink::getLinkConfiguration()
return
_config
;
}
bool
SerialLink
::
requiresUSBMavlinkStart
(
void
)
const
{
if
(
_port
)
{
return
QGCSerialPortInfo
(
*
_port
).
boardTypePixhawk
();
}
else
{
return
false
;
}
}
//--------------------------------------------------------------------------
//-- SerialConfiguration
...
...
src/comm/SerialLink.h
View file @
3440bc7c
...
...
@@ -146,7 +146,6 @@ public:
void
requestReset
();
bool
isConnected
()
const
;
qint64
getConnectionSpeed
()
const
;
bool
requiresUSBMavlinkStart
(
void
)
const
;
// These are left unimplemented in order to cause linker errors which indicate incorrect usage of
// connect/disconnect on link directly. All connect/disconnect calls should be made through LinkManager.
...
...
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