Stay organized with collections
Save and categorize content based on your preferences.
LeScanCallback
interface LeScanCallback
Callback interface used to deliver LE scan results.
Summary
Public methods |
abstract Unit |
Callback reporting an LE device found during a device scan initiated by the android.
|
Public methods
onLeScan
abstract fun onLeScan(
device: BluetoothDevice!,
rssi: Int,
scanRecord: ByteArray!
): Unit
Callback reporting an LE device found during a device scan initiated by the android.bluetooth.BluetoothAdapter#startLeScan function.
Parameters |
device |
BluetoothDevice!: Identifies the remote device |
rssi |
Int: The RSSI value for the remote device as reported by the Bluetooth hardware. 0 if no RSSI value is available. |
scanRecord |
ByteArray!: The content of the advertisement record offered by the remote device. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# BluetoothAdapter.LeScanCallback\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nLeScanCallback\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/bluetooth/BluetoothAdapter.LeScanCallback \"View this page in Java\") \n\n```\ninterface LeScanCallback\n```\n\n|--------------------------------------------------------|\n| [android.bluetooth.BluetoothAdapter.LeScanCallback](#) |\n\nCallback interface used to deliver LE scan results.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onLeScan](#onLeScan(android.bluetooth.BluetoothDevice,%20kotlin.Int,%20kotlin.ByteArray))`(`device:` `[BluetoothDevice](/reference/kotlin/android/bluetooth/BluetoothDevice)!`, `rssi:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `scanRecord:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`)` Callback reporting an LE device found during a device scan initiated by the android. |\n\nPublic methods\n--------------\n\n### onLeScan\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onLeScan(\n device: BluetoothDevice!, \n rssi: Int, \n scanRecord: ByteArray!\n): Unit\n```\n\nCallback reporting an LE device found during a device scan initiated by the android.bluetooth.BluetoothAdapter#startLeScan function.\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `device` | [BluetoothDevice](/reference/kotlin/android/bluetooth/BluetoothDevice)!: Identifies the remote device |\n| `rssi` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The RSSI value for the remote device as reported by the Bluetooth hardware. 0 if no RSSI value is available. |\n| `scanRecord` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!: The content of the advertisement record offered by the remote device. |"]]