public PebbleViewer (ILogger logger, PebblePlugin plugin, PebbleSharp.Core.Pebble pebble, IZip appBundleZip, Action<Action<ISystemController, IRaceController>> queueCommand) { _queueCommand = queueCommand; _plugin = plugin; _logger = logger; _pebble = pebble; _pebble.ConnectAsync ().Wait (); _logger.Info ("Connected to pebble " + _pebble.PebbleID); _transactionId = 255; var progress = new Progress<ProgressValue> (pv => _logger.Debug ("Installing app on pebble " + pebble.PebbleID + ", " + pv.ProgressPercentage + "% complete. " + pv.Message)); var bundle = new AppBundle (); bundle.Load (appBundleZip, _pebble.Firmware.HardwarePlatform.GetPlatform ()); _uuid = bundle.AppMetadata.UUID; _pebble.InstallClient.InstallAppAsync (bundle, progress).Wait (); _logger.Info ("Installed app on pebble " + pebble.PebbleID); _pebble.RegisterCallback<AppMessagePacket> (Receive); InitializeViewer (); }
public PebbleViewer(ILogger logger, PebblePlugin plugin, PebbleSharp.Core.Pebble pebble, IZip appBundleZip, Action <Action <ISystemController, IRaceController> > queueCommand) { _queueCommand = queueCommand; _plugin = plugin; _logger = logger; _pebble = pebble; _pebble.ConnectAsync().Wait(); _logger.Info("Connected to pebble " + _pebble.PebbleID); _transactionId = 255; var progress = new Progress <ProgressValue> (pv => _logger.Debug("Installing app on pebble " + pebble.PebbleID + ", " + pv.ProgressPercentage + "% complete. " + pv.Message)); var bundle = new AppBundle(); bundle.Load(appBundleZip, _pebble.Firmware.HardwarePlatform.GetPlatform()); _uuid = bundle.AppMetadata.UUID; _pebble.InstallClient.InstallAppAsync(bundle, progress).Wait(); _logger.Info("Installed app on pebble " + pebble.PebbleID); _pebble.RegisterCallback <AppMessagePacket> (Receive); InitializeViewer(); }
public PutBytesClient(Pebble pebble) { _pebble = pebble; }