void Adapter_DeviceConnected(object sender, DeviceConnectionEventArgs e) { Debug.WriteLine("Device Connected"); this.Device = e.Device; //if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("932")) //{ // Debug.WriteLine("Instantiating PE932 Handler"); // this.syncDeviceHandler = SyncDeviceHandler932.GetInstance(); //} /*else */ if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("961")) { Debug.WriteLine("Instantiating PE/FT961 Handler"); this.SyncDeviceHandler = SyncDeviceHandler961.GetInstance(); } else if (this.Device.Name.StartsWith("H25FE2")) { this.SyncDeviceHandler = SyncDeviceHandlerStriiv.GetInstance(); } this.SyncDeviceHandler.IncrementProgressBar += UpdateProgressBar; this.SyncDeviceHandler.SyncDone += DoneSyncing; this.SyncDeviceHandler.SetAdapter(this.Adapter); this.SyncDeviceHandler.SetDevice(this.Device); this.SyncDeviceHandler.SetWebService(this.WebService); e.Device.ServicesDiscovered += Services_Discovered; //this.Adapter.CommandResponse += SyncDeviceHandler.ReceiveResponse; e.Device.DiscoverServices(); }
public SyncHandler() { this.InScanningMode = false; this.ProcessingDevice = false; serviceList = new List <Guid>(); serviceList.Add(0x180F.UuidFromPartial()); serviceList.Add(new Guid("278B67FE-266B-406C-BD40-25379402B58D")); this.SyncDeviceHandler = null; }
public SyncHandler() { this.InScanningMode = false; this.ProcessingDevice = false; serviceList = new List<Guid>(); //serviceList.Add(0x180F.UuidFromPartial ()); //serviceList.Add(new Guid("278B67FE-266B-406C-BD40-25379402B58D")); this.SyncDeviceHandler = null; }
//**********EVENTS RECEIVED FROM BLE - End private void startSyncProcess() { if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("932")) { this.syncDeviceHandler = SyncDeviceHandler932.GetInstance(); } else if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("961")) { this.syncDeviceHandler = SyncDeviceHandler961.GetInstance(); } this.syncDeviceHandler.SetAdapter(this.Adapter); this.syncDeviceHandler.SetDevice(this.Device); this.syncDeviceHandler.StartSync(); }
void Adapter_DeviceConnected(object sender, DeviceConnectionEventArgs e) { Debug.WriteLine("Device Connected"); this.Device = e.Device; //if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("932")) //{ // Debug.WriteLine("Instantiating PE932 Handler"); // this.syncDeviceHandler = SyncDeviceHandler932.GetInstance(); //} /*else */ if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("961")) { Debug.WriteLine("Instantiating PE/FT961 Handler"); this.SyncDeviceHandler = SyncDeviceHandler961.GetInstance(); } else if (this.Device.Name.Replace("PE", "").Replace("FT", "").StartsWith("939")) { Debug.WriteLine("Instantiating PE939 Handler"); this.SyncDeviceHandler = SyncDeviceHandler939.GetInstance(); } else if (this.Device.Name.StartsWith("H25FE2")) { this.SyncDeviceHandler = SyncDeviceHandlerStriiv.GetInstance(); } this.SyncDeviceHandler.IncrementProgressBar += UpdateProgressBar; this.SyncDeviceHandler.SyncDone += DoneSyncing; this.SyncDeviceHandler.SyncStarted += SyncDeviceHandler_SyncStarted; this.SyncDeviceHandler.ValidationCodeDisplayed += SyncDeviceHandler_ValidationCodeDisplayed; this.SyncDeviceHandler.CodeValidated += SyncDeviceHandler_CodeValidated; this.SyncDeviceHandler.SetAdapter(this.Adapter); this.SyncDeviceHandler.SetDevice(this.Device); this.SyncDeviceHandler.SetWebService(this.WebService); this.SyncDeviceHandler.SetUserInformation(UserInformationInstance); this.SyncDeviceHandler.SetApplicationInformation(ApplicationInfoInstance); e.Device.ServicesDiscovered += Services_Discovered; //this.Adapter.CommandResponse += SyncDeviceHandler.ReceiveResponse; e.Device.DiscoverServices(); }