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
4ed771cc
Commit
4ed771cc
authored
Oct 04, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making reconnect counters more forgiving, ensuring disconnect signal is emitted on all disconnects.
parent
49fc316c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
SerialLink.cc
src/comm/SerialLink.cc
+5
-3
No files found.
src/comm/SerialLink.cc
View file @
4ed771cc
...
...
@@ -232,10 +232,10 @@ void SerialLink::run()
}
// If there are too many errors on this link, disconnect.
if
(
isConnected
()
&&
(
linkErrorCount
>
1
0
0
))
{
if
(
isConnected
()
&&
(
linkErrorCount
>
1
5
0
))
{
qDebug
()
<<
"linkErrorCount too high: re-connecting!"
;
linkErrorCount
=
0
;
emit
communicationUpdate
(
getName
(),
tr
(
"
Reconnecting on too many link errors
"
));
emit
communicationUpdate
(
getName
(),
tr
(
"
Link timeout, not receiving any data, attempting reconnect
"
));
if
(
m_port
)
{
m_port
->
close
();
...
...
@@ -290,7 +290,7 @@ void SerialLink::run()
//wait n msecs for data to be ready
//[TODO][BB] lower to SerialLink::poll_interval?
m_dataMutex
.
lock
();
bool
success
=
m_port
->
waitForReadyRead
(
1
0
);
bool
success
=
m_port
->
waitForReadyRead
(
2
0
);
if
(
success
)
{
QByteArray
readData
=
m_port
->
readAll
();
...
...
@@ -416,6 +416,8 @@ bool SerialLink::disconnect()
}
wait
();
// This will terminate the thread and close the serial port
emit
connected
(
false
);
emit
disconnected
();
return
true
;
}
...
...
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