Commit 62fca265 authored by Lorenz Meier's avatar Lorenz Meier

Merged APM config changes, reverted some really ridiculous non-programming changes

parents b6c11a8d 34eaf1fb
*.swp
*.nfs
CMakeFiles
*Makefile*
tags
build*/
Info.plist
obj
.DS_Store
*.log
*~
*~.skp
bin/*.exe
bin/*.txt
bin/mac
*pro.user*
qrc_*.cpp
*.Debug
*.Release
tmp
debug
release
qgroundcontrol
mavlinkgen-build-desktop
qgroundcontrol.xcodeproj/**
doc/html
doc/doxy.log
deploy/mac
deploy/linux
deploy/qgroundcontrol*
controller_log*
user_config.pri
*.app
*.ncb
*.vcproj
*.vcxproj*
*.sdf
*.ipch
*.pdb
*.sln
*.sln
*.vcproj
*.user
*.ncb
*.idb
*.project
*.cproject
*.sln
*.suo
*.uhf.txt
*.opensdf
thirdParty/qserialport-build-desktop/
thirdParty/qserialport/bin/
thirdParty/qserialport/lib/
*.swp
*.nfs
CMakeFiles
*Makefile*
tags
build*/
Info.plist
obj
.DS_Store
*.log
*~
*~.skp
bin/*.exe
bin/*.txt
bin/mac
*pro.user*
qrc_*.cpp
*.Debug
*.Release
tmp
debug
release
qgroundcontrol
mavlinkgen-build-desktop
qgroundcontrol.xcodeproj/**
doc/html
doc/doxy.log
deploy/mac
deploy/linux
deploy/qgroundcontrol*
controller_log*
user_config.pri
*.app
*.ncb
*.vcproj
*.vcxproj*
*.sdf
*.ipch
*.pdb
*.sln
*.sln
*.vcproj
*.user
*.ncb
*.idb
*.project
*.cproject
*.sln
*.suo
*.uhf.txt
*.opensdf
apmplanner2.xcodeproj/
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtSerialPort
description = Qt Serial Port Reference Documentation
url = http://qt-project.org/doc/qt-$QT_VER/qtserialport
version = $QT_VERSION
qhp.projects = QtSerialPort
qhp.QtSerialPort.file = qtserialport.qhp
qhp.QtSerialPort.namespace = org.qt-project.qtserialport.$QT_VERSION_TAG
qhp.QtSerialPort.virtualFolder = qtserialport
qhp.QtSerialPort.indexTitle = Qt Serial Port
qhp.QtSerialPort.indexRoot =
qhp.QtSerialPort.filterAttributes = qtserialport $QT_VERSION qtrefdoc
qhp.QtSerialPort.customFilters.Qt.name = QtSerialPort $QT_VERSION
qhp.QtSerialPort.customFilters.Qt.filterAttributes = qtserialport $QT_VERSION
qhp.QtSerialPort.subprojects = classes examples
qhp.QtSerialPort.subprojects.classes.title = C++ Classes
qhp.QtSerialPort.subprojects.classes.indexTitle = Qt Serial Port C++ Classes
qhp.QtSerialPort.subprojects.classes.selectors = class fake:headerfile
qhp.QtSerialPort.subprojects.classes.sortPages = true
qhp.QtSerialPort.subprojects.examples.title = Examples
qhp.QtSerialPort.subprojects.examples.indexTitle = Qt Serial Port Examples
qhp.QtSerialPort.subprojects.examples.selectors = fake:example
qhp.QtSerialPort.subprojects.examples.sortPages = true
headerdirs += ..
sourcedirs += ..
exampledirs += ../../../examples/serialport
imagedirs += images
depends += qtcore qtdoc
/****************************************************************************
**
** Copyright (C) 2011 - 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page qtserialport-index.html
\title Qt Serial Port
\brief Provides API to make the serial programming simple and portable.
Qt Serial Port provides the basic functionality, which includes
configuring, I/O operations, get and set control signals of the
RS-232 pinouts.
The following are not supported by this module:
\list
\li Terminal features such as echo, control CR/LF, and so on.
\li Text mode.
\li Configuring timeouts and delays while reading.
\li Tracking and notification when the state of RS-232 pinout signals change.
\endlist
To use these classes in your application, use the following include
statement:
\code
#include <QtSerialPort/QtSerialPort>
\endcode
To link against the module, add this line to your \l qmake \c
.pro file:
\code
QT += serialport
\endcode
\section1 Related information
\list
\li \l{Qt Serial Port C++ Classes}{C++ Classes}
\li \l{Qt Serial Port Examples}{Examples}
\endlist
*/
/****************************************************************************
**
** Copyright (C) 2011 - 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\module QtSerialPort
\title Qt Serial Port C++ Classes
\brief List of C++ classes that enable access to a serial port.
To use these classes in your application, use the following include
statement:
\code
#include <QtSerialPort/QtSerialPort>
\endcode
To link against the module, add this line to your \l qmake \c
.pro file:
\code
QT += serialport
\endcode
*/
a:link, a:visited {
color: #00732F;
text-decoration: none;
font-weight: bold;
}
body {
font: normal 400 14px/1.2 Arial;
margin-top: 85px;
}
h1 {
margin: 0;
}
h2 {
font: 500 20px/1.2 Arial;
}
h3.fn, span.fn {
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border-width: 1px;
border-style: solid;
border-color: #E6E6E6;
word-spacing: 3px;
padding: 3px 5px;
}
table, pre {
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #E6E6E6;
border-collapse: separate;
font-size: 12px;
line-height: 1.2;
margin-bottom: 25px;
margin-left: 15px;
}
table td {
padding: 3px 15px 3px 20px;
}
table tr.even {
background-color: white;
color: #66666E;
}
table tr.odd {
background-color: #F6F6F6;
color: #66666E;
}
li {
margin-bottom: 10px;
padding-left: 12px;
}
.cpp {
display: block;
margin: 10;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
padding: 20px 0 20px 0;
}
.footer {
margin-top: 50px;
}
.memItemLeft {
padding-right: 3px;
}
.memItemRight {
padding: 3px 15px 3px 0;
}
.qml {
display: block;
margin: 10;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
padding: 20px 0 20px 0;
}
.qmldefault {
padding-left: 5px;
float: right;
color: red;
}
.qmlreadonly {
padding-left: 5px;
float: right;
color: #254117;
}
.rightAlign {
padding: 3px 5px 3px 10px;
text-align: right;
}
.title {
background-color: white;
color: #44A51C;
font-family: Verdana;
font-size: 35px;
font-weight: normal;
left: 0;
padding-bottom: 5px;
padding-left: 16px;
padding-top: 20px;
position: absolute;
right: 0;
top: 0;
}
.toc {
float: right;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #DDD;
margin: 0 20px 10px 10px;
padding: 20px 15px 20px 20px;
height: auto;
width: 200px;
}
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
** $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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt 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 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSERIALPORT_H
#define QSERIALPORT_H
#include <QtCore/qiodevice.h>
#include <qserialportglobal.h>
//#include <QtSerialPort/qserialportglobal.h>
QT_BEGIN_NAMESPACE
class QSerialPortInfo;
class QSerialPortPrivate;
class Q_SERIALPORT_EXPORT QSerialPort : public QIODevice
{
Q_OBJECT
Q_PROPERTY(qint32 baudRate READ baudRate WRITE setBaudRate NOTIFY baudRateChanged)
Q_PROPERTY(DataBits dataBits READ dataBits WRITE setDataBits NOTIFY dataBitsChanged)
Q_PROPERTY(Parity parity READ parity WRITE setParity NOTIFY parityChanged)
Q_PROPERTY(StopBits stopBits READ stopBits WRITE setStopBits NOTIFY stopBitsChanged)
Q_PROPERTY(FlowControl flowControl READ flowControl WRITE setFlowControl NOTIFY flowControlChanged)
Q_PROPERTY(DataErrorPolicy dataErrorPolicy READ dataErrorPolicy WRITE setDataErrorPolicy NOTIFY dataErrorPolicyChanged)
Q_PROPERTY(bool dataTerminalReady READ isDataTerminalReady WRITE setDataTerminalReady NOTIFY dataTerminalReadyChanged)
Q_PROPERTY(bool requestToSend READ isRequestToSend WRITE setRequestToSend NOTIFY requestToSendChanged)
Q_PROPERTY(SerialPortError error READ error RESET clearError NOTIFY error)
Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged)
Q_ENUMS( Directions Rate DataBits Parity StopBits FlowControl PinoutSignals DataErrorPolicy SerialPortError )
public:
enum Direction {
Input = 1,
Output = 2,
AllDirections = Input | Output
};
Q_DECLARE_FLAGS(Directions, Direction)
enum BaudRate {
Baud1200 = 1200,
Baud2400 = 2400,
Baud4800 = 4800,
Baud9600 = 9600,
Baud19200 = 19200,
Baud38400 = 38400,
Baud57600 = 57600,
Baud115200 = 115200,
UnknownBaud = -1
};
enum DataBits {
Data5 = 5,
Data6 = 6,
Data7 = 7,
Data8 = 8,
UnknownDataBits = -1
};
enum Parity {
NoParity = 0,
EvenParity = 2,
OddParity = 3,
SpaceParity = 4,
MarkParity = 5,
UnknownParity = -1
};
enum StopBits {
OneStop = 1,
OneAndHalfStop = 3,
TwoStop = 2,
UnknownStopBits = -1
};
enum FlowControl {
NoFlowControl,
HardwareControl,
SoftwareControl,
UnknownFlowControl = -1
};
enum PinoutSignal {
NoSignal = 0x00,
TransmittedDataSignal = 0x01,
ReceivedDataSignal = 0x02,
DataTerminalReadySignal = 0x04,
DataCarrierDetectSignal = 0x08,
DataSetReadySignal = 0x10,
RingIndicatorSignal = 0x20,
RequestToSendSignal = 0x40,
ClearToSendSignal = 0x80,
SecondaryTransmittedDataSignal = 0x100,
SecondaryReceivedDataSignal = 0x200
};
Q_DECLARE_FLAGS(PinoutSignals, PinoutSignal)
enum DataErrorPolicy {
SkipPolicy,
PassZeroPolicy,
IgnorePolicy,
StopReceivingPolicy,
UnknownPolicy = -1
};
enum SerialPortError {
NoError,
DeviceNotFoundError,
PermissionError,
OpenError,
ParityError,
FramingError,
BreakConditionError,
WriteError,
ReadError,
ResourceError,
UnsupportedOperationError,
UnknownError
};
explicit QSerialPort(QObject *parent = 0);
explicit QSerialPort(const QString &name, QObject *parent = 0);
explicit QSerialPort(const QSerialPortInfo &info, QObject *parent = 0);
virtual ~QSerialPort();
void setPortName(const QString &name);
QString portName() const;
void setPort(const QSerialPortInfo &info);
bool open(OpenMode mode) Q_DECL_OVERRIDE;
void close() Q_DECL_OVERRIDE;
void setSettingsRestoredOnClose(bool restore);
bool settingsRestoredOnClose() const;
bool setBaudRate(qint32 baudRate, Directions dir = AllDirections);
qint32 baudRate(Directions dir = AllDirections) const;
bool setDataBits(DataBits dataBits);
DataBits dataBits() const;
bool setParity(Parity parity);
Parity parity() const;
bool setStopBits(StopBits stopBits);
StopBits stopBits() const;
bool setFlowControl(FlowControl flow);
FlowControl flowControl() const;
bool setDataTerminalReady(bool set);
bool isDataTerminalReady();
bool setRequestToSend(bool set);
bool isRequestToSend();
PinoutSignals pinoutSignals();
bool flush();
bool clear(Directions dir = AllDirections);
bool atEnd() const Q_DECL_OVERRIDE;
bool setDataErrorPolicy(DataErrorPolicy policy = IgnorePolicy);
DataErrorPolicy dataErrorPolicy() const;
SerialPortError error() const;
void clearError();
qint64 readBufferSize() const;
void setReadBufferSize(qint64 size);
bool isSequential() const Q_DECL_OVERRIDE;
qint64 bytesAvailable() const Q_DECL_OVERRIDE;
qint64 bytesToWrite() const Q_DECL_OVERRIDE;
bool canReadLine() const Q_DECL_OVERRIDE;
bool waitForReadyRead(int msecs) Q_DECL_OVERRIDE;
bool waitForBytesWritten(int msecs) Q_DECL_OVERRIDE;
bool sendBreak(int duration = 0);
bool setBreakEnabled(bool set = true);
Q_SIGNALS:
void baudRateChanged(qint32 baudRate, QSerialPort::Directions dir);
void dataBitsChanged(QSerialPort::DataBits dataBits);
void parityChanged(QSerialPort::Parity parity);
void stopBitsChanged(QSerialPort::StopBits stopBits);
void flowControlChanged(QSerialPort::FlowControl flow);
void dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy);
void dataTerminalReadyChanged(bool set);
void requestToSendChanged(bool set);
void error(QSerialPort::SerialPortError serialPortError);
void settingsRestoredOnCloseChanged(bool restore);
protected:
qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE;
qint64 readLineData(char *data, qint64 maxSize) Q_DECL_OVERRIDE;
qint64 writeData(const char *data, qint64 maxSize) Q_DECL_OVERRIDE;
private:
void setError(QSerialPort::SerialPortError error, const QString &errorString = QString());
QSerialPortPrivate * const d_ptr;
Q_DECLARE_PRIVATE(QSerialPort)
Q_DISABLE_COPY(QSerialPort)
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QSerialPort::Directions)
Q_DECLARE_OPERATORS_FOR_FLAGS(QSerialPort::PinoutSignals)
QT_END_NAMESPACE
#endif // QSERIALPORT_H
INCLUDEPATH += $$PWD
unix {
CONFIG += link_pkgconfig
packagesExist(libudev) {
DEFINES += HAVE_LIBUDEV
PKGCONFIG += libudev
}
}
PUBLIC_HEADERS += \
$$PWD/qserialportglobal.h \
$$PWD/qserialport.h \
$$PWD/qserialportinfo.h
PRIVATE_HEADERS += \
$$PWD/qserialport_p.h \
$$PWD/qserialportinfo_p.h
SOURCES += \
$$PWD/qserialport.cpp \
$$PWD/qserialportinfo.cpp
win32 {
PRIVATE_HEADERS += \
$$PWD/qserialport_win_p.h
SOURCES += \
$$PWD/qserialport_win.cpp \
$$PWD/qserialportinfo_win.cpp
LIBS += -lsetupapi -ladvapi32
}
unix:!symbian {
PRIVATE_HEADERS += \
$$PWD/qttylocker_unix_p.h \
$$PWD/qserialport_unix_p.h
SOURCES += \
$$PWD/qttylocker_unix.cpp \
$$PWD/qserialport_unix.cpp \
$$PWD/qserialportinfo_unix.cpp
macx {
SOURCES += $$PWD/qserialportinfo_mac.cpp
LIBS += -framework IOKit -framework CoreFoundation
} else {
linux*:contains( DEFINES, HAVE_LIBUDEV ) {
LIBS += -ludev
}
}
}
HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
/****************************************************************************
**
** Copyright (C) 2011-2012 Denis Shienkov <denis.shienkov@gmail.com>
** Copyright (C) 2011 Sergey Belyashov <Sergey.Belyashov@gmail.com>
** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
** $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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt 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 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSERIALPORT_P_H
#define QSERIALPORT_P_H
#include "qserialport.h"
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <private/qringbuffer_p.h>
#else
#include "qt4support/qringbuffer_p.h"
#endif
QT_BEGIN_NAMESPACE
class QSerialPortPrivateData
{
Q_DECLARE_PUBLIC(QSerialPort)
public:
enum IoConstants {
ReadChunkSize = 512,
WriteChunkSize = 512
};
QSerialPortPrivateData(QSerialPort *q);
int timeoutValue(int msecs, int elapsed);
qint64 readBufferMaxSize;
QRingBuffer readBuffer;
QRingBuffer writeBuffer;
QSerialPort::SerialPortError error;
QString systemLocation;
qint32 inputBaudRate;
qint32 outputBaudRate;
QSerialPort::DataBits dataBits;
QSerialPort::Parity parity;
QSerialPort::StopBits stopBits;
QSerialPort::FlowControl flow;
QSerialPort::DataErrorPolicy policy;
bool dataTerminalReady;
bool requestToSend;
bool settingsRestoredOnClose;
QSerialPort * const q_ptr;
};
QT_END_NAMESPACE
#endif // QSERIALPORT_P_H
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
** $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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt 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 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSERIALPORT_SYMBIAN_P_H
#define QSERIALPORT_SYMBIAN_P_H
#include "qserialport_p.h"
#include <c32comm.h>
QT_BEGIN_NAMESPACE
class QSerialPortPrivate : public QSerialPortPrivateData
{
public:
QSerialPortPrivate(QSerialPort *q);
bool open(QIODevice::OpenMode mode);
void close();
QSerialPort::PinoutSignals pinoutSignals() const;
bool setDataTerminalReady(bool set);
bool setRequestToSend(bool set);
bool flush();
bool clear(QSerialPort::Directions dir);
bool sendBreak(int duration);
bool setBreakEnabled(bool set);
qint64 systemInputQueueSize () const;
qint64 systemOutputQueueSize () const;
qint64 bytesAvailable() const;
qint64 readFromBuffer(char *data, qint64 maxSize);
qint64 writeToBuffer(const char *data, qint64 maxSize);
bool waitForReadyRead(int msec);
bool waitForBytesWritten(int msec);
bool setBaudRate(qint32 baudRate, QSerialPort::Directions dir);
bool setDataBits(QSerialPort::DataBits dataBits);
bool setParity(QSerialPort::Parity parity);
bool setStopBits(QSerialPort::StopBits stopBits);
bool setFlowControl(QSerialPort::FlowControl flowControl);
bool setDataErrorPolicy(QSerialPort::DataErrorPolicy policy);
bool notifyRead();
bool notifyWrite();
static QString portNameToSystemLocation(const QString &port);
static QString portNameFromSystemLocation(const QString &location);
static qint32 baudRateFromSetting(qint32 setting);
static qint32 settingFromBaudRate(qint32 baudRate);
static QList<qint32> standardBaudRates();
TCommConfig currentSettings;
TCommConfig restoredSettings;
RComm descriptor;
mutable RTimer selectTimer;
TInt errnum;
private:
bool updateCommConfig();
void detectDefaultSettings();
QSerialPort::SerialPortError decodeSystemError() const;
bool waitForReadOrWrite(bool *selectForRead, bool *selectForWrite,
bool checkRead, bool checkWrite,
int msecs, bool *timedOut);
};
QT_END_NAMESPACE
#endif // QSERIALPORT_SYMBIAN_P_H
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
** $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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt 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 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSERIALPORT_UNIX_P_H
#define QSERIALPORT_UNIX_P_H
#include "qserialport_p.h"
#include <limits.h>
#include <termios.h>
#ifdef Q_OS_LINUX
# include <linux/serial.h>
#endif
QT_BEGIN_NAMESPACE
class QSocketNotifier;
class QSerialPortPrivate : public QSerialPortPrivateData
{
public:
QSerialPortPrivate(QSerialPort *q);
bool open(QIODevice::OpenMode mode);
void close();
QSerialPort::PinoutSignals pinoutSignals() const;
bool setDataTerminalReady(bool set);
bool setRequestToSend(bool set);
bool flush();
bool clear(QSerialPort::Directions dir);
bool sendBreak(int duration);
bool setBreakEnabled(bool set);
qint64 systemInputQueueSize () const;
qint64 systemOutputQueueSize () const;
qint64 bytesAvailable() const;
qint64 readFromBuffer(char *data, qint64 maxSize);
qint64 writeToBuffer(const char *data, qint64 maxSize);
bool waitForReadyRead(int msecs);
bool waitForBytesWritten(int msecs);
bool setBaudRate(qint32 baudRate, QSerialPort::Directions dir);
bool setDataBits(QSerialPort::DataBits dataBits);
bool setParity(QSerialPort::Parity parity);
bool setStopBits(QSerialPort::StopBits stopBits);
bool setFlowControl(QSerialPort::FlowControl flow);
bool setDataErrorPolicy(QSerialPort::DataErrorPolicy policy);
bool readNotification();
bool writeNotification(int maxSize = INT_MAX);
bool exceptionNotification();
static QString portNameToSystemLocation(const QString &port);
static QString portNameFromSystemLocation(const QString &location);
static qint32 baudRateFromSetting(qint32 setting);
static qint32 settingFromBaudRate(qint32 baudRate);
static QList<qint32> standardBaudRates();
struct termios currentTermios;
struct termios restoredTermios;
#ifdef Q_OS_LINUX
struct serial_struct currentSerialInfo;
struct serial_struct restoredSerialInfo;
#endif
int descriptor;
bool isCustomBaudRateSupported;
QSocketNotifier *readNotifier;
QSocketNotifier *writeNotifier;
QSocketNotifier *exceptionNotifier;
bool readPortNotifierCalled;
bool readPortNotifierState;
bool readPortNotifierStateSet;
bool emittedReadyRead;
bool emittedBytesWritten;
private:
bool updateTermios();
void detectDefaultSettings();
QSerialPort::SerialPortError decodeSystemError() const;
bool isReadNotificationEnabled() const;
void setReadNotificationEnabled(bool enable);
bool isWriteNotificationEnabled() const;
void setWriteNotificationEnabled(bool enable);
bool isExceptionNotificationEnabled() const;
void setExceptionNotificationEnabled(bool enable);
bool waitForReadOrWrite(bool *selectForRead, bool *selectForWrite,
bool checkRead, bool checkWrite,
int msecs, bool *timedOut);
qint64 readFromPort(char *data, qint64 maxSize);
qint64 writeToPort(const char *data, qint64 maxSize);
#ifndef CMSPAR
qint64 writePerChar(const char *data, qint64 maxSize);
#endif
qint64 readPerChar(char *data, qint64 maxSize);
};
QT_END_NAMESPACE
#endif // QSERIALPORT_UNIX_P_H
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
** $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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt 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 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSERIALPORT_WIN_P_H
#define QSERIALPORT_WIN_P_H
#include "qserialport_p.h"
#include <qt_windows.h>
#ifndef Q_OS_WINCE
#include <QtCore/qhash.h>
QT_BEGIN_NAMESPACE
class QWinEventNotifier;
#else
#include <QtCore/qmutex.h>
QT_BEGIN_NAMESPACE
class QThread;
#endif
#ifndef Q_OS_WINCE
class AbstractOverlappedEventNotifier;
#endif
class QSerialPortPrivate : public QSerialPortPrivateData
{
public:
QSerialPortPrivate(QSerialPort *q);
bool open(QIODevice::OpenMode mode);
void close();
QSerialPort::PinoutSignals pinoutSignals() const;
bool setDataTerminalReady(bool set);
bool setRequestToSend(bool set);
bool flush();
bool clear(QSerialPort::Directions dir);
bool sendBreak(int duration);
bool setBreakEnabled(bool set);
qint64 systemInputQueueSize () const;
qint64 systemOutputQueueSize () const;
qint64 bytesAvailable() const;
qint64 readFromBuffer(char *data, qint64 maxSize);
qint64 writeToBuffer(const char *data, qint64 maxSize);
bool waitForReadyRead(int msec);
bool waitForBytesWritten(int msec);
bool setBaudRate(qint32 baudRate, QSerialPort::Directions dir);
bool setDataBits(QSerialPort::DataBits dataBits);
bool setParity(QSerialPort::Parity parity);
bool setStopBits(QSerialPort::StopBits stopBits);
bool setFlowControl(QSerialPort::FlowControl flowControl);
bool setDataErrorPolicy(QSerialPort::DataErrorPolicy policy);
bool processIoErrors(bool error);
#ifndef Q_OS_WINCE
bool startAsyncRead();
bool startAsyncWrite(int maxSize = INT_MAX);
bool completeAsyncRead(DWORD numberOfBytes);
bool completeAsyncWrite(DWORD numberOfBytes);
AbstractOverlappedEventNotifier *lookupFreeWriteCompletionNotifier();
AbstractOverlappedEventNotifier *lookupCommEventNotifier();
AbstractOverlappedEventNotifier *lookupReadCompletionNotifier();
#else
bool notifyRead();
bool notifyWrite(int maxSize = INT_MAX);
#endif
static QString portNameToSystemLocation(const QString &port);
static QString portNameFromSystemLocation(const QString &location);
static qint32 baudRateFromSetting(qint32 setting);
static qint32 settingFromBaudRate(qint32 baudRate);
static QList<qint32> standardBaudRates();
DCB currentDcb;
DCB restoredDcb;
COMMTIMEOUTS currentCommTimeouts;
COMMTIMEOUTS restoredCommTimeouts;
HANDLE descriptor;
bool parityErrorOccurred;
#ifndef Q_OS_WINCE
QHash<HANDLE, AbstractOverlappedEventNotifier *> notifiers;
qint64 actualReadBufferSize;
qint64 actualWriteBufferSize;
qint64 acyncWritePosition;
bool readyReadEmitted;
bool writeSequenceStarted;
#else
QThread *eventNotifier;
QMutex settingsChangeMutex;
#endif
private:
bool updateDcb();
bool updateCommTimeouts();
void detectDefaultSettings();
QSerialPort::SerialPortError decodeSystemError() const;
#ifndef Q_OS_WINCE
bool waitAnyEvent(int msecs, bool *timedOut,
AbstractOverlappedEventNotifier **triggeredNotifier);
#else
bool waitForReadOrWrite(bool *selectForRead, bool *selectForWrite,
bool checkRead, bool checkWrite,
int msecs, bool *timedOut);
#endif
};
QT_END_NAMESPACE
#endif // QSERIALPORT_WIN_P_H
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
** $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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt 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 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSERIALPORTGLOBAL_H
#define QSERIALPORTGLOBAL_H
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
#ifndef QT_STATIC
# if defined(QT_BUILD_SERIALPORT_LIB)
# define Q_SERIALPORT_EXPORT Q_DECL_EXPORT
# else
//# define Q_SERIALPORT_EXPORT Q_DECL_IMPORT
# endif
#else
# define Q_SERIALPORT_EXPORT
#endif
# define Q_SERIALPORT_EXPORT
// The macro has been available only since Qt 5.0
#ifndef Q_DECL_OVERRIDE
#define Q_DECL_OVERRIDE
#endif
QT_END_NAMESPACE
#endif // QSERIALPORTGLOBAL_H
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
QT = core
QMAKE_DOCS = $$PWD/doc/qtserialport.qdocconf
include($$PWD/serialport-lib.pri)
greaterThan(QT_MAJOR_VERSION, 4) {
load(qt_build_config)
QT += core-private
TARGET = QtSerialPort
load(qt_module)
} else {
TEMPLATE = lib
TARGET = $$qtLibraryTarget(QtSerialPort$$QT_LIBINFIX)
include($$PWD/qt4support/install-helper.pri)
CONFIG += module create_prl
mac:QMAKE_FRAMEWORK_BUNDLE_NAME = $$TARGET
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment