Windows.Devices.Radios.StateChanged and BluetoothDevice.ConnectionStatusChanged events not triggering sometimes

Jis N George 0 Reputation points
2023-12-04T08:01:05.24+00:00

I am developing a background service that communicates with a Bluetooth device. I have subscribed to Radio.StateChanged event of Radio object and it triggers fine when Bluetooth radio gets On / Off. But sometimes, that event is not triggering - that too under normal scenarios. Also, the BluetoothRadio.ConnectionStatusChanged event is also misbehaving sometimes. Sometimes when device is connected and Bluetooth radio is turned off, Radio.StateChanged triggers, but ConnectionStatusChanged won't trigger. Other times, both events won't trigger.

What could be the reason these events misbehave sometimes? Is there any better way that I could detect change in Bluetooth radio state and connection status?

Thanks

Universal Windows Platform (UWP)
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
748 questions
{count} votes