【问题标题】:Bluetooth GATT service not showing up on BLE Scan on Android蓝牙 GATT 服务未显示在 Android 上的 BLE 扫描中
【发布时间】:2018-11-15 10:48:25
【问题描述】:

我正在使用带有 USB 蓝牙加密狗的 TinyCore linux 机器上的 Bluez。我们已使用示例 gatt 服务器添加电池服务以发送降低的电池电量。使用 bluetoothctl,我们的控制器(USB 蓝牙加密狗)的信息会显示服务:

Controller 00:07:80:C1:AC:89
Name: box
Alias: box
Class: 0x000104
Powered: yes
Discoverable: yes
Pairable: yes
UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1D6Bp0246d052D
Discovering: no

我们的目标是在 Android 应用上读取此内容,但在我们的自定义应用和示例 BLE 扫描应用中,我们看到的唯一服务是 00001800(通用访问配置文件)和 00001801(通用属性配置文件)。

我的问题是为什么我们可以在 bluetoothctl 上看到 Battery Service,但在 discoverServices() 上没有显示该服务?

【问题讨论】:

  • 你解决了吗?我也有同样的问题。
  • @lufte 不,很遗憾没有。我只是切换到普通蓝牙而不是 BLE

标签: android bluetooth bluetooth-lowenergy


【解决方案1】:

如果这可以引导您找到解决方案(我使用的是 Raspberry Pi - 而不是 Tiny Core):
蓝牙连接到串口有问题。重新连接它可以解决问题 - 就我而言:

sudo hciattach /dev/ttyAMA0 bcm43xx 9210600 noflow 

致电:hciattach -l 检查您的设备。

PS:永远感谢版主的意见,感谢您的负面反馈 - 我正在热情地收集它们;)

【讨论】:

    猜你喜欢
    • 2020-08-11
    • 2021-03-14
    • 1970-01-01
    • 1970-01-01
    • 2018-12-30
    • 1970-01-01
    • 2017-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多