Esempio n. 1
0
        /// <summary>
        ///     Create a new Pebble
        /// </summary>
        /// <param name="connection">The port to use to connect to the pebble</param>
        /// <param name="pebbleId">
        ///     The four-character Pebble ID, based on its BT address.
        ///     Nothing explodes when it's incorrect, it's merely used for identification.
        /// </param>
        protected Pebble(IBluetoothConnection connection, string pebbleId)
        {
            ResponseTimeout = TimeSpan.FromSeconds(5);
            PebbleID        = pebbleId;

            _callbackHandlers = new Dictionary <Type, List <CallbackContainer> >();

            _PebbleProt = new PebbleProtocol(connection);
            _PebbleProt.RawMessageReceived += RawMessageReceived;

            RegisterCallback <ApplicationMessageResponse>(OnApplicationMessageReceived);
        }
Esempio n. 2
0
        /// <summary>
        ///     Create a new Pebble
        /// </summary>
        /// <param name="connection">The port to use to connect to the pebble</param>
        /// <param name="pebbleId">
        ///     The four-character Pebble ID, based on its BT address.
        ///     Nothing explodes when it's incorrect, it's merely used for identification.
        /// </param>
        protected Pebble(IBluetoothConnection connection, string pebbleId)
        {
            ResponseTimeout     = TimeSpan.FromSeconds(5);
            PebbleID            = pebbleId;
            this.BlobDBClient   = new BlobDBClient(this);
            this.PutBytesClient = new PutBytesClient(this);
            this.InstallClient  = new InstallClient(this);

            _callbackHandlers = new Dictionary <Type, List <CallbackContainer> >();

            _PebbleProt = new PebbleProtocol(connection);
            _PebbleProt.RawMessageReceived += RawMessageReceived;

            RegisterCallback <AppMessagePacket>(OnApplicationMessageReceived);
        }