0

Oddly, I can't seem to find anything about this. I am trying to access/read/write bluetooth services on my device. I am using bluetoothctl command. There are a set of services, which shows up with info command and another set, which shows up in menu gatt/list-attributes.

info:

Device <someMACaddress> (public)
    Name: <somename>
    Alias: <somealias>
    Paired: 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: Vendor specific           (3dda0001-957f-7d4a-34a6-74696673696d)
    ManufacturerData Key: 0x<2bytekey>
    ManufacturerData Value:
  <10bytehexvalue>   

             <10bytevalue>      

I can access the gatt services but I can't find a way to access the first set of services displayed above. I was wondering, if there is any way? It appears to be that these services are not GATT but all my searches about reading values lead to GATT. For instance, when I connect the device to Android, hcisnoop log shows HID handle 1812 is being used when I press the button on the BLE device. It also appears as /dev/hidraw2.

I was wondering, if I can specifically listen to 1812 handle or uuid for the raw input? or another handle such as 180a or 1801 etc...?

0

I have found most applicable answer to my question on StackOverflow by OlivierM.

Basically, he states that some specific GATT services such as the battery service was moved to DBUS and can be accessed via DBUS. An example to this solution was also given: I think it worked for me and I had a reading.

  1. Connect to your target BLE device with bluetoothctl
  2. And then request DBUS: dbus-send --print-reply=literal --system --dest=org.bluez /org/bluez/hci0/dev_<mac_address_of_your_ble_peripheral> org.freedesktop.DBus.Properties.Get string:"org.bluez.Battery1" string:"Percentage"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.