【发布时间】: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