示例#1
0
        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);
            }
        }
示例#2
0
 public static void GetDevice(GattInformation information)
 {
     GetDeviceAsync(information);
 }