kevincar / bless

Cross-platform Bluetooth Low Energy Server Python Library
MIT License
78 stars 26 forks source link

Should the service name be advertised under Windows? #83

Closed paulhamsh closed 1 year ago

paulhamsh commented 2 years ago

The problem my_service_name doesn't seem to show in LightBlue when using Windows - it shows as the Windows device name

Reproduction my_service_name = "Sparksy" server = BlessServer(name=my_service_name)

Expected behavior Show as Sparksy

Desktop (please complete the following information):

Is it supposed to work under Windows 10?

Jakeler commented 2 years ago

No, the passed name is currently unused: https://github.com/kevincar/bless/blob/v0.2.4/bless/backends/winrt/server.py#L64 Would have to check if it is possible to implement it with WinRT. It should work on Linux and Mac though.

kevincar commented 1 year ago

As far as I can tell, WinRT doesn't allow custom changes to local_name property that is broadcast. I've implemented more of a workaround rather than a true solution, by manipulating the name of the Windows Bluetooth module device.

This results in changes to the name of the bluetooth device as it is listed in the Windows Registery Key, and thus requires that you run bless with elevated privileges or set user access to the specific bluetooth properties key that allows for name changes

Closing this for now with this work around. Merged into the develop branch for now with merge #89