Пример #1
0
 protected bool Equals( UUID other )
 {
     if ( other == null )
         return false;
     return !_data.Where((t, i) => t != other._data[i]).Any();
 }
Пример #2
0
		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 ();
		}