Loop
Loop

Reputation: 78

Windows.Devices.Radios are not working in the x86 platform

My target is to verify that the device has Bluetooth, and if it has one, then verify that the Bluetooth is turned on or off. For that purpose, I am using the below code snippet.

public async Task<bool> GetBluetoothStatusAsync()
{
    var allRadio = await Radio.GetRadiosAsync();
    if (allRadio == null) return false;
    var bluetoothRadio = allRadio.FirstOrDefault(radio => radio.Kind == RadioKind.Bluetooth);
    return bluetoothRadio != null && bluetoothRadio.State == RadioState.On;
}

It's not working when called from a desktop Win32 app. Windows.Devices.Radios are working fine if the targeted platform is set to x64, but for the x86, it's not working. From the windows git issues, it looks like this is a known issue, and it's not solved yet. Is there any workaround available for this issue?

Upvotes: 1

Views: 574

Answers (1)

Karl Sangree
Karl Sangree

Reputation: 111

This is an old thread, but just in case anyone else is looking:

From the Windows doc: When this method is called from a desktop application (Win32), it will retrieve radio instances only when the application is natively compiled for the target architecture (in other words, when the application matches the computer architecture; so an x86 application running on an x64 architecture computer won't see any radio instances).

Upvotes: 3

Related Questions