You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var myRadio = BluetoothRadio.Default;
var mode = myRadio.Mode;
if (mode != RadioMode.Connectable)
{
// produces an exception, as the lib uses a Windows RT Dispatcher function
myRadio.Mode = RadioMode.Connectable;
}
Code from BluetoothRadio.Windows, where the Windows.UI.Core.CoreWindow.GetForCurrentThread() returns null.
public RadioMode Mode
{
get
{
return _radio.State == RadioState.On ? RadioMode.Connectable : RadioMode.PowerOff;
}
set
{
Windows.UI.Core.CoreWindow.GetForCurrentThread().DispatcherQueue.TryEnqueue(async () =>
{
if (await Radio.RequestAccessAsync() == RadioAccessStatus.Allowed)
{
await _radio.SetStateAsync(value == RadioMode.PowerOff ? RadioState.Off : RadioState.On);
}
});
}
}
I suppose, that this would be a problem in a console app, too.
The text was updated successfully, but these errors were encountered:
I want to do something like this:
Code from BluetoothRadio.Windows, where the Windows.UI.Core.CoreWindow.GetForCurrentThread() returns null.
I suppose, that this would be a problem in a console app, too.
The text was updated successfully, but these errors were encountered: