summaryrefslogtreecommitdiff
path: root/src/serialport/qserialport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/serialport/qserialport.cpp')
-rw-r--r--src/serialport/qserialport.cpp59
1 files changed, 24 insertions, 35 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp
index ff5789d..b2b6a94 100644
--- a/src/serialport/qserialport.cpp
+++ b/src/serialport/qserialport.cpp
@@ -4,31 +4,37 @@
** Copyright (C) 2011 Sergey Belyashov <Sergey.Belyashov@gmail.com>
** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
** Copyright (C) 2012 Andre Hartmann <aha_1980@gmx.de>
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -94,10 +100,7 @@ QSerialPortPrivate::QSerialPortPrivate()
, settingsRestoredOnClose(true)
#endif
, isBreakEnabled(false)
-#if defined(Q_OS_WINCE)
- , handle(INVALID_HANDLE_VALUE)
- , eventNotifier(0)
-#elif defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32)
, handle(INVALID_HANDLE_VALUE)
, readChunkBuffer(ReadChunkSize, 0)
, communicationStarted(false)
@@ -194,7 +197,7 @@ void QSerialPortPrivate::setError(const QSerialPortErrorInfo &errorInfo)
int numRead = 0, numReadTotal = 0;
char buffer[50];
- forever {
+ for (;;) {
numRead = serial.read(buffer, 50);
// Do whatever with the array
@@ -525,10 +528,6 @@ void QSerialPort::setPort(const QSerialPortInfo &serialPortInfo)
\li Removes the prefix "\\\\.\\" or "//./" from the system location
and returns the remainder of the string.
\row
- \li Windows CE
- \li Removes the suffix ":" from the system location
- and returns the remainder of the string.
- \row
\li Unix, BSD
\li Removes the prefix "/dev/" from the system location
and returns the remainder of the string.
@@ -578,15 +577,6 @@ bool QSerialPort::open(OpenMode mode)
if (!d->open(mode))
return false;
- if (!d->setBaudRate()
- || !d->setDataBits(d->dataBits)
- || !d->setParity(d->parity)
- || !d->setStopBits(d->stopBits)
- || !d->setFlowControl(d->flowControl)) {
- d->close();
- return false;
- }
-
QIODevice::open(mode);
return true;
}
@@ -669,9 +659,9 @@ bool QSerialPort::settingsRestoredOnClose() const
after that the opening of the port succeeds.
\warning Setting the AllDirections flag is supported on all platforms.
- Windows and Windows CE support only this mode.
+ Windows supports only this mode.
- \warning Returns equal baud rate in any direction on Windows, Windows CE.
+ \warning Returns equal baud rate in any direction on Windows.
The default value is Baud9600, i.e. 9600 bits per second.
*/
@@ -1106,8 +1096,7 @@ bool QSerialPort::clear(Directions directions)
*/
bool QSerialPort::atEnd() const
{
- Q_D(const QSerialPort);
- return QIODevice::atEnd() && (!isOpen() || (d->buffer.size() == 0));
+ return QIODevice::atEnd();
}
#if QT_DEPRECATED_SINCE(5, 2)