Beispiel #1
0
        public void Connect(IDeviceBLE pInput)
        {
            Debug.WriteLine("Connecting to : " + pInput.Id);

            var inputType  = pInput.GetType();
            var searchType = typeof(UnPairedDeviceBLE);

            if (inputType == searchType)
            {
                ConnectionComplete(pInput as UnPairedDeviceBLE);
            }
        }
        public void Connect(IDeviceBLE pInput)
        {
            if (pInput == null)
            {
                return;
            }

            var inputType  = pInput.GetType();
            var searchType = typeof(UnPairedDeviceBLE);

            Device = null;
            if (inputType == searchType)
            {
                //Pair if the device is able to pair
                AcceptRescan     = false;
                ConnectingDevice = pInput;
                Debug.WriteLine("Connecting to new device.");
                mAdapter.ConnectToDeviceAsync((ConnectingDevice as UnPairedDeviceBLE).mDevice).ContinueWith(StopScanning);
            }
        }