| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not all platforms use txbuffer for writes. Fortunately those platforms
who do not use it do not use any buffering at all. Hence bytesToWrite()
returned the correct value as txbuffer always had size zero. Therefore
this patch is effectively a NOP.
Nevertheless this patch encourages the right implementation across the
platform.
This does not affect macOS as it has a separate implementation for
QBluetoothSocket::bytesToWrite().
Task-number: QTBUG-58190
Change-Id: Ic05f4358b079f612ee7e0e4dbb7fb9aa78fd6556
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Android, the socket's read buffer is managed in the Java thread.
QBluetoothSocket::canReadLine() is public API (most likely) being called
by in the main Qt thread though. The function directly called into the
Java buffer instance without proper locking. This can create race conditions.
Starting with this patch canReadLine() calls another QBluetoothSocketPrivate
indirection to allow a platform specific implementation. This affects
WinRT, BlueZ and the dummy backend too.
This is not an issue on macOS as its implementation of QBluetoothSocket
is separate and does not have to deal with multiple
QBluetoothSocketPrivate implementations.
Task-number: QTBUG-58190
Task-number: QTBUG-60830
Change-Id: Idae19f1aee6f809699d36519b01a3c68ad9c563d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/bluetooth/qbluetoothsocket_bluez.cpp
Change-Id: I37e21b3c636a241a357bc81fc23da51303b94623
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QString::arg() returns the new value but leaves *this unchanged.
Found by GCC 7 (-Wunused-result).
Change-Id: I8a0ddb801ded94365f0e9a7ae13a37a96c7f437a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I4fbb948841a610640acaf87364e2157e31782836
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
|
|/
|
|
|
|
|
|
|
|
| |
It returns an updated QString, without modifying the variable it was
called on. Found by Clang when building:
qbluetoothsocket_bluez.cpp:255:17: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
Change-Id: I27b55fdf514247549455fffd14b1795de236d488
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the Bluetooth connection is flooded with information, EAGAIN is returned.
So far this was considered an unrecoverable error which is not consistent
with the meaning of EAGAIN.
In buffered mode we'll put the data back into the buffer and in
unbuffered mode the QIODevice::write() call returns 0 which leaves the
developer the option to retry.
At the same time this patch ensures that write() calls always return
the actual number of written bytes and not the amount of bytes the caller
asked for to be written.
Partial writes in buffered mode are returned to the buffer too.
Task-number: QTBUG-54475
Change-Id: Iffc7980d2477e1fc0b45808431af6b7fecd38ded
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
|
|\
| |
| |
| | |
Change-Id: If9cf6718cbd619dd7ce38db2da274fe9d0a41fb7
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: I856c13e2a6d4d12c46e1286b0ca1c092ee4608f8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|/
|
|
|
|
|
|
| |
Higher-level code should decide whether a remote device disconnecting
constitutes an error or not.
Change-Id: I50d7524d2684dbbbfc8df5667e227748fb31cee4
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
In most cases, callers of convertAddress() feed the result into a
QBluetoothAddress, so they have no need for the output parameter.
Change-Id: I23b2e8d5d49ac300c35d141b75ffa8e398e22f19
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Decrease complexity from O(N+N*logN) to just O(N) for cases like
foreach (Key key, map.keys())
Value value = map.value(key);
, by rewriting with use of iterators.
Change-Id: I81f1334797f16b624293fcebdee885b2be3c89f1
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To enable reading peername for known devices even if
org.bluez.Adapter.CreateDevice has security restrictions, call
org.bluez.Adapter.FindDevice first and CreateDevice only if the device
isn't already known.
The change is needed due to runtime security checks on Jolla devices,
but reordering the calls does no harm when used with upstream
bluetoothd.
Change-Id: I4a86840487a8b4c90759044b7c995815c77a7609
Task-number: MER#1225
Done-by: Hannu Mallat <hannu.mallat@jollamobile.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This permits Bluez clients to determine the security level before
connecting to the server.
Note that the server may change the sec level at runtime without the
user noticing. If the user wants to detect such cases socketDescriptor()
in compination with getsockopt() should be used.
Task-number: QTBUG-46377
Change-Id: I3bc4fcd62dc44d9e2e14e5a6e7416e3bb8e0d50b
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
|
|
|
|
|
|
|
|
| |
This permits the API user to determine the security parameters for the
connect attempt to the remote SPP service.
Task-number: QTBUG-46377
Change-Id: I1ed5ea0f5a32aa08dcedc46a34b0377654e420b2
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
|\
| |
| |
| | |
Change-Id: I177affc6c60fd3cc55e914a7ea2a9aeba260906f
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QBluetoothSocketPrivate::close() was always called when the internal
socket state has been set to ClosingState. The removed checks were
meaningless.
Change-Id: Ia36808a21de7dd1076cdd47bca8fd6855ec957c3
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.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: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
|
|
|
|
|
|
|
| |
Change-Id: Ifd6b5ed8176aa7959ed8da0edc762266aa2bd6fa
Task-number: QTBUG-32704
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is required to be able to connect to devices which use random device
addresses. Some platforms can determine this flag based on their last
device scan. The flag is likely to be provided as part of
QBluetoothDeviceInfo once the information is available.
Unfortunately non-le scan on BLuez doesn't inform about the
flag. The LE device scan is currently not implemented and, even worse,
requires root privileges on Linux. The new API element permits the
selection of the correct type when the scan doesn't detect the type
properly.
Change-Id: I8e7118658a7c927e0ea07b0d639d57f9483cb33c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
Bluetooth byte order is little endian. htbos ensures the psm is
converted to the required byte order.
Change-Id: I22362d1f1fe3978df7855eab14154644a1d60a0d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
These two functions are really only needed by Linux style socket code.
There is no need for other platforms to implement them as dummy too.
It simplifies the code somewhat.
Change-Id: I3e0aced8d9f7b590d1c6aaa60f97bd060ee8f4b4
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
|
|
|
|
|
|
|
|
|
| |
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL
Change-Id: I7a8b8b787fcae9a178794364efdefe1021d10b1b
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|\
| |
| |
| | |
Change-Id: I1e79c96602d0da2c2d36d6217bdfe7ff183e6df9
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/bluetooth/bluez/bluez.pri
src/bluetooth/qbluetoothsocket_bluez.cpp
Change-Id: Ieca8f2a327bf54b42403ddab88f8b9c3ff6b4a95
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I52ac33b4864d6bfca248ff3fad5a069154a9c756
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This seems to be optional for Bluez4 but mandatory for Bluez5 to
establish a connection at all.
Change-Id: Ia99b6e6623fc63f3d0abe37a87808a59cbd889f1
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
Change-Id: Ib960b9e8d8800af84d2094bdf26c2652d4c81dba
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I72703aac0676e6474f2c40ac37b8ee8b00830690
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This disables the gatttool based controller as well. While it might
compile on older systems they are likely to not have a
gatttool and why would a Bluez version without BTLE symbols ever
work anyway.
Change-Id: I761e482d3dd1e99008c5d170053e19a1a3a51e6c
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I83d88412319c34cf6c8cf0c6e841458226c9d073
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
|/ /
| |
| |
| |
| |
| | |
Change-Id: Iaae61b6a872124d17855d80d106f2b10996501de
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-32085
Change-Id: I9fe63f3291a10a195d460720cd1821913a63b25b
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
|
|/
|
|
|
|
|
|
| |
The only exception are generated files and cases where
QLatin1String based overloads are used (e.g. during QString comparisons)
Change-Id: I6f36789fb8acb3b30c1dc1f8a920b118a979d74f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
|
|
|
|
|
|
|
|
|
| |
Ensure a native socket is obtained after QBluetoothSocket has been closed.
[ChangeLog][QtBluetooth][QBluetoothSocket] Fixed a crash on reconnect.
Change-Id: I9f470d23366250dc20ad3305ddec16300c1ad8ec
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
| |
When _q_readNotify() is called and no data is available (e.g. in case
of timeout), then the internal buffer grows indefinitely, causing a
one time corruption of the following good data.
Change-Id: I75929382db73953bbccdd86b9ae248329df879fa
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes duplicate switching to the unconnected state in case
the disconnect() signal is used to reconnect.
[ChangeLog][QtBluetooth][QBluetoothSocket] Fixed duplicate emission
of unconnected state in the reconnection case.
Change-Id: If449420d936c96e62518fc408e6a1e35b79988a8
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
| |
Change-Id: I01e867cb5efb231e7c85b0d106897b2f31448977
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
| |
Task-number: QTBUG-36817
Change-Id: I17f7d57537f7f1a5cedd01ce6043cfd6aac26db4
Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
| |
The function is not required as the public accessor function directly
returns the socket descriptor.
Change-Id: I6d64bec7b4f0542ce213dc90dcfe30c3885ed21d
Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
| |
This includes unification of error messages, fixes for spelling
mistakes, hints for translators and other forms of simplifications.
Change-Id: Idd0e01614b24ff2d19133f0d19d49649d59e3f57
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/bluetooth/qbluetoothservicediscoveryagent.cpp
Change-Id: I52831fc8c69062e90c003836fd9402f19d6a0ba5
|
| |
| |
| |
| |
| | |
Change-Id: Ide3f00cacd7a42e99823441a45609f8e50063fce
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a few cases where errorString, error signal and error code
where out of sync because one was set but not the other. This was
addressed by unifying the usage pattern for error activation to a
pattern where errorString is set and setSocketError() is called
afterwards.
Change-Id: Ibfb04772cf560936aa4ce8ea9643d6a410cc9ee2
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This affects Bluez only. The other platforms don't use this feature.
The problem was triggered when connecting, disconnecting and connecting
again to another device. localName() might change due to a different
local Bluetooth adapter being used and peerName() is different anyway
in such cases.
Change-Id: I8983a355832cf4f4d9a654971c54f5624be288e6
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
So far the initial value is compiler dependent. In most cases this meant
it was set to 0. However 0 is not even a valid
QBluetoothSocket::SocketError enum value. The NoSocketError value is -2.
Change-Id: Ieee4f7bd1c97d758295f4d0cc1297f62c114f4f3
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The internal socket was closed but not reset to -1 after calling close()
or abort(). As a consequence the subsequent connect() call crashed since
internal socket notifier were invalid
[ChangeLog][QtBluetooth][QBluetoothSocket] Fixed a crash in Bluez part
of QBluetoothSocket() which was caused when triggered when calling
the sequence connect() - abort() - connect().
Change-Id: I21b779c7808d0a5211df9e2481da28e2e9753ca9
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ThHis is only used on Bluez at this stage. THe SDP agent was initialized
with the local adapter being the remote address of the remote service.
This could never work. The remote address is now properly set (being the
handed over bt address to QBluetoothSocket::connectToService()).
[ChangeLog][QtBluetooth][QtBluetoothSocket] Fixed incorrect
invocation of QBluetoothDiscoveryAgent where the remote service address
was incorrectly assumed to be the local Bt adapter address. This prevented
the detection of the remote service. This bug only affects the Bluez
backend.
Change-Id: Ice2b9c351bfd42f1f4398b14ac68f76315f01fa8
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
|
|/
|
|
|
|
|
| |
remove trailing whitespace, expand tab
Change-Id: I3361c6c431231c7463bb1dc9b53268935b22a72b
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-32253
Change-Id: I193162407d0fc7eca83689e31f03e1641a494ab0
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|