ScanOptions

data class ScanOptions(val mode: ScanMode = ScanMode.LOW_LATENCY, val passive: Boolean = false, val legacyOnly: Boolean = false, val phy: PrimaryPhy? = null)

Android-specific scan options.

Constructors

Link copied to clipboard
constructor(mode: ScanMode = ScanMode.LOW_LATENCY, passive: Boolean = false, legacyOnly: Boolean = false, phy: PrimaryPhy? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether to report only legacy advertisements. By default, extended advertisements are reported as well, if the phone supports them (Android 8+).

Link copied to clipboard

The scan mode, which trades scanning latency for power consumption. Ignored before Android 5.

Link copied to clipboard

Whether to scan passively. A passive scan doesn't send scan requests, so it doesn't get scan responses, which often contain the device name. In return, it uses less power and radio traffic. Available from Android 16 QPR2, ignored on older versions.

Link copied to clipboard

The primary PHY to scan on, or null to scan on all PHYs supported by the phone. Scanning on LE Coded requires Android 8 and a phone that supports it, otherwise the scan fails to start with ScanningFailedToStartException. Ignored when legacyOnly is set, as legacy advertisements are always sent on LE 1M.