1

When I enumerate Bluetooth LE devices using WinRT API, sometimes, I needed to reset Bluetooth radio to successfully find my device. I am wondering is there an easy way to do this from code (Windows SDK, WinRT, WMI etc)? Highlighted in red, the switch to toggle the radio

2 Answers 2

2

After digging through Windows Universal samples from Microsoft, I have found a sample RadioManager which shows how to access Radios and turn ON/OFF from code at will. I was able to use the API successfully with a caveat that when used from Desktop WPF app, the app has to be built to match native architecture of the machine. Otherwise, ‘GetRadiosAsync’ method returns empty set.

Sign up to request clarification or add additional context in comments.

Comments

0

I'm not totally sure, but resetting the system-wide Bluetooth radio is the sort of action highly unlikely to be available to an execution environment with non-admin privileges.

Anything able to stomp over the abilities of other processes (like turning off a radio) is not going to available in WinRT.

Edit: I stand corrected. Such an API apparently exists:

Windows.Devices.Radios.SetStateAsync

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.