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
2732e9a5
Commit
2732e9a5
authored
Dec 05, 2016
by
Don Gagne
Committed by
GitHub
Dec 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4289 from DonLakeFlyer/AndroidSerial
Android build stop serial probe after first connect
parents
7266bb3c
2135a25d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
LinkManager.cc
src/comm/LinkManager.cc
+18
-1
No files found.
src/comm/LinkManager.cc
View file @
2732e9a5
...
...
@@ -490,7 +490,16 @@ void LinkManager::_updateAutoConnectLinks(void)
#ifndef NO_SERIAL_LINK
QStringList
currentPorts
;
QList
<
QGCSerialPortInfo
>
portList
=
QGCSerialPortInfo
::
availablePorts
();
QList
<
QGCSerialPortInfo
>
portList
;
#ifdef __android__
// Android builds only support a single serial connection. Repeatedly calling availablePorts after that one serial
// port is connected leaks file handles due to a bug somewhere in android serial code. In order to work around that
// bug after we connect the first serial port we stop probing for additional ports.
if
(
!
_autoconnectConfigurations
.
count
())
{
portList
=
QGCSerialPortInfo
::
availablePorts
();
}
#endif
// Iterate Comm Ports
foreach
(
QGCSerialPortInfo
portInfo
,
portList
)
{
...
...
@@ -601,6 +610,13 @@ void LinkManager::_updateAutoConnectLinks(void)
}
}
#ifndef __android__
// Android builds only support a single serial connection. Repeatedly calling availablePorts after that one serial
// port is connected leaks file handles due to a bug somewhere in android serial code. In order to work around that
// bug after we connect the first serial port we stop probing for additional ports. The means we must rely on
// the port disconnecting itself when the radio is pulled to signal communication list as opposed to automatically
// closing the Link.
// Now we go through the current configuration list and make sure any dynamic config has gone away
QList
<
LinkConfiguration
*>
_confToDelete
;
for
(
int
i
=
0
;
i
<
_autoconnectConfigurations
.
count
();
i
++
)
{
...
...
@@ -633,6 +649,7 @@ void LinkManager::_updateAutoConnectLinks(void)
}
delete
pDeleteConfig
;
}
#endif
#endif // NO_SERIAL_LINK
}
...
...
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