示例#1
0
        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 static SyncDeviceHandler961 GetInstance()
        {
            if (Instance == null)
            {
                lock (_synclock)
                {
                    if (Instance == null)
                    {
                        Instance = new SyncDeviceHandler961();
                    }
                }
            }

            return(Instance);
        }
示例#3
0
        public static SyncDeviceHandler961 GetInstance()
        {
            if (Instance == null)
            {
                lock (_synclock)
                {
                    if (Instance == null)
                    {
                        Instance = new SyncDeviceHandler961();
                    }
                }
            }

            return Instance;
        }
示例#4
0
        //**********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();
        }