2 years agoMark the signal QSP::settingsRestoredOnCloseChanged() as deprecated 5.5
Denis Shienkov [Tue, 12 May 2015 12:45:22 +0000 (15:45 +0300)]
Mark the signal QSP::settingsRestoredOnCloseChanged() as deprecated

This was missed since Qt 5.3.

Change-Id: Ifb00421dec915682fd35587128aae6bd36bd9c9e
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoAdd the missed macro QT_DEPRECATED for QSP::sendBreak()
Denis Shienkov [Tue, 12 May 2015 12:41:37 +0000 (15:41 +0300)]
Add the missed macro QT_DEPRECATED for QSP::sendBreak()

Change-Id: Iba0b5a63d225a469fd70125a90e306ef67f68cb9
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoMark the signal QSP::dataErrorPolicyChanged() as deprecated
Denis Shienkov [Tue, 12 May 2015 12:33:36 +0000 (15:33 +0300)]
Mark the signal QSP::dataErrorPolicyChanged() as deprecated

This was missed since Qt 5.2.

Task-number: QTBUG-46066
Change-Id: I105728382a682def9bbecbf1e33d28bfff00a6e8
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoAllow to open the device when using the App Sandbox on OSX
Denis Shienkov [Thu, 7 May 2015 17:55:39 +0000 (20:55 +0300)]
Allow to open the device when using the App Sandbox on OSX

When running the App Sandbox, a system has no any temporary directories
which can be shared between applications (or, maybe, it is configurable

* https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html

In this case QSP::open() can not create a lock file that lead to fails
when opening.

Workaround it is to use the
QStandardPaths::writableLocation(QStandardPaths::TempLocation) for receiving
a temporal directory of application. Where the writableLocation() implicitly
uses the NSTemporaryDirectory function that is the recommended way
(see "The App Sandbox Container Directory") in here:

* https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW4

This will allow to open the serial port, but the locking feature will not
work properly.

Task-number: QTBUG-45338
Change-Id: Iea52aada11493126b0f58c40488c38c86f69fca5
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoRemove the QT_VERSION_CHECK(5, 0, 0) macro v5.5.0-beta1
Denis Shienkov [Sat, 18 Apr 2015 17:52:27 +0000 (20:52 +0300)]
Remove the QT_VERSION_CHECK(5, 0, 0) macro

... since current branch supports only Qt5.

Change-Id: I2aaf4261b307eb6ca7ae32e94ddaf7801395f022
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoCleanup an error string when QSP::clearError() is called
Denis Shienkov [Sat, 18 Apr 2015 15:06:14 +0000 (18:06 +0300)]
Cleanup an error string when QSP::clearError() is called

QSP::clearError() calls setError() with an empty error string.
But setError() anyway calls the qt_error_string() that sets an
error string from an system error which occurred before, that
is garbage in this case.

Thus, we need to call qt_error_string() only if the input
QSP::SerialPortError is not NoError.

Change-Id: I0260159d74579de47bcf1c7b2f4e747be6817269
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoRemove unused readyReadEmitted variable
Denis Shienkov [Sat, 18 Apr 2015 12:00:02 +0000 (15:00 +0300)]
Remove unused readyReadEmitted variable

Change-Id: I2313bd6160ffe18766b50257957b2cc66834290d
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoAdd additional lock directories for *nix-specific platforms
Denis Shienkov [Thu, 2 Apr 2015 18:17:14 +0000 (21:17 +0300)]
Add additional lock directories for *nix-specific platforms

Change-Id: I3943ff6b8fee2f651317ddbaa40ef0d27dac6475
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
2 years agoDon't use QStringLiteral when QLatin1String is efficient.
Debao Zhang [Thu, 26 Mar 2015 07:41:50 +0000 (15:41 +0800)]
Don't use QStringLiteral when QLatin1String is efficient.

For QLatin1String, startsWith/endsWith/append/operator==/... are overloaded,
so use QLatin1String instead of QStringLiteral in such cases.

Change-Id: Id040697480b7b7f195a2b83bb85ba7e0199d38e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoFix QSPI::portName() on OSX
Denis Shienkov [Fri, 13 Mar 2015 20:48:53 +0000 (00:48 +0400)]
Fix QSPI::portName() on OSX

The commit ab51ad6a5f4e533c31bd8e5b6f16a3bcd09a3ee6 changes a behavior
of conversion from a device location to a device name and vice-versa.
Now it is expected that the location as "/dev/cu.serial1" will be
converted to the "cu.serial1" name and vice-versa. But currently the
QSPI on OSX returns the name of device as "serial1" instead of
"cu.serial1", that lead to failure of QSP::open() method.

The reason is that a device name is queried from the dictionary with the
"kIOTTYDeviceKey" key, which always returns a right part of name from a
dot. Thus, we need to use QSPI::portNameFromSystemLocation() method

Change-Id: Id7dfb2476c4a52a4c320c64588341fe6d0a5fa7d
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoRemove space between "if/elif defined" macro and its bracket
Denis Shienkov [Wed, 11 Mar 2015 20:01:45 +0000 (23:01 +0300)]
Remove space between "if/elif defined" macro and its bracket

It is the recommended coding-style which is used in the Qt core.

Change-Id: Id2efc3b2276b2d86d75fe0b7240077dbb61286f0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoMake QSP::timeoutValue() as static
Denis Shienkov [Wed, 11 Mar 2015 20:15:26 +0000 (23:15 +0300)]
Make QSP::timeoutValue() as static

Change-Id: I9f11be6f1de66af70e84a00943d8cc75909e4956
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoGet rid of C-style's SERIALPORT_BUFFERSIZE macro
Denis Shienkov [Wed, 11 Mar 2015 20:12:40 +0000 (23:12 +0300)]
Get rid of C-style's SERIALPORT_BUFFERSIZE macro

It is reasonable make it as enum and part of QSP class.

Change-Id: I13d4561568b2688f7d1a054073455c23a64c1b94
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoUnix: Clear serial_struct instances v5.5.0-alpha1
Jonathan Liu [Mon, 9 Mar 2015 11:35:56 +0000 (22:35 +1100)]
Unix: Clear serial_struct instances

Silences the following Valgrind warning:
Conditional jump or move depends on uninitialised value(s)

Change-Id: I8fd8cfd6aa6f75ed515e6151cfc282faca508bdc
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoFix warning about constructing a QString from ASCII.
Friedemann Kleint [Tue, 3 Mar 2015 11:18:59 +0000 (12:18 +0100)]
Fix warning about constructing a QString from ASCII.

Change-Id: I3baab25e299862ef1dcefe1725577302c35e6118
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoFix reading on Windows with the limited read buffer
Denis Shienkov [Sun, 1 Mar 2015 15:59:44 +0000 (18:59 +0300)]
Fix reading on Windows with the limited read buffer

The previous commit ac0422e8c9e74f2275129e3c7c69ef64299f07a9
already fix this issue on 5.4 branch, but in 5.5 branch this
issue is appeared again.

The reason is that in 5.5 branch is used the private read buffer
from the QIODevice, but in 5.4 branch is used the own read buffer.

In 5.5 when called the QSP::readData() then it always returns an
empty buffer, since the buffer is already read inside of QIODevice.
In this case the QSP::startAsyncRead() is never called, because a
condition in the QSP::readData() is always false. Need to call the
QSP::startAsyncRead() only if the buffer has a limited size or in
the HardwareFlow mode.

Tested on Windows 8 with the virtual com0com serial ports.

Change-Id: Idc1893f5be5034f89fc7a8fdc654a8375679c21d
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoAdd the missed PORT_UNKNOWN macro for Android OS
Denis Shienkov [Thu, 26 Feb 2015 23:40:19 +0000 (23:40 +0000)]
Add the missed PORT_UNKNOWN macro for Android OS

This macro was missed in 5.5 branch, this causes a break of building.

Change-Id: I0e79e6c6cb6c347356c449959b1cf14755a42eb1
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into 5.5
Frederik Gladhorn [Fri, 20 Feb 2015 14:55:55 +0000 (15:55 +0100)]
Merge remote-tracking branch 'origin/5.4' into 5.5


Change-Id: Ibb917652b132e66fbb90f437bf762c1094911dc0

3 years agobic: Add/Replace 5.{1,2,3,4}.0 bic data for linux-gcc-amd64 5.4.2
Sergio Ahumada [Wed, 11 Feb 2015 14:34:35 +0000 (15:34 +0100)]
bic: Add/Replace 5.{1,2,3,4}.0 bic data for linux-gcc-amd64

Remove the ia32 data since there are no linux x86 machines in
the CI system (which makes the data useless from an automated
testing point of view) and most people use x64 these days anyway.

Change-Id: If43f9164f94662dc7f7160babb9e3de709078fec
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
3 years agoUpdate copyright headers
Jani Heikkinen [Fri, 13 Feb 2015 05:49:31 +0000 (07:49 +0200)]
Update copyright headers

Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I35f551de8408a2eb6a0f39df1f09d90c8084a7c0
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoMerge remote-tracking branch 'origin/5.4.1' into 5.4
Frederik Gladhorn [Tue, 10 Feb 2015 09:35:48 +0000 (10:35 +0100)]
Merge remote-tracking branch 'origin/5.4.1' into 5.4

Change-Id: I32d198d0259ec984df78df89c4bd3a6d7cb026dc

3 years agoMerge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Frederik Gladhorn [Tue, 20 Jan 2015 11:33:16 +0000 (12:33 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev

3 years agoDoc: Fix the examples page
Topi Reinio [Mon, 19 Jan 2015 14:09:57 +0000 (15:09 +0100)]
Doc: Fix the examples page

The group page listing all the examples defined also
a \page name, which caused the generated page to
contain no examples.

Also correct the group name for Command Line Enumerator
Example, and move the qtserialport-examples.qdoc to
the correct location.

Change-Id: I6ebfbe1c49d2a44e4ed631f22027659ba43ceb8d
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Thu, 27 Nov 2014 17:38:10 +0000 (18:38 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev


Change-Id: Ifaa5ce8c1c0eb1c70246c54782719b91f3c95771

3 years agoEdit changelog for 5.4.1 version v5.4.1
Leena Miettinen [Mon, 19 Jan 2015 10:00:42 +0000 (11:00 +0100)]
Edit changelog for 5.4.1 version

Fix grammar, spelling, and style issues.

Change-Id: I98f8429f200d24633f504f6ea701509555da38a1
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoDoc: added dependencies to qdocconf file
Nico Vertriest [Fri, 16 Jan 2015 14:50:35 +0000 (15:50 +0100)]
Doc: added dependencies to qdocconf file

Task-number: QTBUG-43810
Change-Id: Iaaeea833a78af467f8ccb56ffc1de613aa3d2c35
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoAdd changelog for 5.4.1 version
Denis Shienkov [Sat, 17 Jan 2015 10:34:21 +0000 (13:34 +0300)]
Add changelog for 5.4.1 version

Change-Id: I7623182c1ce1eecd724a2b4e8593f75a1ac49cc9
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoBump version
Oswald Buddenhagen [Fri, 16 Jan 2015 20:06:59 +0000 (21:06 +0100)]
Bump version

Change-Id: Ibd1acdaeaaf3ccb5e097958fed6b33749a02442f

3 years agoSkip the constructByInfo() test if no serial ports are found on *nix
Denis Shienkov [Sun, 4 Jan 2015 16:11:27 +0000 (16:11 +0000)]
Skip the constructByInfo() test if no serial ports are found on *nix

In unix-like systems it is possible to use socat to creation of the
virtual serial ports. But these devices are symlinks on the /dev/pts
devices, that is not a serial ports. Thus QSPI can not find it and will
construct a null object. In this case this is not an error and we need
just to skip test.

Change-Id: I59bbb3c4653555be39ea6fff903c386065c10d0a
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoImprove usage of the break state for the Tx line
Denis Shienkov [Tue, 30 Dec 2014 10:38:05 +0000 (13:38 +0300)]
Improve usage of the break state for the Tx line

1. Now the sendBreak() method is deprecated since it is blocking and
impossible to implement same behavior on different platforms using
their API's. Besides, this method can be implemented via
setBreakEnabled() and QTimer.

2. Introduced the new property named as "breakEnabled" which consist
of setBreakEnabled() and isBreakEnabled() methods and the signal

Note: After opening, the port always is in non-break state.

Task-number: QTBUG-36571
Change-Id: Ib808dab7eaed8cc5449c66d8186a29a7b7e45afc
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoShare the clearReceiver() function and for the *nix tests
Denis Shienkov [Sun, 4 Jan 2015 16:32:57 +0000 (16:32 +0000)]
Share the clearReceiver() function and for the *nix tests

The waitForReadyReadWithTimeout() test is failed when using the socat
utility. The reason is that the receiver's side receive data from the
previous waitForBytesWritten() test, even the receiver was closed and
re-opened again in the new test. We need suppress this behavior using
the clearReceiver() function when starting of
waitForReadyReadWithTimeout() test.

Change-Id: I6735aa9c9744ec1732f9bd4f701068a540ae2316
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoDo not touch of the read notifier after its creation
Denis Shienkov [Sun, 4 Jan 2015 17:03:53 +0000 (17:03 +0000)]
Do not touch of the read notifier after its creation

When are used the multiple opening and closing chains, then a read
notification can be stalled. The reason is in old heritage of a code
related to preventing of recursive calls. Thus, need just to remove this
old code. It is not the in-depth investigation of an issue but just a
workaround which can be improved in future.

Tested on Linux with on-board and socat serial ports using Qt5.

Task-number: QTBUG-43484
Change-Id: I04556fdde2775448b33d68f141f4328647c549c9
Reviewed-by: Laszlo Papp <lpapp@kde.org>
3 years agoRemove README file.
Jeff Tranter [Tue, 23 Dec 2014 18:20:40 +0000 (13:20 -0500)]
Remove README file.

Remove the README file as it is empty.

Change-Id: Icd252062c00d81a28a41d910161a4e56d2934493
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoMerge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4
Frederik Gladhorn [Wed, 17 Dec 2014 12:02:30 +0000 (13:02 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4

3 years agoMerge remote-tracking branch 'origin/5.4.0' into 5.4
Frederik Gladhorn [Wed, 17 Dec 2014 11:59:10 +0000 (12:59 +0100)]
Merge remote-tracking branch 'origin/5.4.0' into 5.4

Change-Id: Ic608866ccf52db4cd42bc2563a040d9cbd47d684

3 years agoMerge remote-tracking branch 'origin/5.3' into 5.4
Frederik Gladhorn [Wed, 17 Dec 2014 11:49:35 +0000 (12:49 +0100)]
Merge remote-tracking branch 'origin/5.3' into 5.4

Change-Id: I078c03570399f5212b660b7ed29d3e45ed995896

3 years agoBump version
Oswald Buddenhagen [Fri, 12 Dec 2014 12:48:46 +0000 (13:48 +0100)]
Bump version

Change-Id: Id5237f32002f15c64ff41e59e19c6308cc1eb2b5

3 years agoUse Q_NULLPTR where it is possible
Denis Shienkov [Tue, 9 Dec 2014 20:19:44 +0000 (23:19 +0300)]
Use Q_NULLPTR where it is possible

Change-Id: I7261a92ea4405c8aeab7670f73e7225ed7e4d9d0
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoDo not use internal pre-cached RTS and DTR variables
Denis Shienkov [Fri, 5 Dec 2014 09:57:48 +0000 (12:57 +0300)]
Do not use internal pre-cached RTS and DTR variables

Some devices do not support these signals, and returns an errors when attempt
to query it. But the QSP::open() always requests a status of these lines.
In this case the QSP::open() will return true, but also will setup an error
code (for example, QSP::UnsupportedOperationError for socat's devices in
Linux). That is unexpected behavior for the user.

It is reasonable do not query a state of these signals when opening.
Also we do not need to use of appropriate internal variables, and we can
remove it.

Change-Id: I277110014c20c1f2c3fdaed20c4582d1356897b9
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoInterpret ENOTTY as UnsupportedOperationError instead of ResourceError
Denis Shienkov [Thu, 4 Dec 2014 19:57:11 +0000 (22:57 +0300)]
Interpret ENOTTY as UnsupportedOperationError instead of ResourceError

The ENOTTY is closer to QSP::UnsupportedOperationError, because it
is decoded as "Inappropriate ioctl for device".

Change-Id: Ibcbe09e201eeb5ede6daa417654a181dd380df5a
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoDetect of Bluetooth SPP (rfcomm) device with SysFs
Denis Shienkov [Thu, 4 Dec 2014 13:14:51 +0000 (16:14 +0300)]
Detect of Bluetooth SPP (rfcomm) device with SysFs

Change-Id: I41d67e9ca8d9cb6042b4d8de756a22d18b077dcd
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoSetup an error when QSP::setBaudRate() fails on Unix
Denis Shienkov [Thu, 4 Dec 2014 10:36:04 +0000 (13:36 +0300)]
Setup an error when QSP::setBaudRate() fails on Unix

Inside of a method is missed setup of an error code, therefore always
returns QSP::UnknownError (or some previous error).

Tested on Linux with USB PL2303, using Terminal example (when trying to
setup of an unsupported 14400 baud rate).

Change-Id: I6b3143dd6d451a32024a5ca5239dac826ceb7af6
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoMark a device as open only after all settings was aplied
Denis Shienkov [Thu, 4 Dec 2014 10:22:47 +0000 (13:22 +0300)]
Mark a device as open only after all settings was aplied

Otherwise it lead to emmiting of the QSP::NotOpenError in case we close
a device from a slot, which is connected to QSP::SerialPortError signal.
In this case QSP::close() called twice: from the slot, and from the
QSP::open() method (this behavior can be reproduced with Terminal

So, inside of QSP::open() we need to move QIODevice::open() down, and
instead of QSP::close() to use QSPP::close().

Tested on Linux with USB PL2303 with trying to setup an unsupported
baud rate as 14400 baud.

Change-Id: I12dec085423dd9f5a08b7884f32dd2ba8aa8c951
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoDo not close closed device in Terminal example
Denis Shienkov [Thu, 4 Dec 2014 09:56:13 +0000 (12:56 +0300)]
Do not close closed device in Terminal example

When opening is fails, the QSP himself close a device. Thus, we do not
need to close device in Terminal example again, because it caused
emmiting of the QSP::NotOpenError and to showing of additional

Change-Id: Id8aa3f3b835fd7d4187bdf83c1d6584d5fd541f7
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoDetect a valid of serial8250 ports
Denis Shienkov [Sat, 29 Nov 2014 16:23:33 +0000 (16:23 +0000)]
Detect a valid of serial8250 ports

Usually, a Linux kernel reserves a places for the non-PnP serial
devices, for example, such as ttyS[0-4/14]. In case the system has not a
HW devices which are attached to this places, then these devices will be
stubs and present as usual serial ports. Thus, we can know about a
validity of these devices only in attempt to open them and to query a
type of.

Note: This patch is theoretical, because are not tested for a valid 8250

Task-number: QTBUG-32024
Change-Id: I313145caadfeeee4d5fe3c8e16c1bcf4ae79214d
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoImprove QSPI sysfs algorithm
Denis Shienkov [Sat, 29 Nov 2014 00:14:37 +0000 (00:14 +0000)]
Improve QSPI sysfs algorithm

Earlier, the algorithm used check for magic keywords (like "usb",
"platform" and so on) in the target path for decision-making what
of device can be skipped or accepted. But this is a wrong approach,
because on different platforms can be different key-words and we
can not know it. So, it is more reasonable to use a different
approach where we make decision by a driver name (by analogy with
current udev implementation). In this case we skip those devices
which has an empty driver name or when a name is equal to

* When a driver name is empty, then we can be sure that it is
other than serial port device (e.g. as pseudo-terminal, console
and so on). Thus, it is similar to udev devices without a parent,
which we ignore.

* When a driver name is "serial8250", it is equal to "platform"
devices, which we too ignore for current implementation. Though in
a future this can be solved (i.e. we can try to detect a valid
devices based on "serial8250" driver).

Tested on Linux with on-board and USB serial ports using Qt5.

Change-Id: I884ad8f3fddff9487ad4a67c4904b57f62164e00
Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoMake QSPI udev functions more readable
Denis Shienkov [Fri, 28 Nov 2014 21:48:56 +0000 (21:48 +0000)]
Make QSPI udev functions more readable

Change-Id: I5c33421338e6a64dbadeb168cf165a84bedec5b9
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoImprove QSPI algorithm on Unix
Denis Shienkov [Fri, 28 Nov 2014 21:25:36 +0000 (21:25 +0000)]
Improve QSPI algorithm on Unix

QSPI uses the wrong algorithm of devices search. In case no any devices
are detected with udev (or with sysfs), starts a search with a filters.
In this case a user gets a list of devices that are not a serial ports,
that is wrong.

The main idea should be in that udev or sysfs are the main sources of
obtaining information. In case they returns an empty list this means
that system has no serial ports.

Algorithm is:

Try to find devices through udev. If it fails (system error or udev is
not present), then try to find using sysfs; otherwise return udev result,
even if it has an empty list. If sysfs is fails (permission denied or
sysfs is not present), then try to find devices in /dev/ as last attempt;
otherwise return sysfs result, even if it has an empty list.

Tested on Linux (with udev, sysfs, filters) using FTDI serial ports.

Change-Id: I0132e27f720b007ea3f4861e9cd7ed77833cff8c
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoAdd scroll area to Enumerator example
Denis Shienkov [Mon, 1 Dec 2014 11:30:57 +0000 (14:30 +0300)]
Add scroll area to Enumerator example

When a system has many serial ports, the last of them are
not visible on the screen, because a widget has a big height.
So, it is reasonable to add scrolling of all serial ports info.

Change-Id: Ic13b58fba38a17d6f5142476bca501a0d26ec76d
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoTranslate serial port settings of Terminal example
Denis Shienkov [Mon, 1 Dec 2014 10:51:46 +0000 (13:51 +0300)]
Translate serial port settings of Terminal example

Change-Id: Ica127147999eaecc3d03189cfa9cd893115b846c
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoAllow to setup custom device in Terminal example
Denis Shienkov [Thu, 27 Nov 2014 13:18:42 +0000 (16:18 +0300)]
Allow to setup custom device in Terminal example

Terminal example allows to select only available devices which are
received from QSPI. Now it is possible to enter and to open of any
custom device.

Change-Id: I83172a346cb5dc0e20c217957133e9e3e506d8a4
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoAutotest misconfiguration error message is more verbose
Sergey Belyashov [Mon, 1 Dec 2014 08:38:28 +0000 (11:38 +0300)]
Autotest misconfiguration error message is more verbose

Error message about missing environment variables generates list of
required variables.

Change-Id: Icbb680abbd9fc5d0549907b7399757d943c6d535
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoRemove foreign records from 5.4.0 changes v5.4.0
Denis Shienkov [Fri, 28 Nov 2014 10:20:35 +0000 (13:20 +0300)]
Remove foreign records from 5.4.0 changes

To this changelog were added wrong changes from 5.4.1.

Change-Id: I77cc5abb7d537dda3859969d18fb22546cf466ec
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoSimplify and improve the QSP::TimeoutError handling
Denis Shienkov [Fri, 21 Nov 2014 21:14:12 +0000 (00:14 +0300)]
Simplify and improve the QSP::TimeoutError handling

It is reasonable to get rid of duplicating a code of TimeoutError
handling. A common parts of a code can be moved to one place.
Also, can be improved some of related if/else conditions.

Tested on Windows 8 and Linux with virtual serial ports.

Change-Id: I63112727faf42d4357f64f3450ea422167eaee90
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoHandle EINVAL, ENOIOCTLCMD, ENOTTY and EPERM errors
Denis Shienkov [Thu, 27 Nov 2014 22:21:22 +0000 (22:21 +0000)]

According to TTY_IOCTL(4), the ioctl on tty device can return these
errors, which we need to interpret to QSP::SerialPortError.

For example, a virtual devices which are created by SOCAT, returns the
EINVAL error when the ioctl does query of line states.

Change-Id: Iece3b773fdc8fe4b97951ccf7cff9d2670f24694
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoAdd changelog for Qt 5.4.0
Denis Shienkov [Thu, 27 Nov 2014 13:23:32 +0000 (16:23 +0300)]
Add changelog for Qt 5.4.0

Change-Id: I7c15897db3429df3a0d122893662c20ede4c8f66
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoRefactor and add missed changes up 5.2.0 to 5.3.2 5.3
Denis Shienkov [Wed, 8 Oct 2014 16:14:11 +0000 (20:14 +0400)]
Refactor and add missed changes up 5.2.0 to 5.3.2

Change-Id: I8a3c40202a89cd1fd264e324e6379d1f6220c340
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoImprove the QSP::clear() on Windows
Denis Shienkov [Fri, 10 Oct 2014 18:41:24 +0000 (22:41 +0400)]
Improve the QSP::clear() on Windows

Commit 9c88ad89801596e1d94acc4f32ff55c34118a66f solves a problem
partially. Still when used QSP::clear() with some devices (e.g.
virtual ports from the "AGG Software") the reading can be stalled.

It is reasonable to make following:

1. Prevent to reset the both readStarted and writeStarted variables
inside of QSP::clear() method. These variables shall be reset inside
of _q_completeXX() methods which will be called automatically from the
notifiers, since the PurgeComm should terminate pending read or write

2. Instead of startAsyncRead() should be called the
startAsyncCommunication(), that allow to correctly startup of the read

This scenario can be reproduced with running of the
tst_QSerialPort::readAfterInputClear() autotest.

Tested on Windows 8 with the virtual com0com ports and with the
virtual ports from the "AGG Software" using Qt5.

Change-Id: Ic1a53334abd97667a9dd3291c3b975eb04062efd
Reviewed-by: Robert Kurjata <rkurjata@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoPrevent multiple calls of WaitCommEvent
Denis Shienkov [Fri, 10 Oct 2014 17:51:12 +0000 (21:51 +0400)]
Prevent multiple calls of WaitCommEvent

Commit ac0422e8c9e74f2275129e3c7c69ef64299f07a9 introduced a regression
that QSP::startAsyncCommunication() was called twice when a limited read
buffer is used. In the second call the WaitCommEvent function returned the
ERROR_INVALID_PARAMETER error that lead to a stall of the read sequence.

QSP::startAsyncCommunication() should be called only when the read buffer
has enough space.

Tested on Windows 8 with the virtual com0com ports using Qt5.

Change-Id: Icd6cada7c3acfd4e689ac76ec304416b00f52b50
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoFix critical typo with _q_startAsyncWrite()
Denis Shienkov [Fri, 24 Oct 2014 13:36:01 +0000 (17:36 +0400)]
Fix critical typo with _q_startAsyncWrite()

Commit 62dfdeb3642250bdb642dbf607a8c7b95e57835e introduce a
critical typo that revert a bug which are fixed in the
b4d5bd813f591dc618e0fff2d55d93eeccb1a26e commit.

Change-Id: I9ed29f5b443cbd7102878287d531d18a9351a2e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
3 years agoClose the handle for the events that were created
Andy Shaw [Thu, 27 Nov 2014 11:24:17 +0000 (12:24 +0100)]
Close the handle for the events that were created

The handles should be closed when QSerialPort is deleted in order to clean
up the native resources.

Change-Id: If04521fc0fa3b898093bda3317962b4c44818034
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoUse QWinOverlappedIoNotifier instead of QWinEventNotifier
Denis Shienkov [Fri, 21 Nov 2014 19:20:41 +0000 (22:20 +0300)]
Use QWinOverlappedIoNotifier instead of QWinEventNotifier

The reasons of this change are following:

1) Implementation of QEventDispatcherWin32 has restrictions to
maximum quantity of QWinEvenNotifier instances in one thread.

Method QEventDispatcherWin32::registerEventNotifier() registers
the [MAXIMUM_WAIT_OBJECTS - 2] numbers of notifiers only. Where
the MAXIMUM_WAIT_OBJECTS that is equal to 64, since it is a part
of "Multiple-object Wait Functions" API:


2) There is need to have three instances of QWinEventNotifier to
watch I/O events of each serial port.

It has limits to the maximum number of used serial ports and it
is [(MAXIMUM_WAIT_OBJECTS - 2) / 3] = 20 for the one thread.

3) Attempting to move or to resize a window of GUI application
lead to suspending of I/O events from serial port.

A long suspension can lead to overflowing of FIFO of device, so
the data can be lost.

All these shortcomings are resolved with QWinOverlappedIoNotifier,
which uses the "I/O Completion Ports" API:


Tested on Windows 8 with the virtual (com0com), on-board and
the USB (PL2303) serial ports.

Task-number: QTBUG-34946
Change-Id: I879d939f86c8dcde0fe21a8d6267e81152822aa4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoAllow to use custom devices paths
Denis Shienkov [Mon, 24 Nov 2014 15:21:57 +0000 (18:21 +0300)]
Allow to use custom devices paths

QSP incorrectly transforms non-standard device names to their paths
and vice-versa (for example, "/home/ttyS0", "//./COM1", and so on).

Now this problem is solved:

* The transformation code is moved to QSPP.

* Added autotests auto/qserialportinfoprivate to testing of
conversion algorithm. These tests are private and can be activated
with building of QtSerialPort with:

qmake "QT_CONFIG+=private_tests warnings_are_errors" \

Tested on Windows 8, Linux, OSX with auto-tests, with on-board
and virtual serial ports.

Task-number: QTBUG-38639
Change-Id: I43757a7f1390f53ed2b1d70de59c6bfb71892a59
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoRemove Q_OS_WIN64 since Q_OS_WIN32 defines 64-bit too
Denis Shienkov [Sun, 23 Nov 2014 20:06:16 +0000 (23:06 +0300)]
Remove Q_OS_WIN64 since Q_OS_WIN32 defines 64-bit too

Change-Id: I32eaf132f19a3b6fcbd5fd55d0690c3bd62bb641
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoRemove the 'register' keyword
Thiago Macieira [Sun, 23 Nov 2014 15:09:19 +0000 (07:09 -0800)]
Remove the 'register' keyword

It doesn't do anything and has been deprecated in C++14. Clang even
prints a warning.

Change-Id: Ie803a206f02897f99358ed22bf9cb999ca457741
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoSimplify handling of overlapped result
Denis Shienkov [Sat, 22 Nov 2014 20:22:41 +0000 (23:22 +0300)]
Simplify handling of overlapped result

There is not necessary to pass direction to handleOverlappedResult().
Because it is passed already as a second argument (pointer to
OVERLAPPED structure that defines a desired direction).

Also this method is renamed to more simple and short name.

Change-Id: I9c20cf97c1712aed8d3e9ea6d9b4687ce4487523
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoRemove macroes that was added for Qt4 compatibility
Denis Shienkov [Sat, 22 Nov 2014 19:50:16 +0000 (22:50 +0300)]
Remove macroes that was added for Qt4 compatibility

An extra-definitions of Q_DECL_OVERRIDE, QStringLiteral and Q_NULLPTR macroes
are not need anymore, since it was need previously only to Qt4 compatibility.

Change-Id: Ie773dce1606e04107fbe58f99650f30486553d8e
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoDeclare QElapsedTimer closer to usage
Denis Shienkov [Fri, 21 Nov 2014 20:36:57 +0000 (23:36 +0300)]
Declare QElapsedTimer closer to usage

Change-Id: I74622eaf3a7f5179ff25fc815997d5e4cf3cc2c7
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoFix QSPI::isNull()
Denis Shienkov [Fri, 21 Nov 2014 13:01:30 +0000 (16:01 +0300)]
Fix QSPI::isNull()

The method QSPI::isNull() should return false when QSPI is empty.

Tested on Winsows 8 and Linux with on-board, virtual and USB serial
ports using Qt5 and then Qt4.

Task-number: QTBUG-41262
Change-Id: Ic9e0afc5549311283aef7ec2ed841f5e418b7edf
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoUse internal read buffer of QIODevice
Denis Shienkov [Sun, 16 Nov 2014 19:52:12 +0000 (22:52 +0300)]
Use internal read buffer of QIODevice

It is reasonable to use the internal read buffer of QIODevice instead of
additional QRingBuffer which currently are used. It will allow to reduce
an overhead when copying data as now there is not an excess chain with
QRingBuffer. Besides, the majority of I/O classes from QtCore (except
QProcess) also use the internal QIODevice buffer which are optimized for
this purpoze.

Tested on Windows 8 and Linux with the virtual com0com and on-board
serial ports.

Change-Id: I6c3d4b84593940ccfef8c15c9fbef16bddcd002f
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoUse QIODevicePrivate for PIMPL
Denis Shienkov [Sun, 16 Nov 2014 11:59:22 +0000 (14:59 +0300)]
Use QIODevicePrivate for PIMPL

It is reasonable to get rid of excess D/Q pointers and to use their
equivalents from QIODevicePrivate. Also in the future it will allow
to use the internal read buffer of QIODevicePrivate.

Tested on Windows 8 and Linux with the on-board and com0com serial

Change-Id: I9d0923c6f9adc5981dc49dacea163b286620ed5c
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoCreate notifiers inside of startAsyncXX() methods when required
Denis Shienkov [Sat, 15 Nov 2014 16:14:01 +0000 (19:14 +0300)]
Create notifiers inside of startAsyncXX() methods when required

It is reasonable to move creation of notifiers from the constructor
to the specific separate methods. In this case notifiers are created
in startAsyncXXX() methods if necessary for concrete I/O operation.
Also it allows to return an error in case a notifier is failed.

Tested on Windows 8 with virtual com0com serial ports.

Change-Id: I351a4c54214c84455150d0fc157a99108280cc12
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoMove all platform-specific declarations into one QSPPrivate
Denis Shienkov [Thu, 30 Oct 2014 19:53:44 +0000 (22:53 +0300)]
Move all platform-specific declarations into one QSPPrivate

This is near to the internal Qt PIMPL style. Also it will allow
to use QIODevicePrivate is more smoothly in next patches.

Tested on Windows 8, Linux, OSX 10.9 with on-board serial port.

Change-Id: Ieef4b05d0bf11cf2da6420e58629bea1818108f9
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Mon, 27 Oct 2014 11:48:52 +0000 (12:48 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: I761f9e1f101e65526c4651c5f5556363789f7db7

3 years agoDrop the Qt4 support
Denis Shienkov [Thu, 23 Oct 2014 12:20:03 +0000 (16:20 +0400)]
Drop the Qt4 support

Now QtSerialPort can be built for Qt5 only. QtSerialPort for Qt4
is developed in a separate branch.

Change-Id: Iaaa95fb7cb0aedbfc1b17ed11717fff8f9c126a0
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoCheck for lock file in non-writable directories v5.4.0-rc1
Rainer Keller [Thu, 23 Oct 2014 07:15:07 +0000 (09:15 +0200)]
Check for lock file in non-writable directories

On some linux systems /var/lock is not writable by users which are not
root and not in the uucp or dialout group.
If the root user acquires a lock and you are trying to access the same
port with a non-root user it will not check for the lock but creates a
new lock file in /tmp instead.
This change checks in readable directories for lock files.

Change-Id: Ia308fd344d2fe9d3c699f7a428ff620ea101eff3
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Mon, 20 Oct 2014 17:13:47 +0000 (19:13 +0200)]
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: I1312ec876fa74cf42637da1cea45421d380c129f

3 years agoMerge remote-tracking branch 'origin/5.3' into 5.4
Frederik Gladhorn [Tue, 14 Oct 2014 12:07:32 +0000 (14:07 +0200)]
Merge remote-tracking branch 'origin/5.3' into 5.4

Change-Id: Id7e66059233e8d07ba44cad19048d9cddc68e250

3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Thu, 9 Oct 2014 16:09:53 +0000 (18:09 +0200)]
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: I025be44e726ec2e8b7e37aa6237d411a5fc50d7d

3 years agoDoc: Applied title case in section1 titles v5.4.0-beta1
Nico Vertriest [Wed, 8 Oct 2014 11:31:05 +0000 (13:31 +0200)]
Doc: Applied title case in section1 titles

Change-Id: I8d68786028fe6e561e9c1d8b6960d43020c60e50
Task-number: QTBUG-41250
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoFix QSP::bytesToWrite() on Windows
Denis Shienkov [Sat, 19 Jul 2014 15:25:19 +0000 (19:25 +0400)]
Fix QSP::bytesToWrite() on Windows

After calling the WriteFile() function, QSP::bytesToWrite() should
return zero, but did return the size of writeBuffer.

On Windows, we must not to cut a size of the writeBuffer until the
asynchronous write operation has completed. So we need to make use of an
additional actualBytesToWrite variable, the value of which is increased
when new data is added to the writeBuffer, and decreased after calling
the WriteFile() function.

This change also entails the modification of the QSP::writeData() method
and deleting the QSP::startWriting() method. Now all platform-dependent
code (related to startWriting(), and to copying of memory to
writeBuffer) resides in the new QSP::writeData() method. But this
modification does not change the behavior on platforms other than Windows.

Tested on Windows with the virtual com0com serial ports using Qt5.

Change-Id: I35c1428ad374c0709d6c352a93c552898e947bde
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoAllow for deviceInstanceIdentifier() to return an upper case string
Denis Shienkov [Tue, 30 Sep 2014 19:00:03 +0000 (23:00 +0400)]
Allow for deviceInstanceIdentifier() to return an upper case string

Change-Id: I91977b1aa4a8e5bd8321efc5cfda375c9d7deff7
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoRestart of async reading when a QSP::clear() is called
Denis Shienkov [Fri, 3 Oct 2014 09:21:17 +0000 (13:21 +0400)]
Restart of async reading when a QSP::clear() is called

The method QSP::clear() can stall reading in case of following

- at the moment when PurgeComm abort of previously started
asynchronous reading operation

- when a serial port is in hardware flow control mode

- when a serial port has a limited read buffer size

Therefore is necessary restart of asynchronous reading to enable
of the read sequence.

Change-Id: I7a722a1ee20ecba0dd631da96ca81d2937d7ca6b
Reviewed-by: Robert Kurjata <rkurjata@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoFix reading on Windows at limited read buffer size
Denis Shienkov [Mon, 29 Sep 2014 14:44:36 +0000 (18:44 +0400)]
Fix reading on Windows at limited read buffer size

In case the read buffer has a limited size then are impossible to read
remainder which is still can be in driver's queue, since no readyRead
signal emmitted and reading are stalled.

Problem is that Windows does not fire the EV_RXCHAR event in case a
driver's queue has ready to read remainder; this event will be triggered
only when a new data are received.

The solution is to start of asynchronous read operation for reading of
possible remainder from the queue after doing QSP::read() from the user.

Besides is necessary to meet conditions:

- do not start reading in case a reading already is started

- do not start reading in case is not in limited buffer size

- do not start reading in case is a previous reading returns
a less data than read buffer size or are not in the hardware
flow control mode

Tested on Windows 8 with virtual com0com serial ports using Qt5 and then

Task-number: QTBUG-41295
Change-Id: I01797e6f8d6006751244144fead3616b1de1b811
Reviewed-by: Robert Kurjata <rkurjata@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoRemove custom baud rate filtering
Manuele Conti [Wed, 1 Oct 2014 11:13:11 +0000 (13:13 +0200)]
Remove custom baud rate filtering

Some serial device have baud base that it is not multiple of baud rate selected,
so we need to allow baud rate compliant with device.

Change-Id: I7d3ce94f10d4382a29ff34bb18daebb650186c1c
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoFix segfault related to dynamic udev loading
Sergey Belyashov [Fri, 26 Sep 2014 12:00:39 +0000 (16:00 +0400)]
Fix segfault related to dynamic udev loading

Problem was caused by conflict of libudev symbols and function pointers
declared in qtudev_p.h.

Task-number: QTBUG-40113
Change-Id: I599575e8a1b9ffe32295331d46d991422975f773
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoHandle onboard serial ports when parsing sysfs
Rainer Keller [Fri, 26 Sep 2014 12:42:20 +0000 (14:42 +0200)]
Handle onboard serial ports when parsing sysfs

The device detection stopped if one of the sources reported at least
one device. This made onboard serial ports not listed if a USB device was
plugged in. Onboard serial ports are now detected and added to the list
of devices.

Change-Id: I8798e7f14073e19d9e206eb4d7cdd0b28bd8a0bb
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoFix typo in twoStageSynchronousLoopback test
Denis Shienkov [Sat, 27 Sep 2014 20:00:22 +0000 (00:00 +0400)]
Fix typo in twoStageSynchronousLoopback test

Commit f1761c1236edce428278f7a9e8aa1091097eaa57 introduce a typo
for receiverPort and senderPort variables, that lead to failure of test.

Change-Id: I18ecad78bb11d7bb218a674c3c3bf9c863a2b33c
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoFix order of passed parameters into QCOMPARE
Denis Shienkov [Sat, 27 Sep 2014 19:22:04 +0000 (23:22 +0400)]
Fix order of passed parameters into QCOMPARE

According to documentation the QCOMPARE should accept to the first
parameter an actual value, and to the second parameter an expected value.

Change-Id: I64e762e779fa6a61401f358c4dd6097dacf7a33a
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoFix access after delete in OS X QSPI
Dyami Caliri [Wed, 24 Sep 2014 22:07:01 +0000 (15:07 -0700)]
Fix access after delete in OS X QSPI

Valgrind analysis shows that searchStringProperty was accessing memory
after deletion. This was caused by constructing QCFString local var
with CFStringRef, which does not retain object.

Change-Id: I1e9571a5051aa6f0c3fbc732ac01e821069f8b02
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoQuery a serial number of USB device from Sysfs
Denis Shienkov [Thu, 25 Sep 2014 09:22:26 +0000 (13:22 +0400)]
Query a serial number of USB device from Sysfs

Tested on Linux with the USB (FTDI and TI) serial ports
using Qt4

Change-Id: I8c088bf8b6fe440565cc37538ca7ef029651fb61
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoMerge remote-tracking branch 'origin/5.3' into 5.4
Frederik Gladhorn [Tue, 16 Sep 2014 13:29:27 +0000 (15:29 +0200)]
Merge remote-tracking branch 'origin/5.3' into 5.4


Change-Id: I5887622f233275703cca8cc2a5db4aaaccc72d97

3 years agoMake tst_qtserialport build with Qt 4
Samuel Gaist [Thu, 11 Sep 2014 19:52:52 +0000 (21:52 +0200)]
Make tst_qtserialport build with Qt 4

The newly moved twoStageSynchronousLoopback fails to compile since
there's no qCompare available for int and long long with Qt 4. This
patch allows to build it again with Qt 4

Change-Id: Ib3764b125f371ae70864bd578c7ccda39d08ae22
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoAdded missing deprecation guards and documentation update
Samuel Gaist [Thu, 11 Sep 2014 23:00:17 +0000 (01:00 +0200)]
Added missing deprecation guards and documentation update

This patch adds the missing guards around the deprecated functions

Change-Id: I829e90e289da7af736fc6f5d6c319509138f1aef
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoFix Qt 4 build
Samuel Gaist [Thu, 11 Sep 2014 23:03:08 +0000 (01:03 +0200)]
Fix Qt 4 build

Following the discussion on the development mailing list with
Thiago Macieira, remove the guard around the signals since
it's not supported to build with Qt 4.

Task-number: QTBUG-41190
Change-Id: I8df1b7fa8cc69a2aacdcb4fedea0cc6fe092eece
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoUpdate license headers and add new license files
Antti Kokko [Fri, 22 Aug 2014 06:02:37 +0000 (09:02 +0300)]
Update license headers and add new license files


Change-Id: I08685205169cdd4b49a651ed98f36ba1e6c1bb29
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
3 years agoBump version
Frederik Gladhorn [Fri, 29 Aug 2014 09:33:42 +0000 (11:33 +0200)]
Bump version

Change-Id: Ida6ecfd792ea1906c70bf17bb5b8077ad4c5e631

3 years agoFix a race condition at writing on Windows 5.3.2 v5.3.2
Denis Shienkov [Thu, 14 Aug 2014 17:50:05 +0000 (21:50 +0400)]
Fix a race condition at writing on Windows

1. The writeStarted flag shall be reset to false after bytesWritten() signal
is emitted, but not before it.

2. In case of start of writing from the startAsyncWriteTimer it is necessary
to call the startAsyncWrite() method but not the completeAsyncWrite() method.

It give guarantees to exclude of race condition to multiple call of the
WriteFile twice until the write operation is not completed.

For example, a race condition is watched in case of writing data from the
slots which are connected to the bytesWritten() signal from a device; or to
the timeout() signal from a timer with zero interval. To checking of these
scenarios are added additional autotests.

Tested on Windows 8 with the on-board and USB serial ports, using Qt5.

Task-number: QTBUG-40769
Change-Id: Iedabbf38847debeee795a10fd7a4c54c65d2a338
Reviewed-by: Patrick Noffke <patrick.noffke@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
3 years agoMerge remote-tracking branch 'origin/5.3' into 5.4 v5.4.0-alpha1
Frederik Gladhorn [Thu, 28 Aug 2014 14:18:59 +0000 (16:18 +0200)]
Merge remote-tracking branch 'origin/5.3' into 5.4

Change-Id: Id742521c303261262a87db4189d369851ed2078b

3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Mon, 18 Aug 2014 13:25:42 +0000 (15:25 +0200)]
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: I9e214070bcca31477086550ca022323c4bbce872