Android 5 - bluetooth disconnection

asked 2017-10-12 20:55:08 +0200

sigurdon gravatar image

updated 2017-10-13 10:09:44 +0200

Is there a way to workaround bluetooth unstability for Sony Xperia Device?

Device : Sony Xperia - different models Android Version: lollipop

Background: - Bluetooth connection is stable for the other devices tested Android 6, 7 - The Application recovers the connection successfully afterwards - Is there anyway to stabilise this connection

Best Regards,

Test: - Connect to the device, services are discovered successfully, the application works 30 seconds and then:

  • disconnects(bluetooth adapter disabled automatically)
  • reconnects
  • repeats

Logs:

10-12 20:43:52.920 15382-15428/? W/bt-btif: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0008
10-12 20:43:52.920 15382-15428/? W/bt-btif: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0008
10-12 20:43:52.920 15382-15428/? W/bt-btif: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=5 reason=0x0008
10-12 20:43:52.921 15382-15428/? E/bt-btm: btm_sec_disconnected - Clearing Pending flag
10-12 20:43:52.921 15382-15428/? W/bt-btif: btapp_gattc_req_data :Src read.p_value ptr is NULL for event  0x3
10-12 20:43:52.921 15382-15428/? W/bt-l2cap: L2CA_SetDesireRole() new:x0, disallow_switch:0
10-12 20:43:52.923 15382-15404/? D/BtGatt.GattService: onDisconnected() - clientIf=5, connId=5, address=FD:78:33:E3:D9:9F
10-12 20:43:52.926 9826-9843/ch I/APILOG - Info :: BleManagerGattCallback.BluetoothGattCallback.onCharacteristicRead - called
10-12 20:43:52.927 9826-9843/ch I/APILOG - Info :: BleManagerGattCallback.BluetoothGattCallback.onCharacteristicRead - GATT NOT SUCCESS
10-12 20:43:52.927 9826-9843/ch D/BluetoothGatt: onClientConnectionState() - status=8 clientIf=5 device=FD:78:33:E3:D9:9F
10-12 20:43:52.928 9826-9843/ch D/APILOG - Debug :: BleManagerGattCallback.BluetoothGattCallback.onConnectionStateChange - status: 8, state:  0
10-12 20:43:52.928 9826-9843/ch D/APILOG - Debug :: BleManagerGattCallback.BluetoothGattCallback.onConnectionStateChange - DISCONNECTED
10-12 20:43:52.928 9826-9843/ch D/APILOG - Debug :: BaseConnectionManager.setState() - connection state: disconnected
10-12 20:43:52.928 9826-9843/ch I/APILOG - Info :: Device.onDisconnected - called
10-12 20:43:52.929 9826-9843/ch D/APILOG - Debug :: Device.disconnect - called
10-12 20:43:52.929 9826-9843/ch D/APILOG - Debug :: .killConnection - called
10-12 20:43:52.929 9826-9843/ch D/APILOG - Debug :: .disableNotifications - disableNotificationsCharacteristics Size: 2
10-12 20:43:52.929 9826-9843/ch D/BluetoothGatt: setCharacteristicNotification() - uuid: 3ab10101-f831-4395-b29d-570977d5bf94 enable: false
10-12 20:43:52.960 15382-15382/? D/BluetoothMapService: onReceive
10-12 20:43:52.961 15382-15382/? D/BluetoothMapService: onReceive, action android.bluetooth.device.action.ACL_DISCONNECTED
10-12 20:43:52.984 15382-15400/? D/BtGatt.GattService: registerForNotification() - address=FD:78:33:E3:D9:9F enable: false
10-12 20:43:52.984 15382-15400/? E/BtGatt.GattService: registerForNotification() - No connection for FD:78:33:E3:D9:9F...
10-12 20:43:52.985 9826-9843/ch D/APILOG - Debug :: .disableNotifications - characteristic: 3ab10101-f831-4395-b29d-570977d5bf94Disabled: true
10-12 20:43:53.045 8975-8975/? I/BTConnectionReceiver: onReceive(context, Intent { act=android.bluetooth.device.action.ACL_DISCONNECTED flg=0x4000010 cmp=com.google.android.googlequicksearchbox/com.google.android.search.core.service.BluetoothConnectionReceiver (has extras) }, [BluetoothDevice: address=FD:78:33:E3:D9:9F, alias=null, name=devicename 72913173, majorDeviceClass=7936, deviceClass=7936]
10-12 20:43:53.046 8975-8975/? I/BluetoothClassifier: Bluetooth Device Name: devicename 72913173
10-12 20:43:53.185 9826-9843/ch D/BluetoothGatt: setCharacteristicNotification() - uuid: 3ab10102-f831-4395-b29d-570977d5bf94 enable: false
10-12 20:43:53.186 15382-15400/? D/BtGatt.GattService: registerForNotification() - address=FD:78:33:E3:D9:9F enable: false
10-12 20:43:53.186 15382-15400/? E/BtGatt.GattService: registerForNotification() - No connection for FD:78:33:E3:D9:9F...
edit retag flag offensive close delete report spam

Comments

  1. Are you able to provide a sniffer trace?
  2. I assume that you are using a Nordic IC since you ask here? What IC, SDK and Softdevice versions are you using?
  3. Do you get any logging or debug information out of the IC?
  4. Have you debugged your code and made sure that the code is not asserting?
Martin Børs-Lind ( 2017-10-13 11:21:16 +0200 )editconvert to answer
  1. No there is no sniffer information at the moment - I dont have bluetooth sniffer - should I get one or there is an alternative?
  2. Yes the bluetooth chip is provided by Nordic, BLE 4.0 (pending to get the information)
  3. No there is no further debug information on the IC side
  4. The code is working in android 6,7 and 5 (for other devices using nordic IC)

Best Regards,

alejandro ( 2017-10-13 14:20:28 +0200 )editconvert to answer

Q1: You can use a Nordic development kit and our sniffer solution. A sniffer trace can be extremely valuable in cases like this.

Q2: Any news?

Q4: Have you debugged your application code running on the Nordic IC and made sure that the code is not asserting?

Martin Børs-Lind ( 2017-10-17 14:03:36 +0200 )editconvert to answer