I am using BLE device in Windows 10.0.19041. The workflow goes fine when Bluetooth is ON. If the Bluettooth is turned OFF BluetoothLEAdvertisementWatcher's start() method to discover peripherals throws the following exception: HRESULT_FROM_WIN32(ERROR_DEVICE_NOT_AVAILABLE) : The device is not ready for use.
Even if I catch and swallow this error and go on to stop discovery BluetoothLEAdvertisementWatcherStoppedEventArgs does not get updated with proper error.
Contrastingly, if there is no Bluetooth adaptor available in the system BluetoothLEAdvertisementWatcherStoppedEventArgs gets populated properly with "Radio not available".
This started happening recently. Anyone has any idea if this is a recent bug in Windows Bluetooth stack? How do I workaround it and throw a proper error that Bluetooth is off?
Thanks in advance!