bt_btm_sec: btm_sec_disconnected clearing pending flag handle: reason:22

Keywords: Attribute Mobile Android

Problems encountered in BLE connection

Before the connection, discovery service, reading and writing are normal, today I suddenly clicked on the system Bluetooth page matching.
After that, the BLE device can not be connected alive or dead, and the connection will be disconnected immediately.
But mobile phones can normally connect to other devices of the same type, and other mobile phones can also connect to this device.
Previously, it would be normal to close Bluetooth and turn it on again if you had similar connection problems. This turn-off of Bluetooth and turn it on again is invalid.
In the Bluetooth settings of the system, the device tries to cancel the pairing. As a result, this option can not be found. Connecting to other devices of the same type has the option of canceling the pairing, connecting to Bluetooth headset, and canceling the pairing option for audio.
Restart mobile phone reconnection, invalid
Remove App, reinstall and reconnect, invalid
The odd thing is that you can connect to other devices of the same type. Other phones can also connect to this device. That's because this phone can't connect to this device.

log is as follows:

D/BluetoothGatt: registerApp()
D/BluetoothGatt: registerApp() - UUID=3bc43f7d-8407-4d9b-8bfc-e5a4ed46eb87
D/BtGatt.GattService: registerClient() - UUID=3bc43f7d-8407-4d9b-8bfc-e5a4ed46eb87, pid=10004
D/BtGatt.GattService: onClientRegistered() - UUID=3bc43f7d-8407-4d9b-8bfc-e5a4ed46eb87, clientIf=8
D/BluetoothGatt: onClientRegistered() - status=0 clientIf=8
D/A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@c7a9050
D/BtGatt.GattService: clientConnect() - address=DF:F8:90:CC:60:49, isDirect=true
D/bt_btif_config: btif_get_address_type: Device [df:f8:90:cc:60:49] address type 1
D/bt_btif_config: btif_get_device_type: Device [df:f8:90:cc:60:49] type 2
W/bt_l2cap: l2cble_init_direct_conn
W/bt_btm: btm_acl_created hci_handle=8 link_role=0  transport=2
E/bt_btm: BTM_SetBlePhy failed, peer does not support request
W/bt_btif: bta_dm_acl_change info: 0x0
W/bt_l2cap: L2CA_SetDesireRole() new:x0, disallow_switch:0
D/bt_btif_dm: remote version info [df:f8:90:cc:60:49]: 0, 0, 0
E/BluetoothRemoteDevices: state12newState0
D/BluetoothRemoteDevices: aclStateChangeCallback: State:Connected to Device:DF:F8:90:CC:60:49
D/BtGatt.GattService: onConnected() - clientIf=8, connId=8, address=DF:F8:90:CC:60:49
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=DF:F8:90:CC:60:49
I/bt_btm_sec: btm_sec_disconnected clearing pending flag handle:8 reason:22
W/bt_btif: btif_gatt_set_encryption_cb() - Encryption failed (1)
W/bt_l2cap: L2CA_SetDesireRole() new:x0, disallow_switch:0
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=DF:F8:90:CC:60:49
I/bt_btm_sec: btm_sec_disconnected clearing pending flag handle:8 reason:22
W/bt_btif: btif_gatt_set_encryption_cb() - Encryption failed (1)
W/bt_l2cap: L2CA_SetDesireRole() new:x0, disallow_switch:0
D/BtGatt.GattService: onDisconnected() - clientIf=8, connId=8, address=DF:F8:90:CC:60:49
D/BluetoothGatt: onClientConnectionState() - status=22 clientIf=8 device=DF:F8:90:CC:60:49
D/BluetoothGatt: close()
D/BluetoothGatt: unregisterApp() - mClientIf=8
D/BtGatt.GattService: unregisterClient() - clientIf=8
E/BluetoothRemoteDevices: state12newState1
D/BluetoothRemoteDevices: aclStateChangeCallback: State:DisConnected to Device:DF:F8:90:CC:60:49

Look at the log btm_sec_disconnected clearing pending flag handle:8 reason:22 in logcat
Find out the reason for this log, and finally find a way of thinking.

Enter the system settings, all applications. This machine is millet 6. Enter the application management. The pop-up menu in the upper right corner chooses to display all applications.
Search Bluetooth, find related applications, and clear data.
Search for Bluetooth, find related applications, and clear data.
Back to Bluetooth, the device's cancel-pairing option is back.
Cancel the pairing and return to App.

Posted by little_tris on Wed, 19 Dec 2018 23:12:06 -0800