BlueZ 与 GATTtool 主要服务列表

问题描述 投票:0回答:1

我需要使用 BLE 按钮创建应用程序。我在 RPi3 上使用简单的 ab 快门和 java 应用程序。但是tinyB没有找到正确的主要服务。然后我尝试在 bluez 和 gatttool 的本机工具中查找它。有人可以帮忙吗: BlueZ 5.65 正确连接到设备。然后 info 命令打印设备上的所有服务,gatttool 也是如此。但命令 list-attributes 只显示其中的一些。我需要的特征 - HID (00001812-0000-1000-8000-00805f9b34fb)。我如何在列表属性中找到它?因为tinyB 库仅显示 ex 的列表。

蓝牙控制信息:

info
Device 31:F7:32:16:2E:B2 (public)
    Name: AB Shutter3
    Alias: AB Shutter3
    Appearance: 0x03c1
    Icon: input-keyboard
    Paired: yes
    Bonded: yes
    Trusted: yes
    Blocked: no
    Connected: yes
    LegacyPairing: no
    UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
    UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
    UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
    UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
    UUID: Unknown                   (0000ae40-0000-1000-8000-00805f9b34fb)
    Modalias: usb:v2717p0040d0023
    Battery Percentage: 0x58 (88)

列表属性:

list-attributes 31:F7:32:16:2E:B2
Primary Service (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service0008
    00001801-0000-1000-8000-00805f9b34fb
    Generic Attribute Profile
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service0008/char0009
    00002a05-0000-1000-8000-00805f9b34fb
    Service Changed
Descriptor (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service0008/char0009/desc000b
    00002902-0000-1000-8000-00805f9b34fb
    Client Characteristic Configuration
Primary Service (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c
    0000180a-0000-1000-8000-00805f9b34fb
    Device Information
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char000d
    00002a29-0000-1000-8000-00805f9b34fb
    Manufacturer Name String
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char000f
    00002a24-0000-1000-8000-00805f9b34fb
    Model Number String
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char0011
    00002a25-0000-1000-8000-00805f9b34fb
    Serial Number String
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char0013
    00002a27-0000-1000-8000-00805f9b34fb
    Hardware Revision String
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char0015
    00002a26-0000-1000-8000-00805f9b34fb
    Firmware Revision String
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char0017
    00002a28-0000-1000-8000-00805f9b34fb
    Software Revision String
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char0019
    00002a23-0000-1000-8000-00805f9b34fb
    System ID
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char001b
    00002a2a-0000-1000-8000-00805f9b34fb
    IEEE 11073-20601 Regulatory Cert. Data List
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service000c/char001d
    00002a50-0000-1000-8000-00805f9b34fb
    PnP ID
Primary Service (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service001f
    0000180f-0000-1000-8000-00805f9b34fb
    Battery Service
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service001f/char0020
    00002a19-0000-1000-8000-00805f9b34fb
    Battery Level
Descriptor (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service001f/char0020/desc0022
    00002902-0000-1000-8000-00805f9b34fb
    Client Characteristic Configuration
Primary Service (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service003e
    0000ae40-0000-1000-8000-00805f9b34fb
    Unknown
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service003e/char003f
    0000ae41-0000-1000-8000-00805f9b34fb
    Unknown
Characteristic (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service003e/char0041
    0000ae42-0000-1000-8000-00805f9b34fb
    Unknown
Descriptor (Handle 0x0000)
    /org/bluez/hci0/dev_31_F7_32_16_2E_B2/service003e/char0041/desc0043
    00002902-0000-1000-8000-00805f9b34fb
    Client Characteristic Configuration

gatt工具:

[31:F7:32:16:2E:B2][LE]> primary

命令失败:已断开连接 连接成功 [31:F7:32:16:2E:B2][LE]> 主要 attr 句柄:0x0001,结束 grp 句柄:0x0007 uuid:00001800-0000-1000-8000-00805f9b34fb attr 句柄:0x0008,结束 grp 句柄:0x000b uuid:00001801-0000-1000-8000-00805f9b34fb attr 句柄:0x000c,结束 grp 句柄:0x001e uuid:0000180a-0000-1000-8000-00805f9b34fb attr 句柄:0x001f,结束 grp 句柄:0x0022 uuid:0000180f-0000-1000-8000-00805f9b34fb attr 句柄:0x0023,结束 grp 句柄:0x003d uuid:00001812-0000-1000-8000-00805f9b34fb attr 句柄:0x003e,结束 grp 句柄:0x0043 uuid:0000ae40-0000-1000-8000-00805f9b34fb

bluez gatt gatttool
1个回答
2
投票

通过在单元文件(/lib/systemd/system/bluetooth.service)配置蓝牙服务并在 exec 中添加 --noplugin=input,hog 来解决问题

© www.soinside.com 2019 - 2024. All rights reserved.