Exemplo n.º 1
0
        public SelectedDevice(ScanResults scanResult)
        {
            this.scanResult = scanResult;

            adapter = Plugin.BLE.CrossBluetoothLE.Current.Adapter;
            adapter.ScanTimeoutElapsed += Adapter_ScanTimeoutElapsed;
            StartSearchingDevices();
        }
Exemplo n.º 2
0
        void OnScanResult(IScanResult result, ClientPage clientPage)
        {
            ScanResults resultData        = new ScanResults(result);
            bool        deviceIsOnTheList = false;

            foreach (ScanResults scanResult in devices)
            {
                if (resultData.Uuid == scanResult.Uuid)
                {
                    deviceIsOnTheList = true;
                }
            }

            if (deviceIsOnTheList == false)
            {
                devices.Add(resultData);
            }

            //foreach (ScanResults sc in devices)
            //{
            //    System.Diagnostics.Debug.WriteLine("{0} {1} {2}", sc.Name ?? "", sc.Uuid.ToString() ?? "", sc.Rssi.ToString() ?? "");
            //}
            //System.Diagnostics.Debug.WriteLine("___________________");
        }