Ejemplo n.º 1
0
 private static IObservable<IList<BluetoothDeviceInfo>> DiscoverDevices(BluetoothClient bluetoothClient)
 {
     return Task.Factory
                .FromAsync<BluetoothDeviceInfo[]>(
                     (callback, state) =>
                     bluetoothClient.BeginDiscoverDevices(byte.MaxValue, true, true, true, false, callback, state),
                     bluetoothClient.EndDiscoverDevices,
                     null)
                 .ToObservable();
 }