| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Change-Id: I1733dc2b63c491b4facfa7683865723406eb5812
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
|
|
|
|
|
|
|
| |
This happened when the remote device closes the socket and the local
Android device tries to reconnect using connectToDevice().
Change-Id: I1d8e3bfaea5f956cd71e390f4ab6e9d39256a66d
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
|
|
|
|
|
|
|
|
| |
This can happen if the QLowEnergyController was created, connected,
disconnected and last but not least a second app reconnects.
Direct BTLE device interaction with bluetoothctl can cause this.
Change-Id: I4a2c68a018b7eb9b866a54cc127e03f6c4bf6672
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
|
|
|
|
|
|
|
| |
[ChangeLog][QBluetooth][Android] Forced QBluetoothSocket to close when
its dtor is called
Change-Id: Ie31a6b64e4939c800983b5c497532c6fcf90c7c0
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling BluetoothSocket.connect in Java blocks for a certain amount of
time. Previously, QtConcurrent::run() was used to separate the
Java connect() call out into a different thread. Since the function
executed by QtConcurrent and the user facing class shared data fields,
a crash occurred if the user deleted QBluetoothSocket while
QtConcurrent hadn't executed its service connect call yet.
The problem is solved by using QThread and Standard signal/slots
which separates the shared data members. The only remaining shared data
member is Java's BluetoothSocket instance which is shared via
QAndroidJniObject references. This is no problem as deleting one
reference retains the other reference.
Calling close() on an Android BluetoothSocket while a connect() is
ongoing seems to be buggy. Sometimes the close() returns, the pending
connect() throws an exception but the physical connection still
gets established. To avoid this the patch queues the close() call
up until after the connect() statement has returned. It is
accepted behavior that the connection might still get enabled for
a very brief moment despite a close() being issues before the connect()
actually finished.
The SocketConnectThread cleans itself up once the thread finished().
Task-number: QTBUG-44930
Change-Id: I8324497a7395de390529ecd0b97b1a326cd78f63
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The list of internally discovered devices was already cleared. It should
not be referenced anymore. Furthermore the QBluetoothSocket is
killed while its internal QBluetoothServiceDiscoveryAgent is still
running. This change stops the agent as well and thereby
prevents more QBluetoothSocket slots froms being invoked and a more
controlled termination of QBluetoothServiceDiscoveryAgent.
[ChangeLog][QtBluetooth][Android] Fixed crash in
QBluetoothServiceDiscoveryAgent on Bluez 5 when using single device
discovery. Single device discovery is used during
QBluetoothSocket::connectToService().
Task-number: QTBUG-44930
Change-Id: Ib3129c492151a3fe12b0c451cf5ffdddc62d001c
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In general BluetoothAdapter.getDefaultAdapter should not throw an
exception. If the device does not support Bluetooth the function should
return a null reference only. However some devices throw a
RuntimeException as well. We need to catch it to prevent unwinding of
the stack.
At the same time the patch simplifies the code by using
QAndroidJniObject where possible.
[ChangeLog][QtBluetooth][Android] Fixed crash in QBluetoothLocalDevice
ctor on some devices due to a platform exception in
QBluetoothAdapter.getDefaultAdapter().
Task-number: QTBUG-45066
Change-Id: I933783cda891127e5e37722f96f477c13b433ca7
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The bluez implementation of QLowEnergyController now responds to
requests with a "Request not supported" message, instead of ignoring it.
If such requests are ignored, the remote will close the connection after
30 seconds, according to the bluetooth ATT specification.
Task-number: QTBUG-44915
Change-Id: Id81b4a31d92a48269eda7d6c2d5995639dffe00a
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
This applies to Android versions 4.1.x and below. The function returns
BluetoothDevice.ERROR or -1 in case of an error. So far only the ERROR
case was caught.
Task-number: QTBUG-44792
Change-Id: I512f846d74f2a03b2e6f5bf4df4127d584993f6c
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
serviceUuid() may be null and is not the same as the service class
uuid.
Task-number: QTBUG-44442
Change-Id: I200db4e2a403fabb8d1b5814b9d615dfc76a627d
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
|
|
|
|
|
|
|
|
|
| |
This affects Bluez 4 & 5.
Task-number: QTBUG-44452
Change-Id: Ifa9f6c56499bece3d99dba65a0afeed6c2ed60ac
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
| |
bswap_16 isn't defined anywhere, use qbswap from <QtCore/qendian.h> instead.
Change-Id: I9ee260752ab7bcae3bbd30b4b71d30d52c837a2b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I0b98c18e0943b250debcf6e5461ddb19fba024ab
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I01f01575a03d95f558b1f1994e0c76b22b3c19e0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The plain text option was never triggered as the raw data processing
always considered \0 as part of the string. Subsequently the string
was always evaluated to be non-printable and the hex based handover
was triggered. Fortunately the hex based handover worked without
trouble.
In addition the plain value was not properly escaped to be valid XML.
Change-Id: I537a94ef4705c7eeab143b3053affc6abbd548cc
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: Ifdb98e21999ecdcf57c89a3664b8d0db796c73a1
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\
| |
| |
| | |
Change-Id: I1d15de1e31aeecfe162d700c632ad59cc0d6077d
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The example immidiately destroys the QBluetoothServiceDiscoveryAgent
when the user selects a remote chat service from the remote selector
dialog. This may happen even when the scheduled QtConcurrent call
to runSdpScan() was still pending. The subsequent signal callback into
the deleted parent caused a crash.
Unfortunately QtConcurrent::run() returns a QFuture which does not
permit stopping the pending thread execution. Therefore the runSdpScan()
had to be rewritten using QProcess to properly destruct pending
calls.
Change-Id: I1ed5e147feb94a26240901a02d836056eddabbf6
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: I1f4f3ace78b4619a43581182d885c479314a7603
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Based on Bluetooth spec Vol3 PartB 5.1.7 the BrowseGroupList consists
of a data element sequence. The current approach was not correct.
This was discovered because Bluez5 doesn't add a custom service to the
Extended Inquiry Response (EIR) unless it is in a sequence. If the
service is not part of the EIR other platforms such as Windows report
an error or won't simply see the service.
This was not a problem when using Bluez4 because it was more
tolerant towards such mistakes and added the custom service to the EIR
anyway.
Task-number: QTBUG-43806
Change-Id: Ib0ca59005c940249fb6aefd8ecafe5b2ceff3878
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
|
| |
| |
| |
| |
| | |
Change-Id: I4a3907dc1f8b8608b1c1b34e16d2e987cdc23be3
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In certain situations internal java objects of QBluetoothSocket
cannot be deleted fast enough. This causes a crash when the local
reference table exceeds its maximum size of entries.
This patch converts the pure JNI code to a QAndroidJniObject based
version. It ensures faster cleanup of local jobject references
and improves readability too.
[ChangeLog][Platform Specific Changes][Android] Fixed leaking
of java objects when calling QBluetoothSocket::connectToService() on
Android.
Task-number: QTBUG-44164
Change-Id: Iaa696bfeee69c6a79f3aeddec262ae34d8891743
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The required API became public in Android v19 which is what was used as
check so far. However the same API was already privately provided
since Android v15. THis patch ensures that older Android versions
can create pairing requests too.
This patch was provided by George Najarian.
Task-number: QTBUG-43757
Change-Id: I0f38e538a972341a6acf719098f1010e52b639b7
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With -no-c++11,
- Enum type names cannot be used as namespaces. Use old style naming.
- For errno, errno.h must be included.
- stdint.h must be included to use uint*_t types. Use quint*
equivalents instead.
Change-Id: I992f531a46cfc997df0aa6fc7ff6bf75fb750fc6
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|/
|
|
| |
Change-Id: I59b24ee6fa29e005233283a10664644d60b7df3c
|
|
|
|
|
|
|
|
| |
It becomes more obvious on platforms which do not support Bluetooth
that the example will not work.
Change-Id: Ia6d249a4a891f93abf29910500ba164662308889
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
|
|
|
|
| |
Change-Id: Ic018bf8b03e887da5448e0bcd6fdb18219fad184
|
|
|
|
|
|
|
|
|
| |
The class' behavior strongly deponds on its state. This can be
confusing. This patch reduces the behavior uncertainties.
Change-Id: Ib5cd8e821f2bb9aca5b579abf4ae98918f951f24
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\
| |
| |
| | |
Change-Id: I3f85a68066352e0b163f47d2b8ada1d0b8d34f33
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is caused when running a service discovery on an Android emulator.
The emulator does not have a local Bluetooth device despite the Qt code
assuming it.
Change-Id: I9c0d826d14e7494bfeb27d449f9b6f568860d917
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QBluetoothServiceDiscoveryAgent::InvalidBluetoothAdapter was introduced
by Qt 5.3 but never added to the QML BluetoothDiscoveryModel. This patch
fixes the problem.
This was noticed due to a crash on Android emulator.
Change-Id: I652576929659ca370216133154e36158e8425711
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| | |
Change-Id: If6fccce951c2f3c3787cde2fa593e65da26f4370
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This caused problems when disconnecting from the remote device while
an openrequest was pending and if the controller tried to reconnect
immediately afterwards. The pending request queue was blocked forever.
Change-Id: I444d5ac6763b65ec8baf687e0dccec4b28016a6c
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\ \
| |/
| |
| | |
Change-Id: Ib79fe0b33b405cdf6fee87f97f6ebb86bb79d976
|
| |
| |
| |
| |
| | |
Change-Id: Ia82082ce24c98b69697b348dc20164b8ec034a0b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| | |
Change-Id: I9eca03f01ba01e9952c28c6d4bd14f656aa5d838
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| | |
Change-Id: Ie51d6e549d80baae57864d4e0d43a1c58897f149
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
|
| |
| |
| |
| |
| |
| | |
Change-Id: If62bce8794855b8865e02ed87ec3faac80bfc3bd
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|/
|
|
|
|
|
|
| |
A logical condition was inverted.
Change-Id: Ia7b54fe75a8cea4275e3c92c6283bc12f3423b64
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
Previously the UI was only updated when a new service was discovered
on a device. In the extremely rare event of no services being found
the UI was hanging in the "Searching for services" view.
Change-Id: I245216ac4e373a765dea2e182ab541e8830417d0
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1.) The QLEController may error out during connectToDevice() which does
not require the eventloop to run. At the same time the services view
is not yet loaded. Subsequently the services view never notices the
errors and loads as if the controller is still trying to connect.
2.) The services view can only be left when a disconnect() signal is
received. During a connection error the disconnect never happens
because the connect never happened. Artificially introduce a disconnect()
when the controller is not connected but disconnect was called by the UI.
This part should be cleaned up to properly allow tracking of the
controller's state in the future.
Change-Id: I2cbd90d55b5e70fb275a8f4563d9436419874e6d
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
| |
What is really needed is a new ConnectionError for this case. This new
error will shortly be introduced to the btle/5.5 branch.
Change-Id: I751fa0eeb5cf4d0b78863842c94770f4e8e74015
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
| |
Previously the error was indicated but other UI elements were still
giving the impression that the scan was ongoing.
Change-Id: Iafab8f43bff3303eb6ad5e3385db2f81288d2e66
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
| |
warning: 'QLowEnergyDescriptorPrivate' defined as a struct here but previously declared as a class [-Wmismatched-tags]
Change-Id: I2b90a645ed5aa2d86184d94acb2658460f26f660
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The value is needed for platforms which do not provide this type
information. An example are Android versions below 18.
The enum was added in Qt 5.4. Therefore we need to add
the missing \since tag too.
Change-Id: I23582e7500d8da6740b281ba9821d028c4f33e05
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
| |
Change-Id: I918bd3b4134504d5bfc3e160adeb97187186df3d
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
|
|
|
|
|
|
| |
Change-Id: I8c659233fd6eb2232d7bd9d904ce14f1de8a9d34
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
| |
Change-Id: Ib8800fa30c74678c74df9ed943b143ea4cf49bb2
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|
|
|
|
|
|
|
| |
Change-Id: Ifd6b5ed8176aa7959ed8da0edc762266aa2bd6fa
Task-number: QTBUG-32704
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
|