【问题标题】:Android receiving too much Bluetooth debug dataAndroid 接收到过多的蓝牙调试数据
【发布时间】:2014-09-12 14:32:35
【问题描述】:

我使用低功耗蓝牙连接心率传感器。

现在我在 Eclipse 中从蓝牙获得了如此多的 logcat 数据,我什么也看不到了。 每秒 654 行。 我运行代码的手机是 HTC 手机。 也许有人知道哪里出了问题?

这里是一个例子。

09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007
09-12 16:16:40.003: E/bt-btm(3108): No PF filter has been configured!
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): HAL bt_gatt_callbacks->client->adv_filter_cb
09-12 16:16:40.003: E/bt-btm(3108): No PF filter has been configured!
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: D/BtGatt.GattService(3108): onAdvFilterConfig() - action=2 status=1
09-12 16:16:40.003: E/bt-btm(3108): No PF filter has been configured!
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007
09-12 16:16:40.003: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.003: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007
09-12 16:16:40.013: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.013: D/BtGatt.GattService(3108): onAdvFilterConfig() - action=2 status=1
09-12 16:16:40.013: E/bt-btm(3108): No PF filter has been configured!
09-12 16:16:40.013: I/bt-btif(3108): bta_dm_sm_execute event:0x2a
09-12 16:16:40.013: I/bt-btif(3108): bta_brcm_evt_hdlr :0x0007

【问题讨论】:

  • 看到同样的事情,但它只发生在手机上,而不是在 Nexus 7 上。
  • 当应用程序在搜索 BLE 单元并尝试连接时或不久后崩溃时,我观察到了这种情况或类似情况。它似乎会继续,直到您重新启动手机:-/

标签: android eclipse bluetooth


【解决方案1】:

我不知道蓝牙上发生了什么。 但建议您过滤 logcat 消息。
通过打开过滤器配置,在 logcat 消息的左侧,您可以添加编辑过滤器配置。点击+ 或编辑您当前的配置。
它将打开一个如下图所示的屏幕。
要仅过滤您的应用程序日志,您必须将您的包 ID 按应用程序名称:
对您来说最重要的事情发生在 by Log Tag: 过滤器上。您可以使用拒绝正则表达式来排除特定标签,就像这样:^(?!bt-btif)。

我希望有所帮助。

【讨论】:

  • 忽略这些消息可能不是一个好主意,我怀疑这些消息是我正在经历的耗电的根源。
【解决方案2】:

嗯,这些日志是由原生库打印出来的,用来帮助开发者调试应用,除非你的蓝牙模块有问题,否则应该不会造成麻烦。

基本上PF Filter 只是一个数据包过滤器,这意味着,所有来自客户端的数据包都被接受,而不是有规则来阻止一些。

从外部/bluetooth/bluedroid/stack/btm/ 中的 btm_ble_adv_filter.c 记录

   if (NULL == p_bda_filter ||
    /* not a generic filter */
    (p_target != NULL && p_bda_filter))
{
    BTM_TRACE_ERROR("Error: Can not clear filter, No PF filter has been configured!");
    return st;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-28
    • 2015-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-14
    • 1970-01-01
    相关资源
    最近更新 更多