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
5f536d0d
Commit
5f536d0d
authored
Jun 04, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addition of extra debug output to comms console during Serial Comms issues
parent
3fba7256
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
LinkInterface.h
src/comm/LinkInterface.h
+2
-0
SerialLink.cc
src/comm/SerialLink.cc
+14
-3
DebugConsole.cc
src/ui/DebugConsole.cc
+8
-0
DebugConsole.h
src/ui/DebugConsole.h
+2
-0
No files found.
src/comm/LinkInterface.h
View file @
5f536d0d
...
...
@@ -232,6 +232,8 @@ signals:
/** @brief Communication error occured */
void
communicationError
(
const
QString
&
linkname
,
const
QString
&
error
);
void
communicationUpdate
(
const
QString
&
linkname
,
const
QString
&
text
);
/** @brief destroying element */
void
deleteLink
(
LinkInterface
*
const
link
);
...
...
src/comm/SerialLink.cc
View file @
5f536d0d
...
...
@@ -20,7 +20,6 @@
#ifdef _WIN32
#include "windows.h"
#endif
#ifdef _WIN32
#include <qextserialenumerator.h>
#endif
...
...
@@ -397,6 +396,8 @@ void SerialLink::run()
if
(
!
hardwareConnect
())
{
//Need to error out here.
emit
communicationError
(
getName
(),
"Error connecting: "
+
port
->
errorString
());
return
;
}
...
...
@@ -406,7 +407,7 @@ void SerialLink::run()
quint64
bytes
=
0
;
bool
triedreset
=
false
;
bool
triedDTR
=
false
;
int
timeout
=
25
00
;
int
timeout
=
50
00
;
forever
{
{
...
...
@@ -442,6 +443,7 @@ void SerialLink::run()
if
(
!
triedDTR
&&
triedreset
)
{
triedDTR
=
true
;
communicationUpdate
(
getName
(),
"No data to receive on COM port. Attempting to reset via DTR signal"
);
qDebug
()
<<
"No data!!! Attempting reset via DTR."
;
port
->
setDtr
(
true
);
this
->
msleep
(
250
);
...
...
@@ -450,11 +452,13 @@ void SerialLink::run()
else
if
(
!
triedreset
)
{
qDebug
()
<<
"No data!!! Attempting reset via reboot command."
;
communicationUpdate
(
getName
(),
"No data to receive on COM port. Assuming possible terminal mode, attempting to reset via
\"
reboot
\"
command"
);
port
->
write
(
"reboot
\r\n
"
,
8
);
triedreset
=
true
;
}
else
{
communicationUpdate
(
getName
(),
"No data to receive on COM port...."
);
qDebug
()
<<
"No data!!!"
;
}
}
...
...
@@ -665,7 +669,14 @@ bool SerialLink::hardwareConnect()
port
->
setCommTimeouts
(
QSerialPort
::
CtScheme_NonBlockingRead
);
connectionStartTime
=
MG
::
TIME
::
getGroundTimeNow
();
port
->
open
();
if
(
!
port
->
open
())
{
emit
communicationUpdate
(
getName
(),
"Error opening port: "
+
port
->
errorString
());
}
else
{
emit
communicationUpdate
(
getName
(),
"Opened port!"
);
}
bool
connectionUp
=
isConnected
();
if
(
connectionUp
)
{
...
...
src/ui/DebugConsole.cc
View file @
5f536d0d
...
...
@@ -215,6 +215,12 @@ void DebugConsole::removeLink(LinkInterface* const linkInterface)
}
if
(
linkInterface
==
currLink
)
currLink
=
NULL
;
}
void
DebugConsole
::
linkStatusUpdate
(
const
QString
&
name
,
const
QString
&
text
)
{
m_ui
->
receiveText
->
appendPlainText
(
text
);
// Ensure text area scrolls correctly
m_ui
->
receiveText
->
ensureCursorVisible
();
}
void
DebugConsole
::
linkSelected
(
int
linkId
)
{
...
...
@@ -222,6 +228,7 @@ void DebugConsole::linkSelected(int linkId)
if
(
currLink
)
{
disconnect
(
currLink
,
SIGNAL
(
bytesReceived
(
LinkInterface
*
,
QByteArray
)),
this
,
SLOT
(
receiveBytes
(
LinkInterface
*
,
QByteArray
)));
disconnect
(
currLink
,
SIGNAL
(
connected
(
bool
)),
this
,
SLOT
(
setConnectionState
(
bool
)));
disconnect
(
currLink
,
SIGNAL
(
communicationUpdate
(
QString
,
QString
)),
this
,
SLOT
(
linkStatusUpdate
(
QString
,
QString
)));
}
// Clear data
m_ui
->
receiveText
->
clear
();
...
...
@@ -230,6 +237,7 @@ void DebugConsole::linkSelected(int linkId)
currLink
=
links
[
linkId
];
connect
(
currLink
,
SIGNAL
(
bytesReceived
(
LinkInterface
*
,
QByteArray
)),
this
,
SLOT
(
receiveBytes
(
LinkInterface
*
,
QByteArray
)));
connect
(
currLink
,
SIGNAL
(
connected
(
bool
)),
this
,
SLOT
(
setConnectionState
(
bool
)));
connect
(
currLink
,
SIGNAL
(
communicationUpdate
(
QString
,
QString
)),
this
,
SLOT
(
linkStatusUpdate
(
QString
,
QString
)));
setConnectionState
(
currLink
->
isConnected
());
}
...
...
src/ui/DebugConsole.h
View file @
5f536d0d
...
...
@@ -96,6 +96,8 @@ public slots:
/** @brief A new special symbol is selected */
void
specialSymbolSelected
(
const
QString
&
text
);
void
linkStatusUpdate
(
const
QString
&
name
,
const
QString
&
text
);
protected
slots
:
/** @brief Draw information overlay */
void
paintEvent
(
QPaintEvent
*
event
);
...
...
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