1

This is my first shot working with bluetooth and I'm confused about which channel I should be sending my write packet to enable notifications. I'm working with the Fitness Machine 0x1826 service and I'm trying to get the data from the 0x2AD2 characteristic, specifically the 0x0030 handle.

When I run "sudo gatttool -t random -b [MAC ADDRESS] -I --char-write-req -a 0x0030 - 0300 --listen" I get no response so I'm led to believe that I'm sending the packet to the wrong handle, as the device should be sending notifications with my actions.

Thanks for any help!

robmak3
  • 33
  • 1
  • 1
  • 3
  • I guess I figured it out, it's 0x0031 that I need to write the request to. Was that supposed to be in the docs somewhere, I was having a really hard time reading them. – robmak3 Dec 31 '20 at 04:19
  • 1
    One note of caution is that [gatttool has been deprecated](https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=b1eb2c4cd057624312e0412f6c4be000f7fc3617) back in 2017. The command line tool is now `bluetoothctl`. However the [BlueZ D-Bus API](https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc) should be used for scripting. Example at: https://stackoverflow.com/a/63751113/7721752 – ukBaz Dec 31 '20 at 10:37

1 Answers1

0

You should send your write packet to Client Characteristic Configuration Descriptor (CCCD), which has a UUID 0x2902. You first need to find the handle of that CCCD within the fitness machine service. You can find more information here:-

However, as ukBaz mentioned, gatttool is deprecated so you should look into using bluetoothctl instead. More information on using bluetoothctl as a gatt client is found here:-

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72