| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Change-Id: I71eafba9e7ff47dbfd89e3a650b83b55d1196693
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSDN documentation states that the recommended way of RFCOMM service
connection is via connectionHostName and connectionServiceName (see
https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.rfcomm.rfcommdeviceservice).
So whenever possible, we should use this information from the native
device service when connecting directly to the discovered service.
As QBluetoothServiceInfo is basically just a wrapper for the attributes
map this information is stored in its private pendant and extracted when
a connection attempt is being made.
Task-number: QTBUG-62520
Change-Id: I95be5df89a722531393b45fd136d37f302393ca8
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Force value to be a DWORD (unsigned long) instead of HRESULT (signed long).
Fixes
bluetoothsocket_winrt.cpp(770,10): error: case value evaluates to
2147952460, which cannot be narrowed to type 'long' [-Wc++11-narrowing]
Change-Id: I4f1eb75807d4783b835094ad1b33e56f601ffb39
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
| |
QBluetoothSocketPrivateWinRT::connectToServiceHelper was
missing one hr check.
Change-Id: Iae357df99881874b2d672dde6625e36d6221de0f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of duplicating that logic everywhere, it can be handled
in one place.
Additionally setOpenMode should be called before setSocketState
so that every member variable is changed, before signals are
emitted.
Change-Id: Ic1d4317ba31046d78d97874ec00c59481a67bb50
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The private implementation can much more easily determine whether the
socket closure is already done or not.
On Bluez DBus, this avoids disconnected() being
emitted twice. Another platform that is still delayed is Android.
The patch permits the removal of Android specific ifdefs.
Last but not least the patch cleans up missing signals in WinRT.
Task-number: QTBUG-68550
Change-Id: I189e1dbc9f6d410522da1a82113fdf4fe79a4cbd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This permits each platform to customize the implementations without
the need for ifdefs. Upcoming changes such as the BLuez DBuS addition
will increase the platform differences.
Task-number: QTBUG-68550
Change-Id: I8fc9a74d3ce704466f0bf2c16287e32f222c4376
Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal is to move the various QBluetoothSocket::connectoService()
implementations into the private classes. Common parts can be split into
QBluetoothSocketBasePrivate and the platform specific code. The code
becomes cleaner and has less ifdefs.
However this creates a symbol clash with the currently existing private
implementation as it has a function with the same signature but different
purpose. This rename provides the foundation for future changes.
Task-number: QTBUG-68550
Change-Id: I121f08d93e00790c1619c0449629f47bca8a964d
Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-68550
Change-Id: I14fe43fcbbbdd6950f05feda900643f6899daa24
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces a generic interface towards QBluetoothSocketPrivate.
Later on, the QBluetoothSocketPrivate class will be split into
platform specific overloads/interfaces.
Ultimately, this will be needed to support runtime selection of
the QBluetootSocket d-pointer on Linux. The Linux Bluez5 implementation is
significantly different from the Bluez4 (raw socket) implementation.
Since recent Bluez5 releases the raw socket implementation is no longer
functional and/or the user has to have root permission
and enable bluetooth --compat mode. Therefore a second QBluetoothSocket
for the dbus socket API is needed. QBLuetoothSocket has to choose at runtime
(during its instanciation) which implementation to use.
Task-number: QTBUG-68550
Change-Id: I5d0b8e24b8acd1b149b897f52f0d82eade7f3823
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If I understand the documentation correctly, the socket's onCompleted
callback should be called manually (with a proper status) before calling
Close on its read operation (see
https://docs.microsoft.com/en-us/uwp/api/windows.foundation.iasyncoperationwithprogress_tresult_tprogress_).
Additionally all logic could be cut from the callback as soon as
shutdown is initiated as we might run into dangling pointers otherwise.
Change-Id: I3b7969f1aae16c453bc450b652746c8e21b2ef8f
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ia3172f663412eb9df0b1c41fc114699813039c43
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since it is possible that after calling Cancel() on the IAsyncInfo that
it will still call the Completed() callback, we need to ensure that
it has a chance to process the pending events before it is deleted.
Change-Id: I7d6fbb5bf6344098048b147c9d361c1fe7923b55
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ief783e899cde02ae033be8cd3af61ab5572d81a5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of checking for a certain Windows version, we should check
whether the API is actually available
[ChangeLog][QtBluetooth][Windows] Enabled UWP backend for desktop
Windows versions that support the API
Task-number: QTBUG-61566
Change-Id: I8384119c70cc2c4bdcdbe6b297cfcf5fb3e3f534
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I0ed4afd881f483a166a7e1400043f116c491f30c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the socket was created without giving the socket type,
ensureNativeSocket was not called and thus m_socketObject is 0. Calling
localName and friends caused a crash because they accesses the object
unconditionally.
Change-Id: I442e3d1492458161fb8660f1b2f17d52b37a2935
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|/
|
|
|
| |
Change-Id: I6503377cd99d403ff31a2eae8109476294cbebac
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: I5469f696d0f20d563a67cdcc94af16faf6cac8ea
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
|
|
|
| |
We have to use a similar approach to the one that is used on android
as the ComPtr cannot reliably passed as an int.
Change-Id: Ia52c78d4725fb3240eafa62fcb55531a282c0cd3
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
| |
Change-Id: Ib32af0803e95229a1671055da4d5608f3fd3e0f6
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
|
| |
Task-numer: QTBUG-37779
Change-Id: Ieb3ed5dfea7d60b3875cbe97bb26f8060bebcc17
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
| |
Change-Id: I9fd9131c031328afa936a52e42371409e3fbac48
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
Task-number: QTBUG-37779
Change-Id: I7fb49a6870768da956793b0d0681c371da939df9
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|