public void TestEnumerate() { BleWatcher.Changed += () => { foreach (var device in BleWatcher.Devices) { //Debug.WriteLine(device.Value.Advertisement.LocalName); } }; BleWatcher.StartWatch(); Thread.Sleep(10000); BleWatcher.StopWatch(); }
public FindDevicesViewModel(Action <ulong> action) { BleWatcher.Changed += () => Devices = BleWatcher.Devices.Values.ToList(); ((SelectCommand)Select).OnExecute += action; ((SearchCommand)Search).Action += () => { if (BleWatcher.Status != AdvStatus.Started) { BleWatcher.StartWatch(); } else { Devices = null; BleWatcher.ResetDevices(); } }; Devices = BleWatcher.Devices.Values.ToList(); }
private void ModernWindow_Loaded(object sender, RoutedEventArgs e) { BleWatcher.StartWatch(); }
public void Execute(object parameter) => BleWatcher.StartWatch();