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