java.lang.Object | |
↳ | android.bluetooth.le.BluetoothLeScanner |
This class provides methods to perform scan related operations for Bluetooth LE devices. An
application can scan for a particular type of Bluetotoh LE devices using ScanFilter
. It
can also request different types of callbacks for delivering the result.
Use getBluetoothLeScanner()
to get an instance of
BluetoothLeScanner
.
Note: Most of the scan methods here require
BLUETOOTH_ADMIN
permission.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Flush pending batch scan results stored in Bluetooth controller.
| |||||||||||
Start Bluetooth LE scan.
| |||||||||||
Start Bluetooth LE scan with default parameters and no filters.
| |||||||||||
Stops an ongoing Bluetooth LE scan.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Flush pending batch scan results stored in Bluetooth controller. This will return Bluetooth
LE scan results batched on bluetooth controller. Returns immediately, batch scan results data
will be delivered through the callback
.
callback | Callback of the Bluetooth LE Scan, it has to be the same instance as the one used to start scan. |
---|
Start Bluetooth LE scan. The scan results will be delivered through callback
.
Requires BLUETOOTH_ADMIN
permission.
filters | ScanFilter s for finding exact BLE devices. |
---|---|
settings | Settings for the scan. |
callback | Callback used to deliver scan results. |
IllegalArgumentException | If settings or callback is null.
|
---|
Start Bluetooth LE scan with default parameters and no filters. The scan results will be
delivered through callback
.
Requires BLUETOOTH_ADMIN
permission.
callback | Callback used to deliver scan results. |
---|
IllegalArgumentException | If callback is null.
|
---|
Stops an ongoing Bluetooth LE scan.
Requires BLUETOOTH_ADMIN
permission.