예제 #1
0
        private static async Task <BluetoothLEScan> PlatformRequestLEScan(BluetoothLEScanOptions options)
        {
            if (options == null)
            {
                return(new BluetoothLEAdvertisementWatcher());
            }

            return(new BluetoothLEAdvertisementWatcher(options));
        }
예제 #2
0
        internal BluetoothLEScan(BluetoothLEScanOptions options, BluetoothLeScanner scanner)
        {
            _options = options;
            if (options != null)
            {
                _filters = options.Filters;
            }

            //var settings = new ScanSettings.Builder().SetScanMode(ScanMode.LowLatency).Build();

            _callback = new Callback(this);
            _scanner  = scanner;
            scanner.StartScan(_callback);
            Active = true;
        }
예제 #3
0
 public static Task <BluetoothLEScan> RequestLEScanAsync(BluetoothLEScanOptions options = null)
 {
     return(PlatformRequestLEScan(options));
 }
예제 #4
0
 private static async Task <BluetoothLEScan> PlatformRequestLEScan(BluetoothLEScanOptions options)
 {
     return(new BluetoothLEScan(options));
 }
예제 #5
0
 private static async Task <BluetoothLEScan> PlatformRequestLEScan(BluetoothLEScanOptions options)
 {
     return(new BluetoothLEScan(options, _manager.Adapter.BluetoothLeScanner));
 }
예제 #6
0
 private static Task <BluetoothLEScan> PlatformRequestLEScan(BluetoothLEScanOptions options)
 {
     return(Task.FromException <BluetoothLEScan>(new PlatformNotSupportedException()));
 }