gpt4 book ai didi

bluetooth-lowenergy - 扫描大量 BLE 标签

转载 作者:行者123 更新时间:2023-12-04 15:23:04 29 4
gpt4 key购买 nike

我一直在寻找在一次扫描中扫描大量 BLE 标签 (StickNFind) 的可能性。我注意到,当我扫描 10 秒时,我可以轻松检测到大约 20 个 BLE。当我将扫描间隔增加到 30 秒左右并尝试扫描大量 BLE 标签时,例如200 个标签,我在 LogCat 中看到关于缓冲区溢出 (GKI_exception) 的错误。这个问题发生在核心 Android 库的某个地方,我无法调试。附上确切的错误日志。

11-27 11:39:30.542: D/dalvikvm(1017): GC_CONCURRENT freed 412K, 8% free 9039K/9760K, paused 1ms+1ms, total 16ms
11-27 11:39:30.552: D/BtGatt.GattService(1017): onScanResult() - address=E8:C6:AD:6F:BC:22, rssi=-76
11-27 11:39:30.552: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096
11-27 11:39:30.552: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=10
11-27 11:39:30.552: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=n96 len=3 dev_type=2
11-27 11:39:30.552: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.562: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.562: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.562: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.562: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.592: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.592: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.602: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.602: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception(): Task State Table
11-27 11:39:30.602: E/GKI_LINUX(1017): #####
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [0] task name [BTU] state [1]
11-27 11:39:30.602: E/GKI_LINUX(1017): #####
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [1] task name [BTIF] state [1]
11-27 11:39:30.602: E/GKI_LINUX(1017): #####
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [2] task name [A2DP-MEDIA] state [0]
11-27 11:39:30.602: E/GKI_LINUX(1017): #####
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception 65524 getbuf: out of buffers#####
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception:
11-27 11:39:30.602: E/GKI_LINUX(1017): ********************************************************************
11-27 11:39:30.602: E/GKI_LINUX(1017): #####
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: * GKI_exception(): 65524 getbuf: out of buffers
11-27 11:39:30.602: E/GKI_LINUX(1017): #####
11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: ********************************************************************
11-27 11:39:30.602: E/GKI_LINUX(1017): #####
11-27 11:39:30.602: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.602: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.602: D/BtGatt.GattService(1017): onScanResult() - address=F7:09:63:BC:66:D0, rssi=-78
11-27 11:39:30.602: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.602: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096
11-27 11:39:30.602: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.602: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=11
11-27 11:39:30.602: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=WWW.JAALEE.COM len=14 dev_type=2
11-27 11:39:30.602: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.672: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CE:D0, rssi=-86
11-27 11:39:30.672: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096
11-27 11:39:30.672: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=12
11-27 11:39:30.672: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=WWW.JAALEE.COM len=14 dev_type=2
11-27 11:39:30.672: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.682: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.682: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.682: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.682: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.702: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.702: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.702: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.702: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.702: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception(): Task State Table
11-27 11:39:30.702: E/GKI_LINUX(1017): #####
11-27 11:39:30.702: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [0] task name [BTU] state [1]
11-27 11:39:30.702: E/GKI_LINUX(1017): #####
11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [1] task name [BTIF] state [1]
11-27 11:39:30.712: E/GKI_LINUX(1017): #####
11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [2] task name [A2DP-MEDIA] state [0]
11-27 11:39:30.712: E/GKI_LINUX(1017): #####
11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception 65524 getbuf: out of buffers#####
11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception:
11-27 11:39:30.712: E/GKI_LINUX(1017): ********************************************************************
11-27 11:39:30.712: E/GKI_LINUX(1017): #####
11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: * GKI_exception(): 65524 getbuf: out of buffers
11-27 11:39:30.712: E/GKI_LINUX(1017): #####
11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: ********************************************************************
11-27 11:39:30.712: E/GKI_LINUX(1017): #####
11-27 11:39:30.732: D/dalvikvm(1017): GC_CONCURRENT freed 385K, 8% free 9038K/9760K, paused 7ms+1ms, total 20ms
11-27 11:39:30.742: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CF:35, rssi=-94
11-27 11:39:30.742: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.742: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096
11-27 11:39:30.742: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=13
11-27 11:39:30.742: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=n8B len=3 dev_type=2
11-27 11:39:30.772: D/BtGatt.GattService(1017): onScanResult() - address=FC:A6:B0:A0:32:B6, rssi=-73
11-27 11:39:30.772: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096
11-27 11:39:30.772: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.772: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=14
11-27 11:39:30.772: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=WWW.JAALEE.COM len=14 dev_type=2
11-27 11:39:30.802: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.802: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.802: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.802: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.802: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CE:C2, rssi=-76
11-27 11:39:30.802: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.802: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096
11-27 11:39:30.802: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=15
11-27 11:39:30.812: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=WWW.JAALEE.COM len=14 dev_type=2
11-27 11:39:30.822: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.822: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.822: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.822: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.842: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CF:2D, rssi=-76
11-27 11:39:30.842: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.842: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.842: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096
11-27 11:39:30.842: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=16
11-27 11:39:30.842: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=s8E len=3 dev_type=2
11-27 11:39:30.842: I/bt-hci(1017): BLE HCI(id=62) event = 0x02)
11-27 11:39:30.842: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.842: I/bt-hci(1017): btu_ble_process_adv_pkt
11-27 11:39:30.902: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
11-27 11:39:30.902: D/dalvikvm(1017): GC_CONCURRENT freed 480K, 8% free 9038K/9760K, paused 2ms+2ms, total 20ms

出现此类问题的原因是什么,我该如何解决?

提前致谢!

最佳答案

我认为在我们这边没有办法完全解决这个问题,但是你可以做的一件事是减少发生这个错误的可能性,就是在 onLeScan 回调中做尽可能少的工作。它是从系统内的专用蓝牙线程调用的。根据我的经验,如果您在此回调/线程中进行大量工作,则您提到的错误会更频繁地发生。

编辑 :我为此提交了错误报告:https://code.google.com/p/android/issues/detail?id=65455

关于bluetooth-lowenergy - 扫描大量 BLE 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20369888/

29 4 0