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); } } }
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); } }
public static void Startup(TestContext context) { _Pebble = PebbleNet45.DetectPebbles().SingleOrDefault(); Assert.IsNotNull(_Pebble, "Could not find pebble"); _Pebble.ConnectAsync().Wait(); }