Android APIs
public abstract class

ScanCallback

extends Object
java.lang.Object
   ↳ android.bluetooth.le.ScanCallback

Class Overview

Callback of Bluetooth LE scans. The results of the scans will be delivered through the callbacks.

Summary

Constants
int SCAN_FAILED_ALREADY_STARTED Fails to start scan as BLE scan with the same settings is already started by the app.
int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED Fails to start scan as app cannot be registered.
int SCAN_FAILED_CONTROLLER_FAILURE Fails to start scan due to controller failure.
int SCAN_FAILED_GATT_SERVICE_FAILURE Fails to start scan due to gatt service failure.
Public Constructors
ScanCallback()
Public Methods
abstract void onAdvertisementUpdate(ScanResult result)
Callback when a BLE advertisement is found.
abstract void onScanFailed(int errorCode)
Callback when scan failed.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int SCAN_FAILED_ALREADY_STARTED

Fails to start scan as BLE scan with the same settings is already started by the app.

Constant Value: 1 (0x00000001)

public static final int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED

Fails to start scan as app cannot be registered.

Constant Value: 2 (0x00000002)

public static final int SCAN_FAILED_CONTROLLER_FAILURE

Fails to start scan due to controller failure.

Constant Value: 4 (0x00000004)

public static final int SCAN_FAILED_GATT_SERVICE_FAILURE

Fails to start scan due to gatt service failure.

Constant Value: 3 (0x00000003)

Public Constructors

public ScanCallback ()

Public Methods

public abstract void onAdvertisementUpdate (ScanResult result)

Callback when a BLE advertisement is found.

Parameters
result A Bluetooth LE scan result.

public abstract void onScanFailed (int errorCode)

Callback when scan failed.