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
3e0cd207
Commit
3e0cd207
authored
Oct 28, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a local variable for the port list, use correct null ptr macro
parent
252b70de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
SerialLink.cc
src/comm/SerialLink.cc
+7
-6
SerialLink.h
src/comm/SerialLink.h
+0
-1
No files found.
src/comm/SerialLink.cc
View file @
3e0cd207
...
...
@@ -22,7 +22,7 @@
SerialLink
::
SerialLink
(
QString
portname
,
int
baudRate
,
bool
hardwareFlowControl
,
bool
parity
,
int
dataBits
,
int
stopBits
)
:
m_bytesRead
(
0
),
m_port
(
NULL
),
m_port
(
Q_NULLPTR
),
type
(
""
),
m_is_cdc
(
true
),
m_stopp
(
false
),
...
...
@@ -34,9 +34,10 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
// Get the name of the current port in use.
m_portName
=
portname
.
trimmed
();
if
(
m_portName
==
""
&&
getCurrentPorts
().
size
()
>
0
)
QList
<
QString
>
ports
=
getCurrentPorts
();
if
(
m_portName
==
""
&&
ports
.
size
()
>
0
)
{
m_portName
=
m_
ports
.
first
().
trimmed
();
m_portName
=
ports
.
first
().
trimmed
();
}
checkIfCDC
();
...
...
@@ -96,15 +97,15 @@ SerialLink::~SerialLink()
QList
<
QString
>
SerialLink
::
getCurrentPorts
()
{
m_ports
.
clear
()
;
QList
<
QString
>
ports
;
QList
<
QSerialPortInfo
>
portList
=
QSerialPortInfo
::
availablePorts
();
foreach
(
const
QSerialPortInfo
&
info
,
portList
)
{
m_
ports
.
append
(
info
.
portName
());
ports
.
append
(
info
.
portName
());
}
return
m_
ports
;
return
ports
;
}
bool
SerialLink
::
isBootloader
()
...
...
src/comm/SerialLink.h
View file @
3e0cd207
...
...
@@ -158,7 +158,6 @@ protected:
int
m_id
;
QMutex
m_dataMutex
;
// Mutex for reading data from m_port
QMutex
m_writeMutex
;
// Mutex for accessing the m_transmitBuffer.
QList
<
QString
>
m_ports
;
QString
type
;
bool
m_is_cdc
;
...
...
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