BleGattCoroutines: Receive channel's poll fails when dicoverServices is called and keeps app stuck
When we call our device’s deviceConnection.discoverServices()
it calls the method written at line 317 of com/beepiz/bluetooth/gattcoroutines/GattConnectionImpl.kt
, gattRequest
. This method receives a channel (ch: ReceiveChannel<GattResponse<E>>
) for the request purpose and after a few instructions calls ch.reveice()
on this channel. That’s when the problem occours.
The channel throws an error internally the polls fails (as the following print shows) and the exceution goes all the levels up, like when an exception is thrown, but this time without any clue of an error being thrown:
These are the last captured logs:
D/BluetoothAdapter: STATE_ON
D/BluetoothGatt: connect() - device: 00:15:90:91:CE:C2, auto: false
D/BluetoothAdapter: isSecureModeEnabled
D/BluetoothGatt: registerApp()
D/BluetoothGatt: registerApp() - UUID=5ab39c56-c260-4491-9cac-58843c486207
D/BluetoothGatt: onClientRegistered() - status=0 clientIf=8
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=00:15:90:91:CE:C2
D/BluetoothGatt: onConnectionUpdated() - Device=00:15:90:91:CE:C2 interval=16 latency=0 timeout=800 status=0
D/BluetoothGatt: onConnectionUpdated() - Device=00:15:90:91:CE:C2 interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt: onConnectionUpdated() - Device=00:15:90:91:CE:C2 interval=16 latency=0 timeout=800 status=0
D/BluetoothGatt: discoverServices() - device: 00:15:90:91:CE:C2
D/BluetoothGatt: onSearchComplete() = Device=00:15:90:91:CE:C2 Status=0
I tried to capture any thrown exception around the discoverServices()
call, but the cursor never comes back to my code after that ch.receive()
call.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 26
My bad, it’s defined in buildSrc/build.gradle.kts
On Wed, Jan 22, 2020, 12:53 Luiz Machado notifications@github.com wrote: