Reputation: 23
my android application runs as central is connected to a peripheral, enables notifications and the peripheral starts sending.
my problem is that the connection is terminated after about 13 seconds.
below i have the logcat information.
What is status 59 of Bluetooth LE in Android?
BluetoothGatt: connect() - device: C5:7F:B0:8E:AA:91, auto: false
BluetoothGatt: registerApp()
BluetoothGatt: registerApp() - UUID=3a9c080d-ae20-47ea-b34c-7ea7798204cc
BluetoothGatt: onClientRegistered() - status=0 clientIf=5
BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=C5:7F:B0:8E:AA:91
BluetoothGatt: discoverServices() - device: C5:7F:B0:8E:AA:91
BluetoothGatt: onSearchComplete() = Device=C5:7F:B0:8E:AA:91 Status=0
BluetoothGatt: setCharacteristicNotification() - uuid: 00002a05-0000-1000-8000-00805f9b34fb enable: true
BluetoothGatt: setCharacteristicNotification() - uuid: 00001625-1212-efde-1523-785feabcd123 enable: true
BluetoothGatt: cancelOpen() - device: C5:7F:B0:8E:AA:91
BluetoothGatt: onClientConnectionState() - status=59 clientIf=5 device=C5:7F:B0:8E:AA:91
BluetoothGatt: close()
BluetoothGatt: unregisterApp() - mClientIf=5
Upvotes: 2
Views: 2607
Reputation: 624
I've had the same issue. After some digging i found in our case statuscode 59 (or 0x3B hex) pointed to HCI_ERR_UNACCEPT_CONN_INTERVAL
.
By examining the Bluetooth HCI snoop logs from my phone i discovered that the ble device is negotiating with the phone about connection parameters. The device requested a connection interval of 7.5ms and the phone rejected this. After three times (15ms) the device disconnected and resetted.
I've found this post saying the minimum connection interval in Android 6.0 has changed to 12.5ms. So if you adjust the connection interval that the device requests, you'll probably keep the connection.
Upvotes: 4