gpt4 book ai didi

android - 扫描 AltBeacon 库中的信标时出现错误 "Scan failed, app cannot be registered"

转载 作者:行者123 更新时间:2023-11-29 01:04:08 25 4
gpt4 key购买 nike

在 Android 设备上测距信标时,一段时间后(大约 3-5 分钟)会发生错误。在此之后,测距不再看到信标。它仅有助于重新启动蓝牙。重新启动后测距开始正常工作,检测到信标,但过了一会儿,再次出现故障。据我了解,客户端连接溢出。我学习了logcat并确定了以下错误:

GATT_Register: can not Register GATT client, MAX client reached! CycledLeScannerForLollipop Scan failed:app cannot be registered BluetoothLeScanner onClientRegistered () - status = 133 clientIf = 0 mClientIf = 0

我在多大程度上理解 status 应该是 0。我再次指出,这项工作的特点是一种服务,它在与应用程序本身不同的进程中运行。当服务停止看到信标时,来自带有 BluetoothLeScanner 过滤器的 logcat 的字符串:

    Debug   12591   BluetoothLeScanner  onClientRegistered() - status=133 clientIf=0 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=133 clientIf=0 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=133 clientIf=0 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=133 clientIf=0 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=0 clientIf=32 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=0 clientIf=32 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=0 clientIf=31 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=0 clientIf=30 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=0 clientIf=29 mClientIf=0
Debug 12591 BluetoothLeScanner onClientRegistered() - status=0 clientIf=28 mClientIf=0

有可能解决给定的问题吗?谢谢!

编辑:这是 logcat:

  Time           Device Name  Type     PID           Tag          Message
02-19 18:49:45.395 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=133 clientIf=0 mClientIf=0
02-19 18:49:40.375 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=32 mClientIf=0
02-19 18:49:35.333 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=31 mClientIf=0
02-19 18:49:30.411 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=30 mClientIf=0
02-19 18:49:25.256 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=29 mClientIf=0
02-19 18:49:20.234 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=28 mClientIf=0
02-19 18:49:15.185 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=27 mClientIf=0
02-19 18:49:10.181 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=5 mClientIf=0
02-19 18:49:05.170 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=26 mClientIf=0
02-19 18:49:00.124 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=26 mClientIf=0
02-19 18:48:55.108 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=25 mClientIf=0
02-19 18:48:50.078 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=25 mClientIf=0
02-19 18:48:45.028 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=23 mClientIf=0
02-19 18:48:39.992 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=24 mClientIf=0
02-19 18:48:39.316 AGM A8 Debug 3254 BluetoothLeScanner onClientRegistered() - status=0 clientIf=23 mClientIf=0
02-19 18:48:34.994 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=22 mClientIf=0
02-19 18:48:29.927 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=21 mClientIf=0
02-19 18:48:24.905 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=20 mClientIf=0
02-19 18:48:19.866 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=19 mClientIf=0
02-19 18:48:14.852 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=18 mClientIf=0
02-19 18:48:09.825 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=17 mClientIf=0
02-19 18:48:04.812 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=16 mClientIf=0
02-19 18:47:59.768 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=15 mClientIf=0
02-19 18:47:54.751 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=14 mClientIf=0
02-19 18:47:49.708 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=13 mClientIf=0
02-19 18:47:44.688 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=12 mClientIf=0
02-19 18:47:39.676 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=11 mClientIf=0
02-19 18:47:34.662 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=10 mClientIf=0
02-19 18:47:29.603 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=9 mClientIf=0
02-19 18:47:24.585 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=8 mClientIf=0
02-19 18:47:19.552 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=7 mClientIf=0
02-19 18:47:14.525 AGM A8 Debug 13351 BluetoothLeScanner onClientRegistered() - status=0 clientIf=7 mClientIf=0

最佳答案

在某些 Android 设备型号上,蓝牙堆栈可能会进入不良状态,需要重新启动才能再次扫描蓝牙设备。为了自动修复此问题,BluetoothMedic已添加到 Android Beacon 库中,它会在检测到问题时自动重启蓝牙。在撰写本文时,此更改仍处于拉取请求中,因此尚未合并到库的发布版本中。

虽然这是解决您的问题的方法,但核心问题可能是您的手机上安装了太多蓝牙扫描应用程序。 Android 将同时使用蓝牙客户端的应用程序数量限制为 32 个。如果您安装的应用程序数量超过此数量并尝试使用蓝牙 LE API,您将收到此错误,并且只有蓝牙的电源循环(可能是自动的)通过上面的 BluetoothMedic)可以从问题中恢复。这将有效地终止在其他应用程序上使用蓝牙 API,以便您的应用程序有机会使用它们。

关于android - 扫描 AltBeacon 库中的信标时出现错误 "Scan failed, app cannot be registered",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48823868/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com