public void TestEnumerate()
 {
     BleWatcher.Changed += () =>
     {
         foreach (var device in BleWatcher.Devices)
         {
             //Debug.WriteLine(device.Value.Advertisement.LocalName);
         }
     };
     BleWatcher.StartWatch();
     Thread.Sleep(10000);
     BleWatcher.StopWatch();
 }
Example #2
0
 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();
 }
Example #3
0
 private void ModernWindow_Loaded(object sender, RoutedEventArgs e)
 {
     BleWatcher.StartWatch();
 }
 public void Execute(object parameter) => BleWatcher.StartWatch();