The error...
Error 1 'await' requires that the type 'Windows.Foundation.IAsyncOperation' have a suitable GetAwaiter method. Are you missing a using directive for 'System'? C:\Users\jo\Documents\Visual Studio 2013\Projects\Btle01\Btle01\Form1.cs 29 46 Btle01
My code...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using Windows.Devices.Bluetooth;
using Windows.Devices.Enumeration;
using Windows.Foundation;
using Windows.System;
namespace Btle01
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void OnFormLoad(object sender, EventArgs e)
{
}
private async Task GetDevs()
{
foreach (DeviceInformation di in await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(BluetoothLEDevice.GetDeviceSelector()))
{
BluetoothLEDevice bleDevice = await BluetoothLEDevice.FromIdAsync(di.Id);
listView1.Items.Add(bleDevice.Name);
}
}
}
}
List of project references...
False
..\..\..\..\..\..\..\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.WindowsRuntime.dll
..\\..\\..\\..\\..\\..\\..\\Windows\\System32\\WinMetadata\\Windows.Devices.winmd