Hi.
I tried to apply Microsoft UWP BluetoothLE project to Unity.
Windows-universal-samples/Samples/BluetoothLE at main · microsoft/Windows-universal-samples · GitHub
When I worte codes as below, I got error.
// BT_Code: BluetoothLEDevice.FromIdAsync must be called from a UI thread because it may prompt for consent.
Windows.Devices.Bluetooth.BluetoothLEDevice bluetoothLeDevice = await Windows.Devices.Bluetooth.BluetoothLEDevice.FromIdAsync(bleDeviceId);
// this is the definition of BluetoothLEDevice.FromIdAsync()
public static extern IAsyncOperation<BluetoothLEDevice> FromIdAsync([In] string deviceId);
Assets\Scripts\my_script.cs: error CS1929: 'IAsyncOperation<BluetoothLEDevice>' does not contain a definition for 'GetAwaiter' and the best extension method overload 'AwaitExtensions.GetAwaiter(Process)' requires a receiver of type 'Process'
In player settings menu, the Api Compatibility Level wisas set to “.NET 4.x”.
What is the problem and solution?
Thanks