ScanFailedException

Exception thrown when a Bluetooth Low Energy (BLE) scan operation fails.

This exception is triggered when the system encounters an error while attempting to scan for nearby BLE devices. The exception provides an error code that corresponds to the specific failure reason as defined in Android's Bluetooth scanning API (typically from ScanCallback.SCAN_FAILED_* constants).

Common error codes include:

  • 1: SCAN_FAILED_ALREADY_STARTED

  • 2: SCAN_FAILED_APPLICATION_REGISTRATION_FAILED

  • 3: SCAN_FAILED_INTERNAL_ERROR

  • 4: SCAN_FAILED_FEATURE_UNSUPPORTED

  • 5: SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES

  • 6: SCAN_FAILED_SCANNING_TOO_FREQUENTLY

See also

Constructors

Link copied to clipboard
constructor(errorCode: Int)

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard

The integer error code indicating the reason for scan failure.

Link copied to clipboard
open val message: String?