gpt4 book ai didi

android - Bluetooth Medic 似乎对 Android Beacon Library 没有帮助

转载 作者:行者123 更新时间:2023-11-29 16:44:07 24 4
gpt4 key购买 nike

出于某种原因,监控在我的设备上似乎效果不佳。那是搭载 Android O 的 Pixel 2。有时它可以工作。有时它没有。看起来真的很随意。我已经等了超过 15 分钟 - 几个小时,但它仍然没有检测到任何东西。我正在使用 RegionBootstrap 进行后台监控。

也许以下是它不起作用的原因?据我所知,我没有任何其他使用 BT 的应用程序在后台运行。

03-13 20:36:39.817 32272-32293/? E/BtGatt.GattService: Advertise app or callback is null
03-13 20:36:40.233 32272-10072/? E/BtGatt.GattService: App 'com.xxxxxxxxx.xxx' is scanning too frequently

我也得到了很多这样的东西:

03-13 20:33:49.358 20525-20525/com.xxxxxxx.app E/CycledLeScannerForLollipop: Scan failed: app cannot be registered

...这些都是那个时期发生的错误:

03-13 20:33:49.356 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:33:49.356 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:33:49.356 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:33:49.356 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:33:49.358 20525-20525/com.xxxxxxx.app E/CycledLeScannerForLollipop: Scan failed: app cannot be registered
03-13 20:33:49.736 21268-21268/? E/cutils-trace: Error opening trace file: No such file or directory (2)
03-13 20:33:52.573 21286-21286/? E/cutils-trace: Error opening trace file: No such file or directory (2)
03-13 20:33:55.976 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:33:55.976 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:33:55.976 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:33:55.976 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:33:55.977 20525-20525/com.xxxxxxx.app E/CycledLeScannerForLollipop: Scan failed: app cannot be registered
03-13 20:33:59.644 21308-21308/? E/cutils-trace: Error opening trace file: No such file or directory (2)
03-13 20:34:00.005 1130-1153/? E/zygote64: Error encountered killing process cgroup uid 99686 pid 18067: No such file or directory
03-13 20:34:02.601 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:02.601 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:02.601 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:02.601 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:02.609 20525-20525/com.xxxxxxx.app E/CycledLeScannerForLollipop: Scan failed: app cannot be registered
03-13 20:34:07.644 21330-21330/? E/cutils-trace: Error opening trace file: No such file or directory (2)
03-13 20:34:09.216 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:09.216 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:09.216 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:09.216 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:09.217 20525-20525/com.xxxxxxx.app E/CycledLeScannerForLollipop: Scan failed: app cannot be registered
03-13 20:34:09.361 2251-2259/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 0]
03-13 20:34:14.935 2251-2259/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 0]
03-13 20:34:15.121 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:15.121 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:15.121 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:15.121 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:15.162 20525-20534/com.xxxxxxx.app E/SpellCheckerSession: ignoring processOrEnqueueTask due to unexpected mState=TASK_CLOSE scp.mWhat=TASK_CLOSE
03-13 20:34:15.511 21372-21372/? E/cutils-trace: Error opening trace file: No such file or directory (2)
03-13 20:34:15.912 21085-21085/? E/ctxmgr: [PlaceFenceHelper]NearbyBuffer is null!
03-13 20:34:16.898 28698-28698/? E/FullInputEventModel: onStartInput event aborted: com.touchtype.keyboard.h.q: could not obtain extracted text (class com.touchtype.keyboard.h.q)
03-13 20:34:18.581 775-3070/? E/NxpTml: _i2c_write() errno : 5
03-13 20:34:18.581 775-3070/? E/NxpTml: PN54X - Error in I2C Write.....
03-13 20:34:18.581 775-3072/? E/NxpHal: write error status = 0x1ff
03-13 20:34:18.581 775-775/? E/NxpHal: write_unlocked failed - PN54X Maybe in Standby Mode - Retry
03-13 20:34:18.741 21085-21112/? E/ctxmgr: [WorkInfo]Attribution was already enqueued pkg=com.google.android.gms, lbl=PlacesProducer_receive, start=2018-03-13 20:34:15.380-0400, stop=2018-03-13 20:34:15.380-0400, durtn=0ms.
03-13 20:34:18.742 21085-21367/? E/ctxmgr: [WorkManager]Ongoing task not found: PlacesProducer_receive
03-13 20:34:24.219 21398-21398/? E/cutils-trace: Error opening trace file: No such file or directory (2)
03-13 20:34:25.534 775-3070/? E/NxpTml: _i2c_write() errno : 5
03-13 20:34:25.534 775-3070/? E/NxpTml: PN54X - Error in I2C Write.....
03-13 20:34:25.534 775-3072/? E/NxpHal: write error status = 0x1ff
03-13 20:34:25.534 775-775/? E/NxpHal: write_unlocked failed - PN54X Maybe in Standby Mode - Retry
03-13 20:34:25.582 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:25.582 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:25.582 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:25.582 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:25.584 21085-21085/? E/NearbyDirect: MPScanner: onScanFailed, error code=2
03-13 20:34:25.589 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:25.589 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:25.589 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:25.589 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:25.618 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:25.618 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:25.618 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:25.618 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:25.793 21085-20506/? E/ctxmgr: [AppIntervalImpl]closeInterval: ongoing
03-13 20:34:25.794 21085-20506/? E/ctxmgr: [AppIntervalImpl]closeInterval: ongoing
03-13 20:34:26.173 21085-21085/? E/ctxmgr: [PlaceFenceHelper]NearbyBuffer is null!
03-13 20:34:30.854 2251-2259/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 0]
03-13 20:34:35.089 1130-1154/? E/BatteryExternalStatsWorker: no controller energy info supplied for wifi
03-13 20:34:35.199 778-778/? E/QCOM PowerHAL: extract_stats: failed to open: /d/system_stats Error = Permission denied
03-13 20:34:35.202 778-778/? E/QCOM PowerHAL: extract_stats: failed to open: /d/wlan0/power_stats Error = Permission denied
03-13 20:34:35.638 19651-21408/? E/Ssdp: Socket closed
03-13 20:34:35.895 2251-2259/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 0]
03-13 20:34:36.639 32272-32293/? E/BtGatt.GattService: Exception: android.os.DeadObjectException
03-13 20:34:36.649 32272-10070/? E/BtGatt.ContextMap: Context not found for ID 9
03-13 20:34:36.650 32272-32293/? E/BtGatt.ContextMap: Context not found for ID 9
03-13 20:34:36.651 32272-32293/? E/BtGatt.ContextMap: Context not found for ID 9
03-13 20:34:38.566 21085-21085/? E/ctxmgr: [PlaceFenceHelper]NearbyBuffer is null!
03-13 20:34:41.557 2251-2259/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 0]
03-13 20:34:41.803 32272-32311/? E/bt_btif: bta_gattc_deregister: Deregister Failed unknown client cif
03-13 20:34:43.229 1876-1876/? E/QtiImsExtUtils: getConfigForPhoneId phoneId is invalid
03-13 20:34:43.229 1876-1876/? E/QtiImsExtUtils: isCarrierConfigEnabled bundle is null
03-13 20:34:45.828 21503-21503/? E/cutils-trace: Error opening trace file: No such file or directory (2)
03-13 20:34:46.000 32272-32293/? E/BtGatt.GattService: Advertise app or callback is null
03-13 20:34:46.360 32272-32311/? E/bt_btif: bta_gattc_deregister: Deregister Failed unknown client cif
03-13 20:34:46.364 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:46.364 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:46.364 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:46.364 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:46.365 20525-20525/com.xxxxxxx.app E/CycledLeScannerForLollipop: Scan failed: app cannot be registered
03-13 20:34:46.370 32272-32272/? E/BluetoothMapService: mSessionStatusHandler.sendMessage() dispatched shutdown message
03-13 20:34:46.378 20525-20525/com.xxxxxxx.app E/App: Unable to start beacon monitoring: Bluetooth not enabled.
03-13 20:34:46.380 32272-32315/? E/bt_btif: SOCK_LIST: free(id = 2) - NO app_fd!
03-13 20:34:46.380 32272-32315/? E/bt_btif: SOCK_LIST: free(id = 1) - NO app_fd!
03-13 20:34:46.380 32272-32315/? E/bt_btif: SOCK_LIST: free(id = 3) - NO app_fd!
03-13 20:34:46.405 32272-32293/? E/bt_btif: btif_hf_upstreams_evt: Invalid index -1
03-13 20:34:46.446 32272-32293/? E/bt_btif: btif_in_execute_service_request: Unknown service 27 being disabled
03-13 20:34:46.491 20525-20525/com.xxxxxxx.app E/App: Unable to start beacon monitoring: Bluetooth not enabled.
03-13 20:34:46.496 20525-20525/com.xxxxxxx.app E/App: Unable to start beacon monitoring: Bluetooth not enabled.
03-13 20:34:47.376 20525-20525/com.xxxxxxx.app E/App: Unable to start beacon monitoring: Bluetooth not enabled.
03-13 20:34:47.380 20525-20525/com.xxxxxxx.app E/App: Unable to start beacon monitoring: Bluetooth not enabled.
03-13 20:34:47.389 32272-32293/? E/bt_btif: btif_hf_upstreams_evt: Invalid index -1
03-13 20:34:47.412 32272-32272/? E/Avrcp: play status change -1➡0 mPlayStatusChangedNT: 1
03-13 20:34:47.412 32272-32272/? E/bt_btif: register_notification_rsp: Avrcp device is not connected, handle: 0x0
03-13 20:34:47.413 32272-32272/? E/Avrcp: play status change 0➡0 mPlayStatusChangedNT: 1
03-13 20:34:47.421 32272-32293/? E/bt_btif: btif_sm_dispatch : Invalid handle
03-13 20:34:47.421 32272-32293/? E/bt_btif: btif_sm_dispatch : Invalid handle
03-13 20:34:47.426 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.426 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:47.426 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.426 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:47.537 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.537 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:47.537 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.537 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:47.541 21085-21085/? E/NearbyDirect: MPScanner: onScanFailed, error code=2
03-13 20:34:47.608 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.608 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:47.608 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.608 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:47.611 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.611 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:47.611 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:47.611 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:48.022 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:48.022 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:48.022 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:48.023 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:48.026 21085-21085/? E/ProximityAuth: [BleCentralService] Failed to initiate BLE scanning; killing service. Error code: 2
03-13 20:34:48.112 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:48.112 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:48.112 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
03-13 20:34:48.112 32272-32311/? E/bt_btif: Register with GATT stack failed.
03-13 20:34:48.112 21085-21085/? E/NearbyDirect: MPScanner: onScanFailed, error code=2

我还添加了 Bluetooth Medic,但它似乎没有任何作用。它在这里并行运行。在 'medic' 上过滤调试:

03-13 20:29:43.483 20196-20255/com.xxxxxxxxx.xxx I/BluetoothMedic: Starting scan test
03-13 20:29:43.792 20196-20196/com.xxxxxxxxx.xxx W/BluetoothMedic: Scan test failed in a way we consider a failure
03-13 20:29:54.496 20196-20255/com.xxxxxxxxx.xxx I/BluetoothMedic: Starting transmitter test
03-13 20:29:54.539 20196-20196/com.xxxxxxxxx.xxx I/BluetoothMedic: Transmitter test succeeded
03-13 20:30:31.144 20525-20557/? I/BluetoothMedic: Starting scan test
03-13 20:30:31.453 20525-20525/? W/BluetoothMedic: Scan test failed in a way we consider a failure
03-13 20:30:42.153 20525-20557/com.xxxxxxxxx.xxx I/BluetoothMedic: Starting transmitter test
03-13 20:30:42.184 20525-20525/com.xxxxxxxxx.xxx I/BluetoothMedic: Transmitter test succeeded
03-13 20:34:53.727 21581-21608/com.xxxxxxxxx.xxx I/BluetoothMedic: Starting scan test
03-13 20:34:53.829 21581-21581/com.xxxxxxxxx.xxx W/BluetoothMedic: Scan test failed in a way we consider a failure
03-13 20:35:04.750 21581-21608/com.xxxxxxxxx.xxx I/BluetoothMedic: Starting transmitter test
03-13 20:35:04.784 21581-21581/com.xxxxxxxxx.xxx I/BluetoothMedic: Transmitter test succeeded

那么这里到底发生了什么?我可以稍后发布代码,但帖子已经达到极限,也许日志可能已经给出了一个想法。

谢谢!

编辑:

我也刚刚得到这个:

04-10 01:04:42.179  5703  8356 E AndroidRuntime: FATAL EXCEPTION: BluetoothTestThread
04-10 01:04:42.179 5703 8356 E AndroidRuntime: Process: com.xxxxxxx.app, PID: 5703
04-10 01:04:42.179 5703 8356 E AndroidRuntime: java.lang.IllegalStateException: BT Adapter is not turned ON
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.bluetooth.le.BluetoothLeUtils.checkAdapterStateOn(BluetoothLeUtils.java:136)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:204)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:132)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:113)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at org.altbeacon.bluetooth.BluetoothMedic.runScanTest(BluetoothMedic.java:261)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at org.altbeacon.bluetooth.BluetoothTestJob$1.run(BluetoothTestJob.java:104)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:790)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
04-10 01:04:42.179 5703 8356 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:65)

最佳答案

像下面这样的日志行表明 Android 蓝牙堆栈已经耗尽了新应用启动蓝牙扫描信标的能力:

03-13 20:34:48.112 32272-32311/? E/bt_stack: [ERROR:gatt_api.cc(1032)] 无法注册 GATT 客户端,MAX 客户端达到:32

这可能意味着手机上的 32 个应用程序已经使用了所有蓝牙客户端,但更有可能是操作系统级错误导致所有客户端插槽过早耗尽,可能会留下一些孤立的应用程序。

这是 Android Beacon 库的 Bluetooth Medic 设计为能够检测和修复的问题之一,方法是将电源循环到蓝牙,从而释放所有客户端插槽。为此,您必须配置 medic 以在出现故障时循环上电。根据显示的日志,似乎没有发生这种情况,这可能意味着医疗人员未配置为这样做。

您可以将 BluetoothMedic 配置为循环上电以尝试恢复,如下所示:

BluetoothMedic medic = BluetoothMedic.getInstance(); 
medic.enablePowerCycleOnFailures(context);
medic.enablePeriodicTests(context, BluetoothMedic.SCAN_TEST |
BluetoothMedic.TRANSMIT_TEST);

关于android - Bluetooth Medic 似乎对 Android Beacon Library 没有帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49268131/

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