| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Call to includedServices() from Qt side after unexpected disconnection
leads to NullPointerException due to unchecked member access. Fix that!
Change-Id: Iae89801d7af86d5a3f34ebba9eb2ea12da252cd2
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
| |
Change-Id: I2202fa305f4c50e97ae7701096b2f8e0bb9b3daf
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Method enableForegroundDispatch and disableForegroundDispatch is not
implemented on some WearOS devices and will throw an exception.
Let's check if the NFC feature exists.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at org.qtproject.qt5.android.bindings.QtApplication.invokeDelegateMethod(QtApplication.java:157)
at org.qtproject.qt5.android.bindings.QtApplication.invokeDelegate(QtApplication.java:146)
at org.qtproject.qt5.android.bindings.QtActivity.onResume(QtActivity.java:626)
at com.governikus.ausweisapp2.MainActivity.onResume(MainActivity.java:139)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
at android.app.Activity.performResume(Activity.java:7117)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1638)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.UnsupportedOperationException
at android.nfc.NfcAdapter.enableForegroundDispatch(NfcAdapter.java:1315)
at org.qtproject.qt5.android.nfc.QtNfc$1.run(QtNfc.java:135)
at android.app.Activity.runOnUiThread(Activity.java:6184)
at org.qtproject.qt5.android.nfc.QtNfc.start(QtNfc.java:111)
at org.qtproject.qt5.android.QtNative.updateApplicationState(Native Method)
at org.qtproject.qt5.android.QtNative.setApplicationState(QtNative.java:260)
at org.qtproject.qt5.android.QtActivityDelegate.onResume(QtActivityDelegate.java:1098)
... 16 more
See: https://stackoverflow.com/questions/48437854/huawei-watch-2-nfc-feature-not-available-android-wear-2-0
Change-Id: I0e2cad3dce1c3c0a2ea2545fcc6731e2621cdc38
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
| |
c8e6dae2d9749179327df460755282cf5102e902 introduced this requirement.
Change-Id: If0b20a666d6dad999db05dfe311b0ed75aa333ff
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
| |
To avoid polling of the NFC adapter state
a signal is added to the QNearFieldManager.
Change-Id: If9e1e8025cca2deb1338fa7db255ebe171cab823
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ia496130e0d71a85670af3ca1cadf81c71d3c2462
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The patch fixes the obvious problem of the crash. The question is however
what might have caused entries to be empty. The only theoretical explanation
is the remote device being disconnected (which resets most internal data).
Task-number: QTBUG-65826
Change-Id: I6b3509248f795d9cee5dcfe0c6e0caf06405b4e4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I1cb008cda8abe9a4167f3f62f003583141d217c1
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch addresses two bugs. Firstly it ensures that the correct Java
function is executed when disconectFromDevice() is called on Android
peripheral.
Secondly, it turned out that calling disconnectFromDevice() while a
connection to a central exists and restarting the advertisement
resulted in a non-functional QLEController instance because
BluetoothGattServer was not properly restarted. As a side effects
the controller's state tracking stopped as well.
Change-Id: I98851fc974ceff2a1fcb03fe754dbda9c4aba271
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ib695b1c1e59904f65bf60f0fe9878483e608e737
|
| |
| |
| |
| |
| |
| |
| |
| | |
The values were never obtained on the Java side.
Task-number: QTBUG-67651
Change-Id: Ifceb124b07cf505c4e96fe7ba9d58364b3923c3a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|/
|
|
|
|
|
|
| |
Add API method isSupported to allow to check if the device supports NFC
Task-number: QTBUG-62169
Change-Id: I4ff7f06348ecc902e66ee79bdd8abde672578904
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the pre-dexed JAR files activated by the absence of the
bundled_jar_file CONFIG option, as versions of Android >= 5 no longer
support this deployment mechanism.
Now, the "bundled" JARs simply become normal JARs containing class
files, and are neither activated by a bundled_jar_file CONFIG entry nor
do they have a -bundled suffix in the file's base name.
Task-number: QTBUG-62995
Change-Id: Ifc13542ff71844da7e80cefe9ff51e3d7cdfc830
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
|
|\
| |
| |
| | |
Change-Id: Ida3681a873698f22c28bc60230ca0c49d2a9d25f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
| |
Change-Id: Iaaa79b2f14e7abd5d849895301ed404efa079f07
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Android throws a security exception (BLUETOOTH_PRIVILEGED) when reading
HID services. Since the permission is not available for 3rdparties
this is never obtainable by apps. We need to skip over those cases.
Task-number: QTBUG-59917
Change-Id: I09b55740287812b0697b857d7eb8a77190d36e44
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/bluetooth/qbluetoothsocket_bluez.cpp
Change-Id: I37e21b3c636a241a357bc81fc23da51303b94623
|
| |
| |
| |
| |
| | |
Change-Id: Iee2f8e02a926129dfdd1c82d0fa84dfbb45303d3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this patch Qt NFC detects only NDEF tags and signals targetDetected/targetLost are never fired for simple tags
Task-number: QTBUG-59455
Change-Id: Ic868b6d66f35f790f6aba0ec30afc96fa32a5b6a
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This permits the server itself to change descriptors at runtime.
Change-Id: I5d60cfb1838ba83737cd748671520c7072201bc4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With this change it will be possible to use a tag
injected from outside when running as a service.
Intent newIntent = new Intent();
newIntent.putExtra(NfcAdapter.EXTRA_TAG, tag);
QtNative.onNewIntent(newIntent);
Task-number: QTBUG-57646
Change-Id: I628d4357f023a0926e7d61914b39278342ac7161
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This includes the correct handling of client characteristic notifications (CCNs).
As per Bluetooth spec this descriptor is unique for each device.
If a characteristic was changed all chars with enabled CCNs are notified.
CCN settings are even retained while the remote device is not connected.
Change-Id: Iec612e6a5e70206a6be0263e10e615c26def7559
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I28a165c7b7503b1c8159dd0c46f3f7450e599c74
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I3aa89926c5237ee8da18b73f66f0c7a321a83c91
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I60e5bdce4256804754909c2538aebe581897e1e9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Emits the above signal when the remote client successfully updates
a characteristic.
Change-Id: I236b1f92b682028bc10be798192f46bffc981101
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I9684e4cc76336250b235a261fdc8924a2ca70086
|
| |
| |
| |
| |
| |
| |
| |
| | |
a regression has been introduced by the service discoverer refactoring,
causing an empty service to stuck in DiscoveringServices state for ever
Change-Id: I1d339279e77f5409231d5fbd3677f9e2eb98a0a8
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The dreaded GATT_ERROR 133 (0x85) is a long standing issue in Android.
There have been continued efforts to reduce it up until Android N:
https://code.google.com/p/android/issues/detail?id=192561
Tests have shown that the new BluetoothGatt.connectGatt() overload
is much more reliable. Android v23+ gets some relief and Android v21+
gets unofficial/hidden relief.
Reports indicate that error 133 is timeing related. While the new
connectGatt() call seems to resolve this problem it is throwing
the timeing related error 22 more proactively. Very quick
connect()/disconnect()/connect() calls can cause the error. The patch
adds a more specific error code handling for error 22 to provide
some hints on what the user can do to prevent it.
Task-number: QTBUG-56078
Change-Id: Ib14d503701cee7ea766247b712106302cba896f3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I0fed368384fbfd4e9e8be74b7a586cbf2ed10218
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If advertisement fails then we drop back into the unconnected state
and provide a more detailed error message for individual advertisement
errors.
Change-Id: Ic9de02b456409cd1a2dec11e53c884fe368ae267
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: Id2cabd9df7b5387fe5e6f1c898fe02e40f7c0a3d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Unfortunately, Android only provides access to a very generic connection
priority. The patch uses the minimalInterval() to determine the desired
priority. Everything below 30ms is high priority and everything above
100ms is low priority. Every other value is balanced priority.
QLowEnergyController::requestConnectionUpdate() was modified
to permit access when the controller is connected, discovered or
in the process of being discovered. The limiting factor is an
existing physical connection.
The documentation was updated to reflect Android's API limitations.
[ChangeLog][QtBluetooth][Android] Added access to BTLE connection
parameter settings.
Task-number: QTBUG-53476
Change-Id: I3e22c65bd9598296a9219463dd05f0d9fc73599d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Advertisement data and Advertisement parameter in Qt are
now connected to the Android/Java side. In addition the basic
service structure is supported.
Descriptors and char detail export are still missing.
Change-Id: I941cba5e832d76ff7beca811d08a2148367c6bf5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I4403a9d5c79fae2c6bbe9c478660ead01dc16fe4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Focus is on the Java side of things. The Gatt server & LE advertiser
can be started and stopped.
This patch builds the foundation for future changes. The C++ side is only
very rudimentary and a lot of debugging helper are left inside the
new code sections.
Change-Id: Ic56da3ec6471ccb438fc2088fbf5eeb3053d5cf1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If during discovery the read of a characteristic fails, then this
characteristic was not added to the service. This happens in a special
case and not always, when we try to read from a notify only
characteristic.
Now the characteristic will be added even if the read fails.
Task-number: QTBUG-58056
Change-Id: Ib802eeb66aeae92da690c296faf57331123353e6
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
| |
During discovery, if a descriptor read fails the current implementation
tries to read from a nil bytearray. Now the bytearray is checked before
access.
Change-Id: Ic04809fa81c25c7abdd8a82a1ccefe43de7f5605
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
| |
May occur relatively too often to remain unhandled
Change-Id: I89b1255605a29d959635e8d1965e9596b591b305
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some GATT characteristics or descriptor do not respond when a request
is being submitted. This can cause a staling of the service discovery
process.
This commit introduces a timeout handler which fires in such cases
and ensures that service detail discovery continues with the next
handle.
Task-number: QTBUG-52692
Change-Id: I466e13c337f28ac944190ad3bd522ca018373b30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|\
| |
| |
| | |
Change-Id: I1352bca5d8b8afee5e7c06fdb1172e5f3f9678b6
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently the advertising packet (scan record) received from BLE devices
during scanning on Android devices is ignored. Consequently, the
serviceUuids() method of the QBluetoothDeviceInfo class returns an empty
list for BLE devices. However, this list provides important information needed
by clients to identify whether a given device is of interest.
This changeset implements parsing of the scan record received from the
Android Bluetooth layer. The Java byte array is passed over JNI to the
C++ adapter classes, where it's parsed to find any service UUIDs being
advertised by the device.
Parsing the scan record ourselves is required for compatibility (Qt uses
"old-style" LE scan API from Android api level 18.)
All found UUIDs are added to a list which is subsequently passed to the
user of the QBluetoothDeviceDiscoveryAgent class via the
deviceDiscovered(QBluetoothDeviceInfo&) signal.
Note: not all Android devices pass the full advertisement data. The
service UUID list may be empty in those cases.
[ChangeLog][QtBluetooth][Android] Parse list of advertised services found in
LE scan record and pass them to API client via
QBluetoothDeviceInfo::serviceUuids()
Task-number: QTBUG-56625
Change-Id: I253f1b841c7b15b3bbabc9e478de87c81979815e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now service discovery runs via the read/write queue which was already
in use for normal (read|write)(characteristic|descriptor) functionality.
This reduces the to be locked code section as the queue
is the only locked data structure.
Task-number: QTBUG-52692
Change-Id: Ide8d697b88f0ed40f83dab608b8457f45db42271
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-52692
Change-Id: Id9fecd98a9031f2bcb561143b66b74ccea751db2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The added functions are not yet hooked into the running code.
Task-number: QTBUG-52692
Change-Id: I75faade55d68719d1da91348ed17c462942659ea
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The runningHandle variable keeps track of the same information as the
GattEntry tables. We don't need two systems. This brings initial service
discovery closer to the normal read/write queue system.
Ultimately the goal is to merge the initial service discovery state
machine and the read/write queue system into one. This reduces blocking
issues and simplifies the implementation.
Task-number: QTBUG-52692
Change-Id: Idd14212cb02e6c3737b5296adf1525ff7f7832a1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
| |
It cannot really be fixed sind Android's NFC API requires Activity
objects. We merely ensure that the service case is discovered early,
reported accordingly and documented properly.
Change-Id: If75856eea3da5c6283a3cb988daffd7a36cc02a7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|