【问题标题】:Android O : Ble Scanner not scanning - Not getting any scan call back eventAndroid O:Ble Scanner 未扫描 - 未收到任何扫描回调事件
【发布时间】:2017-11-02 13:52:15
【问题描述】:

我在 Android O 中使用 google 像素。一段时间后,我在我的应用程序中看到没有扫描回调。

下面是我抓到的btif日志

11-02 19:18:20.561 19922-19985/? E/bt_btif: bta_gattc_cache_load: can't open GATT cache file /data/misc/bluetooth/gatt_cache_4ae7ba3124fe for reading, error: No such file or directory
11-02 19:18:20.966 19922-19945/? D/bt_btif_scanner: btif_gatts_upstreams_evt: Unhandled event (26)
11-02 19:18:20.966 19922-19945/? D/bt_btif_scanner: btif_gatts_upstreams_evt: Unhandled event (26)
11-02 19:18:21.168 19922-19985/? W/bt_bta_gattc: bta_gattc_explore_srvc no more services found
11-02 19:18:21.190 19922-19985/? E/bt_btm: BTM_SetBleDataLength failed, peer does not support request
11-02 19:18:21.197 19922-19945/? E/bt_btif_gattc: btif_gattc_upstreams_evt: Unhandled event (7)!
11-02 19:18:21.197 19922-19945/? E/bt_btif_gattc: btif_gattc_upstreams_evt: Unhandled event (7)!
11-02 19:18:21.198 19922-19945/? D/bt_bta_gattc: bta_gattc_get_gatt_db
11-02 19:18:21.235 19922-19945/? D/bt_btif_scanner: btif_gatts_upstreams_evt: Unhandled event (26)
11-02 19:18:21.236 19922-19945/? D/bt_btif_scanner: btif_gatts_upstreams_evt: Unhandled event (26)
11-02 19:18:23.804 19922-19945/? D/bt_btif_scanner: btif_gatts_upstreams_evt: Unhandled event (26)
11-02 19:18:23.805 19922-19945/? D/bt_btif_scanner: btif_gatts_upstreams_evt: Unhandled event (26)
11-02 19:18:26.781 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=5 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=6 connected=0 conn_id=6 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=7 connected=0 conn_id=7 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=8 connected=0 conn_id=8 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=9 connected=0 conn_id=9 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=10 connected=0 conn_id=10 reason=0x0013
11-02 19:18:26.782 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=11 connected=0 conn_id=11 reason=0x0013
11-02 19:18:26.783 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=12 connected=0 conn_id=12 reason=0x0013
11-02 19:18:26.783 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=13 connected=0 conn_id=13 reason=0x0013
11-02 19:18:26.783 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=14 connected=0 conn_id=14 reason=0x0013
11-02 19:18:26.783 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=15 connected=0 conn_id=15 reason=0x0013
11-02 19:18:26.783 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=16 connected=0 conn_id=16 reason=0x0013
11-02 19:18:26.783 19922-19985/? W/bt_btif: bta_gattc_conn_cback() - cif=18 connected=0 conn_id=18 reason=0x0013
11-02 19:18:26.783 19922-19985/? I/bt_btm_sec: btm_sec_disconnected clearing pending flag handle:10 reason:19
11-02 19:18:41.281 19922-19945/? D/bt_btif_config: btif_get_address_type: Device [device mac address] address type 0
11-02 19:18:41.282 19922-19945/? D/bt_btif_config: btif_get_device_type: Device [device mac address] type 2
11-02 19:18:41.760 19922-19985/? W/bt_smp: smp_br_connect_callback is called on unexpected transport 2

这可能是 Android BLE 错误吗

【问题讨论】:

  • 我刚刚重启了BLE(BLE Reset)
  • 你解决了这个问题吗?
  • 我还没有任何固定的解决方案。

标签: bluetooth bluetooth-lowenergy android-bluetooth android-ble


【解决方案1】:

我怀疑当您完成所有 BluetoothGatt 对象时,您不会在所有对象上调用 close()。因此,您可能会耗尽资源。

【讨论】:

  • 断开连接后我确实关闭了。至少从API的角度来看。虽然它的返回类型是无效的,所以我不能确定断开连接实际上是否成功。是否有任何特定的日志可以保证这可能与此行为有关。(没有扫描回调,或 gatt 关闭失败?)
  • @RobelRobelLingstuyl 我没有。
猜你喜欢
  • 1970-01-01
  • 2018-10-05
  • 2021-05-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多