Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor-specific (long) Service UUIDs must be written in lowercase #45

Open
mh- opened this issue Mar 8, 2020 · 0 comments
Open

Vendor-specific (long) Service UUIDs must be written in lowercase #45

mh- opened this issue Mar 8, 2020 · 0 comments

Comments

@mh-
Copy link
Contributor

mh- commented Mar 8, 2020

Today I discovered - after quite some debugging - that vendor-specific (long) Service UUIDs must be written in lowercase.
A BLE central will not find the service, if the declaration of a long UUID contains an uppercase hex digit.
I suggest that this should be changed to accept any valid hex string.

To reproduce in a simple example, modify main.py in the "echo" example, line 26 to

                'uuid': '12345678-1234-1234-1234-1234567890AB',

(it should be a vendor-specific (long) uuid, and note the capital letters AB)

Then use gatttool -b <bdaddr> -I on another linux machine and enter the commands below:

$ gatttool -b B8:27:EB:5E:36:C7 -I

[B8:27:EB:5E:36:C7][LE]> connect
Attempting to connect to B8:27:EB:5E:36:C7
Connection successful

[B8:27:EB:5E:36:C7][LE]> primary 
attr handle: 0x0001, end grp handle: 0x0005 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0006, end grp handle: 0x0009 uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000a, end grp handle: 0x000d uuid: 12345678-1234-1234-1234-1234567890ab

[B8:27:EB:5E:36:C7][LE]> primary 12345678-1234-1234-1234-1234567890ab
Error: No service UUID found

The result should of course be

Starting handle: 0x000a Ending handle: 0x000d

I tried multiple versions of pybleno, raspbian, bluez and it happened on all of them, before I found the reason "upper case hex digit". The last versions were: pybleno 0.11, raspbian buster, bluez 5.52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant