扫描大量BLE标签 [英] Scanning large number of BLE Tags

查看:51
本文介绍了扫描大量BLE标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I was looking for a possibility to scan a large number of BLE Tags (StickNFind) in a single scan. I have noticed that when I scan for 10 seconds I can detect around 20 BLEs easily. When I increase the scanning interval to around 30 seconds and try to scan a large number of BLE Tags e.g. 200 Tags, I see an error in the LogCat about buffer overflow (GKI_exception). This problem occurs somewhere in the core Android libraries, which I am unable to debug. The exact error log is attached.

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

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

What could be the reason for such problem and how can I resolve it?

提前谢谢!

推荐答案

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

I think there's no way to completely fix this issue on our side, but one thing you can do to decrease the likelihood of this error occurring is to do as few work as possible in the onLeScan-callback. It's called from a dedicated bluetooth-thread inside the system. From my experience, the error you mentioned occurs more often if you do a lot of work inside this callback / thread.

编辑:我为此提交了一个错误报告:

EDIT: I filed a bug report for this: https://code.google.com/p/android/issues/detail?id=65455

这篇关于扫描大量BLE标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆