BLE android重新连接没有发生

时间:2015-01-30 09:25:12

标签: android

这里我有一些BLE android的问题,我在这里写一些案例:

案例1:案例成功1 :当我启用BLE gatt服务器时。我的手机正在扫描设备,它找到设备,连接到它与设备配对并成功接收通知。

案例2:案例成功2 :我断开了gatt服务器,我收到了与gatt服务器断开连接的回叫。电话再次寻找找到gatt服务器的设备并收到通知。

案例3:案例失败:第二次与gatt服务器断开连接后,设备再次查找gatt服务器。当我插上gatt服务器然后它只能连接。并且不会收到通知。

我不知道为什么它没有在第3次尝试时收到通知。这是一些日志:


I/BluetoothLeService(  856): Connected to GATT server.
D/BluetoothGatt(  856): discoverServices() - device: F8:DA:DD:68:3E:79
D/BtGatt.GattService(  677): discoverServices() - address=F8:DA:DD:68:3E:79, connId=5
D/BtGatt.btif(  677): btif_gattc_search_service
I/BluetoothLeService(  856): Attempting to start service discovery:true
D/BtGatt.btif(  677): btgattc_handle_event: Event 1006
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 7
D/BtGatt.GattService(  677): onSearchResult() - address=F8:DA:DD:68:3E:79, uuid=00001800-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetService() - Device=F8:DA:DD:68:3E:79 UUID=00001800-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 7
D/BtGatt.GattService(  677): onSearchResult() - address=F8:DA:DD:68:3E:79, uuid=00001801-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetService() - Device=F8:DA:DD:68:3E:79 UUID=00001801-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 7
D/BtGatt.GattService(  677): onSearchResult() - address=F8:DA:DD:68:3E:79, uuid=0000180a-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetService() - Device=F8:DA:DD:68:3E:79 UUID=0000180a-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 7
D/BtGatt.GattService(  677): onSearchResult() - address=F8:DA:DD:68:3E:79, uuid=0000180f-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetService() - Device=F8:DA:DD:68:3E:79 UUID=0000180f-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 7
D/BtGatt.GattService(  677): onSearchResult() - address=F8:DA:DD:68:3E:79, uuid=00001812-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetService() - Device=F8:DA:DD:68:3E:79 UUID=00001812-0000-1000-8000-00805f9b34fb
I/Choreographer(  856): Skipped 308 frames!  The application may be doing too much work on its main thread.
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 6
D/BtGatt.GattService(  677): onSearchCompleted() - connId=5, status=0
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1007
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a00-0000-1000-8000-00805f9b34fb, prop=10
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a00-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a01-0000-1000-8000-00805f9b34fb, prop=2
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a01-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a04-0000-1000-8000-00805f9b34fb, prop=2
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a04-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=133, charUuid=00002a04-0000-1000-8000-00805f9b34fb, prop=2
D/BtGatt.btif(  677): btif_gattc_get_included_service
D/BtGatt.btif(  677): btgattc_handle_event: Event 1011
D/BtGatt.GattService(  677): onGetIncludedService() - address=F8:DA:DD:68:3E:79, status=133, uuid=00001800-0000-1000-8000-00805f9b34fb, inclUuid=00002a04-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1007
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=133, charUuid=00002a04-0000-1000-8000-00805f9b34fb, prop=2
D/BtGatt.btif(  677): btif_gattc_get_included_service
D/BtGatt.btif(  677): btgattc_handle_event: Event 1011
D/BtGatt.GattService(  677): onGetIncludedService() - address=F8:DA:DD:68:3E:79, status=133, uuid=00001801-0000-1000-8000-00805f9b34fb, inclUuid=00002a04-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1007
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a29-0000-1000-8000-00805f9b34fb, prop=2
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a29-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a50-0000-1000-8000-00805f9b34fb, prop=2
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a50-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=133, charUuid=00002a50-0000-1000-8000-00805f9b34fb, prop=2
D/BtGatt.btif(  677): btif_gattc_get_included_service
D/BtGatt.btif(  677): btgattc_handle_event: Event 1011
D/BtGatt.GattService(  677): onGetIncludedService() - address=F8:DA:DD:68:3E:79, status=133, uuid=0000180a-0000-1000-8000-00805f9b34fb, inclUuid=00002a50-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1007
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a19-0000-1000-8000-00805f9b34fb, prop=18
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a19-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=133, charUuid=00002a19-0000-1000-8000-00805f9b34fb, prop=18
D/BtGatt.btif(  677): btif_gattc_get_included_service
D/BtGatt.btif(  677): btgattc_handle_event: Event 1011
D/BtGatt.GattService(  677): onGetIncludedService() - address=F8:DA:DD:68:3E:79, status=133, uuid=0000180f-0000-1000-8000-00805f9b34fb, inclUuid=00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1007
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a4d-0000-1000-8000-00805f9b34fb, prop=26
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a4b-0000-1000-8000-00805f9b34fb, prop=2
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a4b-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a4a-0000-1000-8000-00805f9b34fb, prop=2
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a4a-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=0, charUuid=00002a4c-0000-1000-8000-00805f9b34fb, prop=4
D/BluetoothGatt(  856): onGetCharacteristic() - Device=F8:DA:DD:68:3E:79 UUID=00002a4c-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_characteristic
D/BtGatt.btif(  677): btgattc_handle_event: Event 1008
D/dalvikvm(  677): GC_FOR_ALLOC freed 509K, 18% free 2889K/3492K, paused 27ms, total 29ms
D/BtGatt.GattService(  677): onGetCharacteristic() - address=F8:DA:DD:68:3E:79, status=133, charUuid=00002a4c-0000-1000-8000-00805f9b34fb, prop=4
D/BtGatt.btif(  677): btif_gattc_get_included_service
D/BtGatt.btif(  677): btgattc_handle_event: Event 1011
D/BtGatt.GattService(  677): onGetIncludedService() - address=F8:DA:DD:68:3E:79, status=133, uuid=00001812-0000-1000-8000-00805f9b34fb, inclUuid=00002a4c-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002a4c-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002a4c-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002a4c-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002a4c-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002a4c-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=0, descUuid=00002902-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetDescriptor() - Device=F8:DA:DD:68:3E:79 UUID=00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1010
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=0, descUuid=00002902-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetDescriptor() - Device=F8:DA:DD:68:3E:79 UUID=00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1010
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=0, descUuid=00002908-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onGetDescriptor() - Device=F8:DA:DD:68:3E:79 UUID=00002908-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1010
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002908-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002908-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002908-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btif_gattc_get_descriptor
D/BtGatt.btif(  677): btgattc_handle_event: Event 1009
D/BtGatt.GattService(  677): onGetDescriptor() - address=F8:DA:DD:68:3E:79, status=133, descUuid=00002908-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): onSearchComplete() = Device=F8:DA:DD:68:3E:79 Status=0
D/BluetoothLeService(  856): onServicesDiscovered Called
I/bt-hci  (  677): BLE HCI(id=62) event = 0x04)
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: false
D/BtGatt.btif(  677): btif_gattc_dereg_for_notification
D/BtGatt.btif(  677): btgattc_handle_event: Event 1019
E/bt-btif (  677): registration not found
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: false
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=133, registered=0, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
I/        (  677): vendor op - 7
D/BluetoothLeService(  856): setCharacteristicNotification status = true
D/BluetoothGatt(  856): readCharacteristic() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): readCharacteristic() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_read_char
D/BtGatt.btif(  677): btgattc_handle_event: Event 1013
E/bt-btif (  677): already has a pending command!!
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: true
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: true
D/BtGatt.btif(  677): btif_gattc_reg_for_notification
D/BtGatt.btif(  677): btgattc_handle_event: Event 1018
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=0, registered=1, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
D/BluetoothLeService(  856): setCharacteristicNotification status = true
E/bt-btif (  677): already has a pending command!!
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: false
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: false
D/BtGatt.btif(  677): btif_gattc_dereg_for_notification
D/BtGatt.btif(  677): btgattc_handle_event: Event 1019
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=0, registered=0, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
E/bt-btif (  677): already has a pending command!!
D/BluetoothLeService(  856): setCharacteristicNotification status = true
D/BluetoothGatt(  856): readCharacteristic() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): readCharacteristic() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_read_char
D/BtGatt.btif(  677): btgattc_handle_event: Event 1013
E/bt-btif (  677): already has a pending command!!
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: true
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: true
D/BtGatt.btif(  677): btif_gattc_reg_for_notification
D/BtGatt.btif(  677): btgattc_handle_event: Event 1018
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=0, registered=1, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
E/bt-btif (  677): already has a pending command!!
D/BluetoothLeService(  856): setCharacteristicNotification status = true
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: false
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: false
D/BtGatt.btif(  677): btif_gattc_dereg_for_notification
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.btif(  677): btgattc_handle_event: Event 1019
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=0, registered=0, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
D/BluetoothLeService(  856): setCharacteristicNotification status = true
D/BluetoothGatt(  856): readCharacteristic() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb
E/bt-btif (  677): already has a pending command!!
D/BtGatt.GattService(  677): readCharacteristic() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_read_char
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: true
D/BtGatt.btif(  677): btgattc_handle_event: Event 1013
E/bt-btif (  677): already has a pending command!!
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: true
D/BtGatt.btif(  677): btif_gattc_reg_for_notification
D/BtGatt.btif(  677): btgattc_handle_event: Event 1018
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=0, registered=1, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
E/bt-btif (  677): already has a pending command!!
D/BluetoothLeService(  856): setCharacteristicNotification status = true
D/BluetoothGatt(  856): readCharacteristic() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): readCharacteristic() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_read_char
D/BtGatt.btif(  677): btgattc_handle_event: Event 1013
E/bt-btif (  677): already has a pending command!!
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: true
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: true
D/BtGatt.btif(  677): btif_gattc_reg_for_notification
D/BtGatt.btif(  677): btgattc_handle_event: Event 1018
W/bt-btif (  677): notification already registered
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=0, registered=1, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
E/bt-btif (  677): already has a pending command!!
D/BluetoothLeService(  856): setCharacteristicNotification status = true
D/BluetoothGatt(  856): readCharacteristic() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): readCharacteristic() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_read_char
D/BtGatt.btif(  677): btgattc_handle_event: Event 1013
E/bt-btif (  677): already has a pending command!!
D/BluetoothGatt(  856): setCharacteristicNotification() - uuid: 00002a4d-0000-1000-8000-00805f9b34fb enable: true
D/BtGatt.GattService(  677): registerForNotification() - address=F8:DA:DD:68:3E:79 enable: true
D/BtGatt.btif(  677): btif_gattc_reg_for_notification
D/BtGatt.btif(  677): btgattc_handle_event: Event 1018
W/bt-btif (  677): notification already registered
D/BtGatt.GattService(  677): onRegisterForNotifications() - address=null, status=0, registered=1, charUuid=00002a4d-0000-1000-8000-00805f9b34fb
D/BluetoothGatt(  856): writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
E/bt-btif (  677): already has a pending command!!
D/BluetoothLeService(  856): setCharacteristicNotification status = true
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 9
D/BtGatt.GattService(  677): onWriteDescriptor() - address=F8:DA:DD:68:3E:79, status=5
D/BluetoothGatt(  856): onDescriptorWrite() - Device=F8:DA:DD:68:3E:79 UUID=00002a4d-0000-1000-8000-00805f9b34fb
D/BtGatt.GattService(  677): writeDescriptor() - address=F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_write_char_descr
D/BtGatt.btif(  677): btgattc_handle_event: Event 1016
W/bt-smp  (  677): io_cap = 4
W/bt-smp  (  677): new io_cap = 4 p_cb->loc_enc_size = 16
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
W/bt-smp  (  677): local rand(LSB ~ MSB) = f0 42 e5 ec 53 f4 47 1b 6e ad f0 a2 46 28 41 a8 
W/bt-smp  (  677): P1(LSB ~ MSB) = 00 01 01 04 00 05 10 07 07 02 03 00 01 10 06 03 
W/bt-smp  (  677): P1' = r XOR p1(LSB ~ MSB) = f0 43 e4 e8 53 f1 57 1c 69 af f3 a2 47 38 47 ab 
W/bt-smp  (  677): Key(LSB ~ MSB) = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
W/bt-smp  (  677): Plain text(LSB ~ MSB) = f0 43 e4 e8 53 f1 57 1c 69 af f3 a2 47 38 47 ab 
W/bt-smp  (  677): Encrypted text(LSB ~ MSB) = f9 6b 49 34 f1 72 b1 a3 0b 06 47 b7 2d d0 42 b6 
W/bt-smp  (  677): C1(LSB ~ MSB) = f9 6b 49 34 f1 72 b1 a3 0b 06 47 b7 2d d0 42 b6 
W/bt-smp  (  677): p2(LSB ~ MSB) = 79 3e 68 dd da f8 78 e8 9b 20 dd 84 00 00 00 00 
W/bt-smp  (  677): p2' = C1 xor p2(LSB ~ MSB) = 80 55 21 e9 2b 8a c9 4b 90 26 9a 33 2d d0 42 b6 
W/bt-smp  (  677): Key(LSB ~ MSB) = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
W/bt-smp  (  677): Plain text(LSB ~ MSB) = 80 55 21 e9 2b 8a c9 4b 90 26 9a 33 2d d0 42 b6 
W/bt-smp  (  677): Encrypted text(LSB ~ MSB) = c1 34 35 1d d3 04 8a 74 9b 88 7a d1 8e 1d 90 00 
W/bt-smp  (  677): Confirm(LSB ~ MSB) = c1 34 35 1d d3 04 8a 74 9b 88 7a d1 8e 1d 90 00 
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
W/bt-smp  (  677): peer rand(LSB ~ MSB) = 10 4c 63 b3 32 80 c2 63 29 76 41 2c 8e af 0b bf 
W/bt-smp  (  677): P1(LSB ~ MSB) = 00 01 01 04 00 05 10 07 07 02 03 00 01 10 06 03 
W/bt-smp  (  677): P1' = r XOR p1(LSB ~ MSB) = 10 4d 62 b7 32 85 d2 64 2e 74 42 2c 8f bf 0d bc 
W/bt-smp  (  677): Key(LSB ~ MSB) = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
W/bt-smp  (  677): Plain text(LSB ~ MSB) = 10 4d 62 b7 32 85 d2 64 2e 74 42 2c 8f bf 0d bc 
W/bt-smp  (  677): Encrypted text(LSB ~ MSB) = 3b 8b 29 cc 32 ba d5 ab 79 7a 5a 3f a4 4f 67 12 
W/bt-smp  (  677): C1(LSB ~ MSB) = 3b 8b 29 cc 32 ba d5 ab 79 7a 5a 3f a4 4f 67 12 
W/bt-smp  (  677): p2(LSB ~ MSB) = 79 3e 68 dd da f8 78 e8 9b 20 dd 84 00 00 00 00 
W/bt-smp  (  677): p2' = C1 xor p2(LSB ~ MSB) = 42 b5 41 11 e8 42 ad 43 e2 5a 87 bb a4 4f 67 12 
W/bt-smp  (  677): Key(LSB ~ MSB) = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
W/bt-smp  (  677): Plain text(LSB ~ MSB) = 42 b5 41 11 e8 42 ad 43 e2 5a 87 bb a4 4f 67 12 
W/bt-smp  (  677): Encrypted text(LSB ~ MSB) = 0c 00 9c 19 ac 5e c3 c8 af 8b e2 b6 7a f8 3c 19 
W/bt-smp  (  677): Compare(LSB ~ MSB) = 0c 00 9c 19 ac 5e c3 c8 af 8b e2 b6 7a f8 3c 19 
W/bt-smp  (  677): Key(LSB ~ MSB) = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
W/bt-smp  (  677): Plain text(LSB ~ MSB) = f0 42 e5 ec 53 f4 47 1b 10 4c 63 b3 32 80 c2 63 
W/bt-smp  (  677): Encrypted text(LSB ~ MSB) = bf 05 1c bb f7 99 5a c4 c0 be 2f 4f 95 d1 3c 41 
E/bt-smp  (  677): STK Generated
I/        (  677): vendor op - 7
I/BluetoothBondStateMachine(  677): bondStateChangeCallback: Status: 0 Address: F8:DA:DD:68:3E:79 newState: 1
I/BluetoothBondStateMachine(  677): Bond State Change Intent:F8:DA:DD:68:3E:79 OldState: 10 NewState: 11
I/BluetoothBondStateMachine(  677): Entering PendingCommandState State
D/BluetoothAdapterService(1108578176)(  677): Get Bonded Devices being called
W/bt-smp  (  677): smp_send_id_info
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
W/bt-smp  (  677): Key(LSB ~ MSB) = d8 78 f5 05 0e 0c fa 4b 55 d8 4b 68 05 74 60 7c 
W/bt-smp  (  677): Plain text(LSB ~ MSB) = 19 40 01 00 00 00 00 00 00 00 00 00 00 00 00 00 
W/bt-smp  (  677): Encrypted text(LSB ~ MSB) = e6 8f bf 15 3e 90 0f 39 2d d1 84 64 ed e3 0e 9f 
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/BluetoothBondStateMachine(  677): bondStateChangeCallback: Status: 0 Address: F8:DA:DD:68:3E:79 newState: 2
D/BluetoothAdapterProperties(  677): Adding bonded device:F8:DA:DD:68:3E:79
D/BtGatt.btif(  677): btif_gattc_upstreams_evt: Event 9
D/BtGatt.GattService(  677): onWriteDescriptor() - address=F8:DA:DD:68:3E:79, status=137
I/BluetoothBondStateMachine(  677): Bond State Change Intent:F8:DA:DD:68:3E:79 OldState: 11 NewState: 12
D/BluetoothGatt(  856): onDescriptorWrite() - Device=F8:DA:DD:68:3E:79 UUID=00000000-0000-0000-0000-000000000000
D/BluetoothAdapterService(1108578176)(  677): Get Bonded Devices being called
D/BluetoothAdapterProperties(  677): getBondedDevices: length=1
W/BackupManagerService(  451): dataChanged but no participant pkg='com.android.providers.settings' uid=1002
W/BackupManagerService(  451): dataChanged but no participant pkg='com.android.providers.settings' uid=1002
I/        (  677): vendor op - 7
I/BluetoothBondStateMachine(  677): StableState(): Entering Off State
W/BackupManagerService(  451): dataChanged but no participant pkg='com.android.providers.settings' uid=1002
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
I/        (  677): vendor op - 7
E/bt-btif (  677): No More Service found
E/bt-btif (  677): bta_dm_gatt_disc_result serivce_id len=2 
E/bt-btif (  677): bta_dm_gatt_disc_result serivce_id len=2 
E/bt-btif (  677): bta_dm_gatt_disc_result serivce_id len=2 
E/bt-btif (  677): bta_dm_gatt_disc_result serivce_id len=2 
E/bt-btif (  677): bta_dm_gatt_disc_result serivce_id len=2 
E/bt-btif (  677):  uuid:00001812-0000-1000-8000-00805f9b34fb
D/BluetoothMap(  638): getConnectedDevices()
D/BluetoothMap(  638): getConnectionState(F8:DA:DD:68:3E:79)
D/MapProfile(  638): getConnectionStatus: status is: 0

1 个答案:

答案 0 :(得分:1)

我已通过以下方式解决了这个问题:

后来我发现读取特征的认证没有正确完成,这就是为什么它在某些情况下失败了。