/// <summary> Create a new Pebble /// </summary> /// <param name="port">The serial port to connect to.</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> public Pebble(string port, string pebbleId) { ResponseTimeout = TimeSpan.FromSeconds(5); PebbleID = pebbleId; _callbackHandlers = new Dictionary <Type, List <CallbackContainer> >(); _PebbleProt = new PebbleProtocol(port); _PebbleProt.RawMessageReceived += RawMessageReceived; }
/// <summary> Create a new Pebble /// </summary> /// <param name="port">The serial port to connect to.</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> public Pebble(String port, String pebbleid) { Alive = false; PingTimeout = 10000; PebbleID = pebbleid; pebbleProt = new PebbleProtocol(port); pebbleProt.RawMessageReceived += pebbleProt_RawMessageReceived; endpointEvents = new Dictionary <Endpoints, EventHandler <MessageReceivedEventArgs> >(); RegisterEndpointCallback(Endpoints.PHONE_VERSION, PhoneVersionReceived); RegisterEndpointCallback(Endpoints.VERSION, VersionReceived); RegisterEndpointCallback(Endpoints.APP_MANAGER, AppbankStatusResponseReceived); pingTimer = new System.Timers.Timer(16180); pingTimer.Elapsed += pingTimer_Elapsed; pingTimer.Start(); }
/// <summary> Create a new Pebble /// </summary> /// <param name="port">The serial port to connect to.</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> public Pebble(String port, String pebbleid) { Alive = false; PingTimeout = 10000; PebbleID = pebbleid; pebbleProt = new PebbleProtocol(port); pebbleProt.RawMessageReceived += pebbleProt_RawMessageReceived; endpointEvents = new Dictionary<Endpoints, EventHandler<MessageReceivedEventArgs>>(); RegisterEndpointCallback(Endpoints.PHONE_VERSION, PhoneVersionReceived); RegisterEndpointCallback(Endpoints.VERSION, VersionReceived); RegisterEndpointCallback(Endpoints.APP_MANAGER, AppbankStatusResponseReceived); pingTimer = new System.Timers.Timer(16180); pingTimer.Elapsed += pingTimer_Elapsed; pingTimer.Start(); }