| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Change-Id: Ief783e899cde02ae033be8cd3af61ab5572d81a5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-65801
Change-Id: I32be0262165d963ba5fb933c73414451431b2242
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
| |
Change-Id: I041606473b333500da29c821d7dc089313856f65
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
| |
Emitting just the signal does not change the error state. setError()
ensures that the error state/member and the error signal are emitted.
Change-Id: Idc044b8b97d4025b0f3a4d172c11c6b3a4e81ecb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As device discovery returns every paired device on winrt, it is possible
that we try to connect to a device, that is paired but not available.
When doing so the application should not crash but state that there
was an error connecting to the device.
Task-number: QTBUG-64480
Change-Id: I8d79f6da1de2b0bda7a51a7cfd068bb4a6057257
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
As msvc2013 was dropped we can add the capabilities independent of the
msvc version for winrt.
Change-Id: I14aea0da9226a5de6ffa2cf7c69a4ae5a69e8256
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an ATT READ_REQUEST times out the ATT stack stops spinning
the event queue. This is particularly bad during the initial
service discovery when a lot of read requests are scheduled in one
go. The consequence was that the QLEService instance
was stuck in the ServiceDiscovering state. Subsequently the service object
is unusable.
The patch ensures that the ATT event loop continues after the timeout
happens. If multiple char or descriptor reads (on the same service) have
this problem the service discovery can still take a very long time.
The user can adjust this via the BLUETOOTH_GATT_TIMEOUT env variable.
[ChangeLog][Platform Specific Behavior][BlueZ] Fixed hanging service
discovery state when remote device does not respond to ATT read requests.
Task-number: QTBUG-64669
Change-Id: I8d22c13b825a921b140213b8b67e59e2310c362c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
| |
Some devices report access denied for various reasons (group policy,
disabled, etc.).
Hence, do return and stop the discovery instead of asserting.
Change-Id: I22fe9cc375fd3b3580deaf72c614bf62600cbf32
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If no bluetooth adapter is present in the system
IRfCommServiceProvider::CreateAsync will result in "device not
available". In this case we should not assert, but just handle that as a
failed attempt to register the service.
Task-number: QTBUG-64118
Change-Id: I73591a1f2dbedc798824e5afef53a9e2d793e73e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There currently is no API for supporting the peripheral role on winrt,
but there is no way to reflect that inside our API. If a user tries to
set up a low energy peripheral device, the application should not crash
though.
The crash occurred, when the controller was set up in a perihperal role
and the application tried to read or write a descriptor or
characteristic. In this case the functions should just return early.
Task-number: QTBUG-63709
Change-Id: I30b277788d822f869743e1f294ee1402abd36309
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-63210
Change-Id: I98637337d8a77c8847bd0f2c567fec5e6a4ace31
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For writing messages another QAndroidJniObject was created, which
however wasn't connected or validated in any way, so calling methods
failed obviously. I removed said object and made use of the implemented
class member m_tagTech, that is being validated and connected
beforehand.
Task-number: QTBUG-62858
Change-Id: I97c28f15cdaf5c0aa36423e7aba35408b49bde4e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
|
|
|
|
|
| |
Change-Id: I28f5936913a6127806325df34af4bf71a142e72e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug was caused by a problem in the patch for QTBUG-55150.
While the termination of an ongoing BTLE connection is being
processed, the QLEController instance is in Connecting state and
the internal socket is still null. If the user triggers a call
to QLEController::disconnectDevice() while the above state is
pending, it crashes due to a call to the socket's close()
function. The time window for this to happen is very small.
It takes the duration of the bluez dbus call to disconnect
a device.
This patch addresses the above crash bug and adds a
bit more debug output to catch similar cases later on.
Task-number: QTBUG-63619
Change-Id: I893990a9ce8ccf55ddbf619fe177379f79dc9ee3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
| |
Change-Id: Ia26b0bf499f8a0b6040e82bc1d460bee688bfbf6
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IOBluetooth is heavily based on CFRunLoops. An attempt to use it on a thread,
that does not properly run CFRunLoop results in callbacks never firing and
thus QBluetooth classes never finishing their jobs, including:
- device discovery
- service discovery
- RFCOMM/LCAP2
- Bluetooth server
- Bluetooth socket
etc.
While we cannot fix the core problem until we have a properly working
CoreFoundation event dispatcher, we can at least issue a warning so that
people do not waste their time debugging this well-known limitation.
Task-number: QTBUG-63630
Change-Id: Iefa4d675ea0962167bdfede640d2087dbdf37b18
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
| |
Change-Id: If828dce2dcd71f36c51216c2db4437683bc2a358
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Like it was done for central manager - use the correct enumerators (types)
- with 10.13 SDK they also use 'generic' CBManagerXXX constants on macOS
instead of CBCentral/PeripheralManagerXXX constants.
Task-number: QTBUG-62658
Change-Id: I4b4de239930f5e731dc4977ff3353512290ff3b2
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
| |
A similar change was done earlier for iOS already. This is due to
deprecated API.
Task-number: QTBUG-62658
Change-Id: If1d4a0eae382e46e3224a6bd4a6e75309ff87cac
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
| |
If we do not scan for low energy devices, the timeout will never be
triggered. In this case the discovery is finished as soon as every
paired device has been handled by the worker.
Change-Id: I59772e706ac0fbf62c560a54d650bef9815118b6
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QBluetoothDeviceDiscoveryAgent (DDA) is deleted by QBluetoothServiceDiscoveryAgent (SDA)
once it receives an error or SDA is instructed to stop() the discovery process.
Currently, this triggers at least two calls to the DDA's stop() function.
In addition, if stop() generates an error the error call itself will
call back to DDA:stop(). Therefore it create an endless loop back.
This is at least true for the Android devices mentioned in the related bug report.
This patch ensures that the main logic of Android's DDA::stop() is not called
more than once. Further more SDA disconnects from DDA's signals to avoid
a potential endless loop. Any error in DDA is not of relevance to the
surrounding SDA instance anymore.
Task-number: QTBUG-60131
Change-Id: I1df16f2b0896928833aa2ced75c43d4642b4fba3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
| |
If there are no pending connections, the call should not make
the application crash but just return nullptr.
Change-Id: I33c2ec9b47bbb72abc99ad22035f794724b295ef
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
This is the result of running the (experimental) clang-tidy check
qt-modernize-qsharedpointer-create
Discarded changes: none.
Change-Id: I58a0f230516e836df62b40cf8ec38a6b3d7122db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
| |
Change-Id: I9f6a7c3884c2d7c9b0856a0e9a689ad88cca59fe
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If the last entry of a service is a descriptor or characteristic
and the read attempt fails early (the read could not even be initiated)
ensure that the discovery state machine properly exists. So far the exit
was only ever triggered by a successful read or if the async callback
for the read returned with an error or timed out.
Change-Id: I495982a82819aab985bc91a7e63c530b52355d9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are cases where peripherals use a larger MTU than the default MTU
on Android. This forces the MTU negotiation to always been done once
the service discovery has been done.
This patch requires Android API v21 (or Android v5+). If the
local Android version is below 5 this feature becomes a noop. The related
bug cannot be addressed on Android version below 5.0.
Task-number: QTBUG-61755
Change-Id: I6521b5dad05da5e3e533ef2af56ee649b1b79730
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The type of manage.state has changed on macOS (like on iOS before),
making an declataion invalid.
(cherry-picked from qtconnectivity/0c3cc5374d2703fde6a99d301fcff974122d057d)
Change-Id: I55caa32fa9f0a85090506cfbd788c1a80d41e8ce
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
| |
canceled should only be emitted if stop was used to abort a
running device discovery. A timeout happening has to cause a
normal finished.
Change-Id: I1072c14a44b84da0cb93420cf7344b8bc56b523e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
lowEnergyDiscoveryTimeout affects the emission behavior of
deviceDiscovered(). This behavior change should be explicitly
documented.
Task-number: QTBUG-57847
Change-Id: I94bd7cb36935b376c34ba90f5de4e3084e87e883
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
timeout 0
If we have a never-ending LE scan, we should report even complete duplicates.
The original bug-report has a scenario with a long-running application, that
records a data from BTLE scales once a day.
Task-number: QTBUG-57847
Change-Id: If5e4828f119d5f4e4418cfe60fa518b583210a14
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the user chooses to do a BTLE device discovery with
QBluetoothDeviceDiscoveryAgent::setLowEnergyDiscoveryTimeout being set to 0,
we should continuously emit the deviceDiscovered() signal and not only once
per device. This patch checks the timeout value before triggering the
duplication detection for deviceDiscovered() signals.
Task-number: QTBUG-57847
Change-Id: I0e43b779a89b918640fe3d812d2500ed0a016cc3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
QBluetoothSocket::write() emits the bytesWritten(int) signal when the write
was successful. java.io.OutputStream.write() returns an exception when
it fails. We should not emit bytesWritten() if such an exception occurred.
Change-Id: I76e7a85188102e8227d586450c3e733c046e9957
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some devices require the Generic Access (GAP) and Generic Attribute (GATT)
services to be defined. Otherwise they refuse a proper interaction.
This is done implicitly by Android and BlueZ. The reason why BlueZ does
not do this for QtBluetooth is because QtBluetooth sets up its own GATT
infrastructure.
Normally a QLEController in central role cannot do that via public API
as the QLEController::addService() function blocks on peripheral use
cases. This patch sets the profiles up.
In the future the feature really requires a better form of API
(beyond the above env variable) or should be enabled by default
but since we need this earlier than Qt 5.10 a more subtle
approach was chosen. For now the feature can
only be enabled if the QT_DEFAULT_CENTRAL_SERVICES was set.
Another limitation is that the characteristics of the added services
are completely static.
Task-number: QTBUG-61554
Change-Id: Id03bddb2e54cc4f0869838e13ddf281311ad3a26
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QByteArray operator [] has return type of char whose signedness is
dependendent on platform and compiler. Casting char to an enum with
negative value does not work on configurations with unsigned char type.
Fixed by explicitly casting action to signed char before converting it
to enum.
Task-number: QTBUG-60268
Change-Id: I733520a70c321c3b8dac9c67cfb096ac97a64b94
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
| |
Change-Id: I1028bd21ed0950b35ef59598a48e0b274a849d89
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Android collects the SDP information for all devices and puts them
into an sdp cache. Only when the discovery finishes the sdp cache is
evaluated and the serviceDiscovered() signal is sent. The evaluation is
triggerd by _q_fetchUuidsTimeout(). If it is not possible
to retrieve uuids or an address for the last discovered device,
the old code never triggered _q_fetchUuidsTimeout(). As a consequence
QBluetoothServiceDiscoveryAgent appeared to never find any service.
This patch ensures that if the last SDP discovery failed we still
trigger the final UUID evaluation and subsequent serviceDiscovered()
signal emissions.
Change-Id: I8454dc3f7cf3688110e6c86af324d797351b5b33
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DBus does not expose this information. The Bluetooth Management API
advertises the information but requires CAP_NET_ADMIN. The Management
class monitors DEVICE FOUND events and records the random bit flag
of each new device. QBluetoothDeviceDiscoveryAgent can subsequently
add this information to the internal data set.
Ultimately this makes QLowEnergyController::setRemoteAddressType
obsolete. This function was only ever required on Linux.
Task-number: QTBUG-46776
Change-Id: If10df86d332dfc7cc98b7c783eb28487c3fa9045
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
|
|
|
|
|
|
|
|
|
| |
The above error code is the equivalent of Android's Unknown error.
Therefore we map the code to QLowEnergyController::UnknownError.
Task-number: QTBUG-61321
Change-Id: I614c1557c453cd5426f5fa0af69011c4e768657b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to an Android platform bug, SDP discovery may return the wrong uuid
for the remote service. This bug was introduced by Android 6.0.1 and
tracked by https://issuetracker.google.com/issues/37076498.
The returned UUID is byte swapped. To increase
the QBluetoothSocket::connectToService() convenience QBluetoothSocket
uses a fallback which attempts to connect to the remote service assuming
the uuid was byte swapped. This will only happen if the uuid is not
derived from the official Bluetooth base UUID (aka the given UUID is
truly custom).
There is the slight chance that the reversed UUID is a different service
but that chance is very marginal when considering the amount of possible
custom UUIDs.
Task-number: QTBUG-61392
Change-Id: Ia41d670ab8d0666628f067e174965b698d0f26b0
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
|
|
|
|
|
|
|
|
|
| |
The private BluetoothDevice.getServiceChannel() is no longer available
since Android release 6.0+ (v23+). We silently skip it on those
platforms.
Change-Id: Ia924f1c2fe81ccfb50b8abcfb682c350e9ce49ff
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
|
|
|
|
|
|
|
| |
This was missed when doing the same change for the non-Apple platforms.
Change-Id: Ib1ef55acc82d98def4e1fc1ca228dabe6a13f241
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
QBluetoothServiceDiscoveryAgent performs SDP based Bluetooth service
discovery. There is no need to do a BTLE discovery for the purpose of
triggering an SDP service discovery.
Change-Id: I16448b603e80e778b71ee397c0db14d0502d3acf
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
| |
The sdpscanner tool was separated and talks to QtBLuetooth via
stdin/stdout. This limited the GPL to the sdpscanner tool only.
Change-Id: Id4849cc17945642a1c5708811d34f38128d42316
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
src/bluetooth/android/devicediscoverybroadcastreceiver.cpp:240: warning: Cannot tie this documentation to anything
[I found a /*! ... */ comment, but there was no topic command (e.g., '\fn', '\page') in the comment and no function definition following the comment.]
The file referenced in the warning does not contribute to the QtBluetooth
documentation. The patch removes qdoc annotation from the file.
Change-Id: Ie5699d79a12e5fc1851a924adbf50ebcb5059454
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the same time we remove the redudant and temporary packet variable.
This was highlighted by a compiler warning:
In function void* memcpy(void*, const void*, size_t),
inlined from void qToUnaligned(T, void*) [with T = short unsigned int] at /home/ablasche/dev/qt/qt59/qtbase/include/QtCore/../../src/corelib/global/qendian.h:82:5,
inlined from void qToLittleEndian(T, void*) [with T = short unsigned int] at /home/ablasche/dev/qt/qt59/qtbase/include/QtCore/../../src/corelib/global/qendian.h:227:3,
inlined from void putBtData(T, void*) [with T = short unsigned int] at bluez/bluez_data_p.h:196:5,
inlined from void QLowEnergyControllerPrivate::readServiceValuesByOffset(uint, quint16, bool) at qlowenergycontroller_bluez.cpp:1692:34:
/usr/include/x86_64-linux-gnu/bits/string3.h:53:71: warning: call to void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int) will always overflow destination buffer
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
Change-Id: I5b8d7781b78ea3e07e30b9b830a4d8885bb8c989
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|\
| |
| |
| | |
Change-Id: I60b91ca386c04a7710f50c5442982f41299d4f8e
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This shows the example prominently on the Qt Creator Welcome screen.
Change-Id: I6f207e888e6129235356b839a2bb7fecc1fe28a4
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Sami Makkonen <sami.makkonen@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
|