| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
(cherry-picked from b7f3086ef8f52a931ebe51fc065fcd813c913ef0)
Change-Id: I2b5b2ce8f193d09697f0a0b7e7cd1520cdf488bd
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The macro QT_DEPRECATED_SINCE was introduced in QSP because earlier any
branch of QSP had support both Qt4 and Qt5. But beginning from Qt5.5 the
Qt4 uses the separate branch, named as "qt4-dev".
Thus it is reasonable to replace all deprecation conditions on #ifdef
QT_DEPRECATED, similar to Qt4 sources for this branch.
Task-number: QTBUG-46154
Change-Id: Id8d008f2341cd14d0352293c4a2c00a367655afb
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
| |
This was missed since Qt 5.3.
(cherry-picked from 9177a6c473afde7207c53f4d72f015a16dbeeb5f)
Change-Id: Ifb00421dec915682fd35587128aae6bd36bd9c9e
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
| |
(cherry-picked from da7a9e58a4b22ac7de087ed518139de5f06aebc5)
Change-Id: Iba0b5a63d225a469fd70125a90e306ef67f68cb9
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This was missed since Qt 5.2.
(cherry-picked from 05673348c71a967da09b4d26274a447d00ff16c4)
Task-number: QTBUG-46066
Change-Id: I105728382a682def9bbecbf1e33d28bfff00a6e9
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
| |
... since current branch supports only Qt4.
Change-Id: Idf7de463bf28ff046f4d4356ef1b50009740a82a
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
(cherry-picked from 6ae78369d1156e653df6a2e539230a89cf963b00)
Change-Id: I949f30ca8bf260c8884e819524909fd6cd32ad5e
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
| |
(cherry-picked from 9a9aed53e1e23200d471ced91a83fbca9976f231)
Change-Id: Ia1c15507ffa7135ffae0d8776c45746b454633cd
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
| |
(cherry-picked from 03629b992766fe30ad148ccdf732e0aa1ec0171e)
Change-Id: I03a32923f773a55304f47a58d4b709e880bf3a5e
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
For QLatin1String, startsWith/endsWith/append/operator==/... are overloaded,
so use QLatin1String instead of QStringLiteral in such cases.
(cherry-picked from 7f857db22e0d409aac65e4773bb377796893b624)
Change-Id: I92b0a2597f935acb4310c8d717a46b537308ecd9
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
| |
(cherry-picked from 801198fab9f6e29b1cd56a8820606f616e3d256e)
Change-Id: I814992c07273b9aa55d2eb0a02dffc46b60a9842
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
instead.
(cherry-picked from 3db7c8ac2484c5e5eb10150b87a9c4d81d20b51d)
Change-Id: Id7dfb2476c4a52a4c320c64588341fe6d0a5fa7d
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
| |
(cherry-picked from e19945cdd347bf2aaef9f0552f6bea7a706030ad)
Change-Id: I9f11be6f1de66af70e84a00943d8cc75909e4956
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
| |
It is reasonable make it as enum and part of QSP class.
(cherry-picked from ae7cd02d1c5b9d3f659a3a2430f47c8fa41672b7)
Change-Id: I13d4561568b2688f7d1a054073455c23a64c1b94
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Silences the following Valgrind warning:
Conditional jump or move depends on uninitialised value(s)
(cherry-picked from 53afe73154c7c00b54cd280fa3d6c9127a2bc84b)
Change-Id: I8fd8cfd6aa6f75ed515e6151cfc282faca508bdc
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
As this branch is intended for support of Qt4, then expediently
to revert the license headers with the same content as in the
current Qt4. Besides, are removed the licenses as GPLv2(2.1, 3)
as they aren't present in sources of current Qt4.
Change-Id: I8bda62ef5f95f362053ad77f5b1666df27795254
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A regression was introduced by commit
893173f9d562f312ce51f00c07eef4ae0f1a0212: call to waitForXX() method
always fails.
The reason is in that earlier we always had a three valid handles of I/O
events, which are passed to the WaitForMultipleObjects() function. But
after that commit, we can have up 1 to 3 created handles, depends on the
I/O operation. In this case, we also passes a three handles to the
WaitForMultipleObjects() function, but some of them are non-initialized.
This lead to the WaitForMultipleObjects() always returns with the
ERROR_INVALID_HANDLE error code.
Thus, we need transfer to the WaitForMultipleObjects() only active
event handles.
Change-Id: Idc0d98e781506dd30011d4e50f53e06e2776ed52
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
If a device is not open, then the hEvent field of the OVERLAPPED
structure is in non-initialized state. In this case the CloseHandle()
on the hEvent lead to crash. It is reasonable to initialize this
hEvent field in a constructor.
Change-Id: I1c9df21bdab4c95fc774f8d024de04e18948d81f
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
breakEnabledChanged().
Note: After opening, the port always is in non-break state.
Task-number: QTBUG-36571
Change-Id: Ib808dab7eaed8cc5449c66d8186a29a7b7e45afc
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
| |
Change-Id: I7261a92ea4405c8aeab7670f73e7225ed7e4d9d0
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
| |
The ENOTTY is closer to QSP::UnsupportedOperationError, because it
is decoded as "Inappropriate ioctl for device".
Change-Id: Ibcbe09e201eeb5ede6daa417654a181dd380df5a
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
| |
Change-Id: I41d67e9ca8d9cb6042b4d8de756a22d18b077dcd
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
example).
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
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
messagebox.
Change-Id: Id8aa3f3b835fd7d4187bdf83c1d6584d5fd541f7
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
devices.
Task-number: QTBUG-32024
Change-Id: I313145caadfeeee4d5fe3c8e16c1bcf4ae79214d
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
"serial8250".
* 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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
| |
Change-Id: I5c33421338e6a64dbadeb168cf165a84bedec5b9
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
| |
Change-Id: Ica127147999eaecc3d03189cfa9cd893115b846c
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
| |
Error message about missing environment variables generates list of
required variables.
Change-Id: Icbb680abbd9fc5d0549907b7399757d943c6d535
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
operations.
2. Instead of startAsyncRead() should be called the
startAsyncCommunication(), that allow to correctly startup of the read
sequence.
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Commit 62dfdeb3642250bdb642dbf607a8c7b95e57835e introduce a
critical typo that revert a bug which are fixed in the
b4d5bd813f591dc618e0fff2d55d93eeccb1a26e commit.
Change-Id: I9ed29f5b443cbd7102878287d531d18a9351a2e5
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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" \
DEFINES+=QT_BUILD_INTERNAL
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: I32eaf132f19a3b6fcbd5fd55d0690c3bd62bb641
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
| |
Change-Id: I74622eaf3a7f5179ff25fc815997d5e4cf3cc2c7
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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: Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|