alexmoon / bluest

Cross-platform Rust crate for working with Bluetooth Low Energy devices.
Apache License 2.0
64 stars 11 forks source link

Peripheral role support #4

Closed ariofrio closed 1 year ago

ariofrio commented 1 year ago

Wanted to ask if you'd be open to a pull request adding support for the Peripheral role. I'm not yet sure how involved this is.

I'm currently working on a macOS-only prototype using native APIs directly in Swift, but if my project is successful, I may be looking to implement a cross-platform version with Tauri and bluest. I won't start working on this right away, and I might not end up doing so, but I wanted to feel you out on your vision for the future of this crate.

By the way, I looked at the other BLE cross-platform libraries (btle, bluster), and this seems to be the best architected (using the bluer crate rather than hand-rolling Bluez support, using the up-to-date windows crate, clear philosophy for API design and compatibility). Thanks for your great work!

alexmoon commented 1 year ago

Thanks for the kind words. I'd certainly be open to a PR to add Peripheral support to the crate.

ariofrio commented 1 year ago

FYI, I’ve found out that support for peripheral mode with HID profile in various platforms is spotty at best, so I’ve decided to go a different way.

In particular, Core Bluetooth on macOS blocks local HID peripherals from being implemented by developers and macOS Ventura seems to have a bug (or a new limitation?) that blocks local HID peripherals from being implemented using IOBluetooth.

alexmoon commented 1 year ago

Yeah, OS's have gotten pretty strict with HID devices.