private static async void GetDeviceAsync(GattInformation info) { GattDevice dev = null; // We must update the collection on the UI thread await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { BluetoothLEDevice device = await BluetoothLEDevice.FromIdAsync(info.Id); dev = GattDevice.Create(device); }); if (dev != null) { OnDeviceCreated?.Invoke(dev); } }
public static void GetDevice(GattInformation information) { GetDeviceAsync(information); }