Aracılığıyla paylaş


BluetoothLeScanner.StartScan Method

Definition

Overloads

StartScan(ScanCallback)

Start Bluetooth LE scan with default parameters and no filters.

StartScan(IList<ScanFilter>, ScanSettings, PendingIntent)

Start Bluetooth LE scan using a PendingIntent.

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

Java documentation for android.bluetooth.le.BluetoothLeScanner.startScan(android.bluetooth.le.ScanCallback).

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

Java documentation for android.bluetooth.le.BluetoothLeScanner.startScan(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.app.PendingIntent).

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>

ScanFilters for finding exact BLE devices.

settings
ScanSettings

Settings for the scan.

callback
ScanCallback

Callback used to deliver scan results.

Attributes

Remarks

Java documentation for android.bluetooth.le.BluetoothLeScanner.startScan(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback).

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