bluetooth icon indicating copy to clipboard operation
bluetooth copied to clipboard

Expose ServiceData() in AdvertisementFields

Open radhus opened this issue 2 years ago • 1 comments

This PR adds a ServiceData() function to AdvertisementFields which returns a map of service data, similar to manufacturer data.

I don't know the Bluetooth spec enough to understand the difference between these two, but I have different BLE devices and some advertise the data I'm interested in as service data, while others use manufacturer data. I'd like to use this library to handle both types of devices.

I have tested this on Linux and macOS. Both works, but as IIRC you can't get hold of the device MAC on macOS, I couldn't verify the data completely. I don't have access to Windows or custom devices to test further.

Hope this feature makes sense!

radhus avatar Oct 09 '22 17:10 radhus

This looks like a reasonable PR, sorry I missed it.

Can you rebase it on the current dev branch? There were a lot of changes in the Linux/BlueZ version so this PR will need some updates.

aykevl avatar Jan 17 '24 11:01 aykevl

Rebased and merged in #243 . Sorry for forgetting about this 🙈

radhus avatar Mar 18 '24 21:03 radhus