How to Get&Control Bluetooth state with Rust

Hi everyone,

I'd like to implement two functionalities in Rust:

  1. ​Retrieve the current Bluetooth state (on/off) of a Windows device​​;

  2. ​Control the activation or deactivation of Bluetooth on Windows​​.

My naive idea is to use winapi::um::bth??, but I'm unfamiliar with the Windows API. Therefore, I request implementation code or guidance.

Additionally, if possible, please explain how to achieve similar functionality on macOS or Linux systems.

Any information would be greatly appreciated!

Having a look at this cross-platform bluetooth crate might help you:

I have used it on Linux for some basic GATT communication. Not sure if it can do what you are after.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.