On 08.07.2019 15:19, Luiz Augusto von Dentz wrote:
On Sun, Jul 7, 2019 at 2:53 PM Rafał Miłecki <zajec5@xxxxxxxxx> wrote:
Hi,
I have 2 notebooks with Bluetooth running bluez 5.30. I called them:
1) "elitebook" with controller 20:16:B9:D8:A9:3B
2) "matebook" with controller 38:BA:F8:3F:7C:A7
Normally, when I check elitebook from matebook I get this:
[elitebook]# info 20:16:B9:D8:A9:3B
Device 20:16:B9:D8:A9:3B (public)
Name: elitebook
Alias: elitebook
Class: 0x001c010c
Icon: computer
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: IrMC Sync (00001104-0000-1000-8000-00805f9b34fb)
UUID: OBEX Object Push (00001105-0000-1000-8000-00805f9b34fb)
UUID: OBEX File Transfer (00001106-0000-1000-8000-00805f9b34fb)
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb)
UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb)
UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb)
UUID: Message Notification Se.. (00001133-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (00005005-0000-1000-8000-0002ee000001)
Modalias: usb:v1D6Bp0246d0532
I decided to test GATT. On elitebook I started:
./test/example-gatt-server
and waited to let matebook refresh all info.
After that I got:
[elitebook]# info 20:16:B9:D8:A9:3B
Device 20:16:B9:D8:A9:3B (public)
Name: elitebook
Alias: elitebook
Class: 0x001c010c
Icon: computer
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: IrMC Sync (00001104-0000-1000-8000-00805f9b34fb)
UUID: OBEX Object Push (00001105-0000-1000-8000-00805f9b34fb)
UUID: OBEX File Transfer (00001106-0000-1000-8000-00805f9b34fb)
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb)
UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb)
UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb)
UUID: Message Notification Se.. (00001133-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Heart Rate (0000180d-0000-1000-8000-00805f9b34fb)
UUID: Battery Service (0000180f-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (00005005-0000-1000-8000-0002ee000001)
UUID: Vendor specific (12345678-1234-5678-1234-56789abcdef0)
Modalias: usb:v1D6Bp0246d0532
That seems all correct for now. Test example-gatt-server registers
Heart Rate, Battery & Test services. All of them appeared as expected.
My problem is that I can't list GATT attributes. I don't any output.
Is there anything I'm doing incorrectly?
[elitebook]# menu gatt
Menu gatt:
Available commands:
-------------------
list-attributes [dev] List attributes
select-attribute <attribute/UUID> Select attribute
attribute-info [attribute/UUID] Select attribute
read [offset] Read attribute value
write <data=xx xx ...> [offset] Write attribute value
acquire-write Acquire Write file descriptor
release-write Release Write file descriptor
acquire-notify Acquire Notify file descriptor
release-notify Release Notify file descriptor
notify <on/off> Notify attribute value
register-application [UUID ...] Register profile to connect
unregister-application Unregister profile
register-service <UUID> Register application service.
unregister-service <UUID/object> Unregister application service
register-includes <UUID> Register as Included service in.
unregister-includes <Service-UUID><Inc-UUID> Unregister Included service.
register-characteristic <UUID> <Flags=read,write,notify...> Register application characteristic
unregister-characteristic <UUID/object> Unregister application characteristic
register-descriptor <UUID> <Flags=read,write...> Register application descriptor
unregister-descriptor <UUID/object> Unregister application descriptor
back Return to main menu
version Display version
quit Quit program
exit Quit program
help Display help about this program
export Print evironment variables
[elitebook]# list-attributes
[elitebook]# list-attributes 20:16:B9:D8:A9:3B
I guess what you are looking for is list-attributes local though that
only works for service register by bluetoothctl itself not by other
applications, those objects are normally accessible to bluetoothd only
and we don't expose objects from other application.
I'm confused now. I thought I understand the purpose of "menu gatt" +
"list-attributes". I'm not BlueZ expert but it seems to me to be well
capable of accessing GATT of remote devices.
When I connect my Logitech M590 BLE mouse I can use "menu gatt" +
"list-attributes" to access its GATT.
Why accessing GATT of another notebook would be any different? I'm not
sure what I'm missing.
There is an example of me using "bluetoothctl" to access GATT of M590:
[M585/M590]# menu gatt
Menu gatt:
Available commands:
-------------------
list-attributes [dev] List attributes
select-attribute <attribute/UUID> Select attribute
attribute-info [attribute/UUID] Select attribute
read [offset] Read attribute value
write <data=xx xx ...> [offset] Write attribute value
acquire-write Acquire Write file descriptor
release-write Release Write file descriptor
acquire-notify Acquire Notify file descriptor
release-notify Release Notify file descriptor
notify <on/off> Notify attribute value
register-application [UUID ...] Register profile to connect
unregister-application Unregister profile
register-service <UUID> Register application service.
unregister-service <UUID/object> Unregister application service
register-includes <UUID> Register as Included service in.
unregister-includes <Service-UUID><Inc-UUID> Unregister Included service.
register-characteristic <UUID> <Flags=read,write,notify...> Register application characteristic
unregister-characteristic <UUID/object> Unregister application characteristic
register-descriptor <UUID> <Flags=read,write...> Register application descriptor
unregister-descriptor <UUID/object> Unregister application descriptor
back Return to main menu
version Display version
quit Quit program
exit Quit program
help Display help about this program
export Print evironment variables
[M585/M590]# list-attributes
Primary Service
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service0008
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service0008/char0009
00002a05-0000-1000-8000-00805f9b34fb
Service Changed
Descriptor
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service0008/char0009/desc000b
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
Primary Service
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c
0000180a-0000-1000-8000-00805f9b34fb
Device Information
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char000d
00002a29-0000-1000-8000-00805f9b34fb
Manufacturer Name String
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char000f
00002a24-0000-1000-8000-00805f9b34fb
Model Number String
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0011
00002a25-0000-1000-8000-00805f9b34fb
Serial Number String
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0013
00002a27-0000-1000-8000-00805f9b34fb
Hardware Revision String
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0015
00002a26-0000-1000-8000-00805f9b34fb
Firmware Revision String
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0017
00002a28-0000-1000-8000-00805f9b34fb
Software Revision String
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0019
00002a50-0000-1000-8000-00805f9b34fb
PnP ID
Primary Service
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service003e
00010000-0000-1000-8000-011f2000046d
Vendor specific
Characteristic
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service003e/char003f
00010001-0000-1000-8000-011f2000046d
Vendor specific
Descriptor
/org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service003e/char003f/desc0041
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[M585/M590:/service000c/char0019]# select-attribute /org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0015
[M585/M590:/service000c/char0015]# read
Attempting to read /org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0015
[CHG] Attribute /org/bluez/hci0/dev_FB_F2_B0_6D_C1_6C/service000c/char0015 Value:
4d 50 4d 30 35 2e 30 31 5f 30 30 30 36 MPM05.01_0006
4d 50 4d 30 35 2e 30 31 5f 30 30 30 36 MPM05.01_0006