spacecheese / bluez_peripheral

A library for building BLE peripherals using GATT and bluez
MIT License
38 stars 8 forks source link

Can't advertise non-UUID16 Services #7

Closed rpardini closed 2 years ago

rpardini commented 2 years ago

Hello, trying to use this for Improv-Wifi (https://www.improv-wifi.com/) via BLE (https://www.improv-wifi.com/ble/) For that I'd need to advertise the (128-bit UUID) 00467768-6228-2272-4663-277478268000 Unfortunately bluez_peripheral (for good reason, I guess... packet size and such?) coerces advertised services to 16-bit UUID, causing self is not a uuid16 in advert.py:144.

I copied it and hacked it from return [id.uuid16 for id in self._serviceUUIDs] to return [str(id) for id in self._serviceUUIDs] and then it works.

Does it make sense to you in any way? Should I PR? Thanks!

spacecheese commented 2 years ago

Thanks for the issue, not really sure why I wrote it that way. If you don't mind opening a PR that would be great, failing that I'll have another look at this in a couple of days. Ideally UUID16s should still use the short form.

spacecheese commented 2 years ago

I'll push a new release after I've investigated #8