Ejemplo n.º 1
0
 public MainWindowViewModel()
 {
     if (IsInDesignMode == false)
     {
         try
         {
             var pebbles = PebbleNet45.DetectPebbles();
             _pebbleDevices = new List <PebbleViewModel>(pebbles.Select(x => new PebbleViewModel(x)));
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
Ejemplo n.º 2
0
        private static async Task ShowPebbles()
        {
            Console.WriteLine("PebbleCmd");
            Console.WriteLine("Select Pebble to connect to:");
            var pebbles = PebbleNet45.DetectPebbles();
            var options = pebbles.Select(x => x.PebbleID).Union(new[] { "Exit" });
            var menu    = new Menu(options.ToArray());
            var result  = menu.ShowMenu();

            if (result >= 0 && result < pebbles.Count)
            {
                var selectedPebble = pebbles[result];
                Console.WriteLine("Connecting to Pebble " + selectedPebble.PebbleID);
                await selectedPebble.ConnectAsync();

                Console.WriteLine("Connected");
                await ShowPebbleMenu(selectedPebble);
            }
        }
Ejemplo n.º 3
0
 public static void Startup(TestContext context)
 {
     _Pebble = PebbleNet45.DetectPebbles().SingleOrDefault();
     Assert.IsNotNull(_Pebble, "Could not find pebble");
     _Pebble.ConnectAsync().Wait();
 }