В настоящее время я использую blueZ 5.50 на моем встроенном устройстве с ядром linux 4.4.35.Я использую API DBUS с g_dbus для управления удаленным управлением BLE, имеющим первичную службу HID (UUID 0x1812).Мне нужно прочитать HID-информацию о характеристиках GATT (UUID 0x2A4A) для этой службы.
Когда я связываю устройство методом device-api pair (), устройство подключается.Диспетчер объектов DBus перечисляет объекты GATT, но не перечисляет объекты GATT, связанные с HID.
У меня такое же поведение с инструментом bluetoothctl, который также основан на dbus API, связанные с HID идентификаторы gatt не отображаются:
[bluetooth]# pair F0:F8:F2:D4:44:EE
Attempting to pair with F0:F8:F2:D4:44:EE
[CHG] Device F0:F8:F2:D4:44:EE Connected: yes
[Notus UC]# Bluetooth: hci0 unexpected SMP command 0x0b from f0:f8:f2:d4:44:ee
[CHG] Device F0:F8:F2:D4:44:EE UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device F0:F8:F2:D4:44:EE UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device F0:F8:F2:D4:44:EE UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device F0:F8:F2:D4:44:EE UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device F0:F8:F2:D4:44:EE UUIDs: 00001812-0000-1000-8000-00805f9b34fb
[CHG] Device F0:F8:F2:D4:44:EE UUIDs: ab5e0001-5a21-4f05-bc7d-af01f617b664
[CHG] Device F0:F8:F2:D4:44:EE UUIDs: f000ffc0-0451-4000-b000-000000000000
[CHG] Device F0:F8:F2:D4:44:EE ServicesResolved: yes
[CHG] Device F0:F8:F2:D4:44:EE Paired: yes
[NEW] Primary Service
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0008
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
[NEW] Primary Service
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009
0000180a-0000-1000-8000-00805f9b34fb
Device Information
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char000a
00002a23-0000-1000-8000-00805f9b34fb
System ID
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char000c
00002a24-0000-1000-8000-00805f9b34fb
Model Number String
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char000e
00002a25-0000-1000-8000-00805f9b34fb
Serial Number String
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char0010
00002a26-0000-1000-8000-00805f9b34fb
Firmware Revision String
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char0012
00002a27-0000-1000-8000-00805f9b34fb
Hardware Revision String
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char0014
00002a28-0000-1000-8000-00805f9b34fb
Software Revision String
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char0016
00002a29-0000-1000-8000-00805f9b34fb
Manufacturer Name String
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char0018
00002a2a-0000-1000-8000-00805f9b34fb
IEEE 11073-20601 Regulatory Cert. Data List
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0009/char001a
00002a50-0000-1000-8000-00805f9b34fb
PnP ID
[NEW] Primary Service
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0022
ab5e0001-5a21-4f05-bc7d-af01f617b664
Vendor specific
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0022/char0023
ab5e0002-5a21-4f05-bc7d-af01f617b664
Vendor specific
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0022/char0025
ab5e0003-5a21-4f05-bc7d-af01f617b664
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0022/char0025/desc0027
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0022/char0028
ab5e0004-5a21-4f05-bc7d-af01f617b664
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0022/char0028/desc002a
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Primary Service
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046
f000ffc0-0451-4000-b000-000000000000
Vendor specific
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char0047
f000ffc1-0451-4000-b000-000000000000
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char0047/desc0049
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char0047/desc004a
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char004b
f000ffc2-0451-4000-b000-000000000000
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char004b/desc004d
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char004b/desc004e
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char004f
f000ffc3-0451-4000-b000-000000000000
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char004f/desc0051
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Characteristic
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char0052
f000ffc4-0451-4000-b000-000000000000
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char0052/desc0054
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Descriptor
/org/bluez/hci0/dev_F0_F8_F2_D4_44_EE/service0046/char0052/desc0055
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Pairing successful
[CHG] Device F0:F8:F2:D4:44:EE Name: NOTUS UC
[CHG] Device F0:F8:F2:D4:44:EE Alias: NOTUS UC
[CHG] Device F0:F8:F2:D4:44:EE Modalias: bluetooth:v0217p0001d0100
Когда я использую gatttool на том же самомустройство, я могу прочитать характеристику:
# gatttool -b F0:F8:F2:D4:44:EE -I
[F0:F8:F2:D4:44:EE][LE]> connect
Attempting to connect to F0:F8:F2:D4:44:EE
Connection successful
Notification handle = 0x0037 value: 00 00 00 00 00 00 00 00
[F0:F8:F2:D4:44:EE][LE]> char-desc
…
handle: 0x002e, uuid: 00002a4a-0000-1000-8000-00805f9b34fb
…
[F0:F8:F2:D4:44:EE][LE]> char-read-hnd 0x002e
Characteristic value/descriptor: 11 01 00 01
Когда я компилирую bluez с отключенными профилями HID и Hog (--disable-hid --disable-hog), объекты gatt доступны в bluetoothctl и моем приложении.Но у меня больше нет устройства событий в /dev/input/.
Есть ли способ доступа к характеристике HID с помощью API DBUS?