2

Hi I am working on BLE connection with BluetoothAdapter I have found that my prob gets disconnect after some hours in Android O+ devices. After analysing Log file BluetoothGATT is returning onClientConnectionState() - status=22 clientIf=8 status. How do I solve this problem?Is this problem is related to BLE device or android API level issue is there?

BluetoothGatt: onClientConnectionState() - status=22 clientIf=8 device 2019-02-15 11:06:28.614 1569-1569/E/ManagerActivity: Receiving broadcast update 2019-02-15 11:06:28.614 1569-1569//ManagerActivity: ACTION_GATT_DISCONNECTED

bug report from developer option I have found 'reason Remote user terminated connection'

hannna patait
  • 355
  • 2
  • 11
  • Code 22 means that Android chose to disconnect the device. You need to add more info in order to be able to determine the cause. For example, do you have an app running that keeps the connection open? – Emil Feb 25 '19 at 06:56
  • App is running continuously but in google pixel after some hours it goes disconnected with same status error. – hannna patait Feb 25 '19 at 09:39
  • We have also tried to reconnect the BLE in such condition but failed to do so, as it was completely off at that time. It was not in advertising mode. – hannna patait Feb 25 '19 at 09:58
  • Do you get the callback onConnectionStateChange in your app? – Emil Feb 25 '19 at 10:07
  • Yes, it is printing Log statement from the same `if (DBG) { Log.d(TAG, "onClientConnectionState() - status=" + status + " clientIf=" + clientIf + " device=" + address); }` – hannna patait Feb 25 '19 at 10:11
  • here due to disconnection BLE device stops advertising – hannna patait Feb 25 '19 at 10:28
  • Emil I have stuck with this issue from one month and this problem is unidentified why BLE device is disconnecting. Is it Device issue or OS issue? – hannna patait Feb 26 '19 at 05:03
  • You could try "Take bug report" in Android developer settings. Then read the big text log file to see if you can see any reason why it disconnects. Also which phones does this problem happen on? – Emil Feb 26 '19 at 09:22
  • 1
    I have tried on Google Pixel 1 Android version 9 and BLE device gets disconnect after every 18 hours 20 minutes with the same status i.e. 22 – hannna patait Feb 26 '19 at 10:58

0 Answers0