Send hex values with gatttool

Hi everyone,

I went to send an array of hex value to the blueduino that will then uses those value to control an LED strip.

I know how to send ASCII code with this piece of code:

[AA:BB:CC:DD:EE:FF][LE]> char-write-req 0x0029 01020304

My question is can I do the same thing but with hex values and can I send 100 of them in the same time or should I send them one by one?

Thank you fro your time :slight_smile:

The maximum length of the value is 20. So you can send hex values like this

[AA:BB:CC:DD:EE:FF][LE]> char-write-req 0x0029 0102030405060708090A0B0C....

Hi aprilpea,

Thanks for the quick answer!

I have a subsidiary question. I know you can use the following command to get the list of characteristics:

[AA:BB:CC:DD:EE:FF][LE]> char-desc 0x0023 0xffff

But is there a documentation or a link to explain to what all the results correspond? I couldn’t find any…

see the reply also

We used the command to got the start handle 0x0023 and end handle 0xffff for service 0xfff0.

[88:33:14:DD:87:6D][LE]> primary
attr handle: 0x0001, end grp handle: 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0010, end grp handle: 0x0022 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle: 0x0023, end grp handle: 0xffff uuid: 0000fff0-0000-1000-8000-00805f9b34fb

The service 0xfff0 is the serial service. characteristic discovery command:

[88:33:14:DD:87:6D][LE]> char-desc 0x0023 0xffff

Thank you for the answer, I actually read the thread you linked before starting this one.

My question was more like how you know what everything listed is for.

For example you said 0xfff0 is the serial service but how do you know that?
what is 0x0022 then? and 0x000f and 0x000b ?

Also, when you launch the charasteristic discovery command, what does the results mean? How do I know I should use handle 0x0028 to send my data and not handle 0x0025.

[88:33:14:DD:87:6D][LE]> char-desc 0x0023 0xffff
handle: 0x0023, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0024, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0025, uuid: 0000fff1-0000-1000-8000-00805f9b34fb
handle: 0x0026, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0027, uuid: 00002901-0000-1000-8000-00805f9b34fb
handle: 0x0028, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0029, uuid: 0000fff2-0000-1000-8000-00805f9b34fb
handle: 0x002a, uuid: 00002901-0000-1000-8000-00805f9b34fb

More generally, what is a service, what is a handle, a characteristic, what does uuid means?

As you can see I’m a very beginner in this and I can’t manage to find good documentation about general knowledge :confused:.

Hopefully someone here can help me understand how everything works a bit better or at least give me some links that can answers those questions! :slight_smile:

Ok, I got some elements of answers here: https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb/control-with-bluez

Based on that, I manage to make this table:

As you can see, there is plenty of red spot where I don’t know why they stand for since they are not part of the GATT specification.

Bluetooth SIG declared some official services. You can check them here.

The 0xfff0 is just a custom service UUID we defined. So you can’t find it at Bluetooth’s website.

Ok thanks for the answer :slight_smile: