BluetoothLeScanner.StartScan Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
StartScan(ScanCallback) |
Start Bluetooth LE scan with default parameters and no filters. |
StartScan(IList<ScanFilter>, ScanSettings, PendingIntent) |
Start Bluetooth LE scan using a |
StartScan(IList<ScanFilter>, ScanSettings, ScanCallback) |
Start Bluetooth LE scan. |
StartScan(ScanCallback)
Start Bluetooth LE scan with default parameters and no filters.
[Android.Runtime.Register("startScan", "(Landroid/bluetooth/le/ScanCallback;)V", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")]
public void StartScan (Android.Bluetooth.LE.ScanCallback? callback);
[<Android.Runtime.Register("startScan", "(Landroid/bluetooth/le/ScanCallback;)V", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")>]
member this.StartScan : Android.Bluetooth.LE.ScanCallback -> unit
Parameters
- callback
- ScanCallback
Callback used to deliver scan results.
- Attributes
Exceptions
If callback
is null.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
StartScan(IList<ScanFilter>, ScanSettings, PendingIntent)
Start Bluetooth LE scan using a PendingIntent
.
[Android.Runtime.Register("startScan", "(Ljava/util/List;Landroid/bluetooth/le/ScanSettings;Landroid/app/PendingIntent;)I", "", ApiSince=26)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")]
public int StartScan (System.Collections.Generic.IList<Android.Bluetooth.LE.ScanFilter>? filters, Android.Bluetooth.LE.ScanSettings? settings, Android.App.PendingIntent callbackIntent);
[<Android.Runtime.Register("startScan", "(Ljava/util/List;Landroid/bluetooth/le/ScanSettings;Landroid/app/PendingIntent;)I", "", ApiSince=26)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")>]
member this.StartScan : System.Collections.Generic.IList<Android.Bluetooth.LE.ScanFilter> * Android.Bluetooth.LE.ScanSettings * Android.App.PendingIntent -> int
Parameters
- filters
- IList<ScanFilter>
Optional list of ScanFilters for finding exact BLE devices.
- settings
- ScanSettings
Optional settings for the scan.
- callbackIntent
- PendingIntent
The PendingIntent to deliver the result to.
Returns
Returns 0 for success or an error code from ScanCallback
if the scan request
could not be sent.
- Attributes
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
StartScan(IList<ScanFilter>, ScanSettings, ScanCallback)
Start Bluetooth LE scan.
[Android.Runtime.Register("startScan", "(Ljava/util/List;Landroid/bluetooth/le/ScanSettings;Landroid/bluetooth/le/ScanCallback;)V", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")]
public void StartScan (System.Collections.Generic.IList<Android.Bluetooth.LE.ScanFilter>? filters, Android.Bluetooth.LE.ScanSettings? settings, Android.Bluetooth.LE.ScanCallback? callback);
[<Android.Runtime.Register("startScan", "(Ljava/util/List;Landroid/bluetooth/le/ScanSettings;Landroid/bluetooth/le/ScanCallback;)V", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")>]
member this.StartScan : System.Collections.Generic.IList<Android.Bluetooth.LE.ScanFilter> * Android.Bluetooth.LE.ScanSettings * Android.Bluetooth.LE.ScanCallback -> unit
Parameters
- filters
- IList<ScanFilter>
ScanFilter
s for finding exact BLE devices.
- settings
- ScanSettings
Settings for the scan.
- callback
- ScanCallback
Callback used to deliver scan results.
- Attributes
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.