Table of Contents

Class ScanningOptions

Namespace
Bluetooth.Abstractions.Scanning.Options
Assembly
Bluetooth.Abstractions.Scanning.dll

Represents Bluetooth scanner configuration options.

public record ScanningOptions : IEquatable<ScanningOptions>
Inheritance
ScanningOptions
Implements
Derived
Inherited Members

Properties

AdvertisementFilter

Advertisement filter. If set, only advertisements that pass the filter will be processed.

public Func<IBluetoothAdvertisement, bool>? AdvertisementFilter { get; init; }

Property Value

Func<IBluetoothAdvertisement, bool>

Remarks

When null (default), all advertisements are accepted. When set, only advertisements where the filter returns true are processed.

Android

Gets the Android platform-specific scanning options.

public object? Android { get; init; }

Property Value

object

Remarks

Should be an instance of Bluetooth.Abstractions.Scanning.Options.Android.AndroidScanningOptions. These options are only used on Android platforms and are ignored on other platforms.

Provides access to Android-specific scan settings such as:

  • MatchMode: Control aggressive vs sticky matching (API 23+)
  • NumOfMatches: Set advertisement match count before reporting (API 23+)
  • ReportDelay: Batch scan results for power savings (API 23+)
  • Phy: Select Bluetooth 5.0 PHY layers (API 26+)
  • Legacy: Filter for legacy-only advertisements (API 26+)

CallbackType

Gets the callback type that controls when scan results are reported.

public BluetoothScanCallbackType CallbackType { get; init; }

Property Value

BluetoothScanCallbackType

Remarks

Platform Support:

  • Android: Full support via ScanSettings.CallbackType
  • iOS/macOS: All callbacks reported immediately (always FirstMatch behavior)
  • Windows: All callbacks reported immediately (always FirstMatch behavior)

DeviceDisappearTimeout

Gets the inactivity timeout after which a device is considered disappeared.

public TimeSpan? DeviceDisappearTimeout { get; init; }

Property Value

TimeSpan?

Remarks

When null (default), no inactivity-based disappearance handling is applied. When set, devices with no new advertisement for at least this duration are treated according to DeviceDisappearanceBehavior.

DeviceDisappearanceBehavior

Gets how devices should be handled once they exceed DeviceDisappearTimeout.

public BluetoothDeviceDisappearanceBehavior DeviceDisappearanceBehavior { get; init; }

Property Value

BluetoothDeviceDisappearanceBehavior

Remarks

Defaults to MarkAsStale to avoid breaking callers that expect previously discovered devices to remain accessible.

EnableExtendedAdvertising

Gets a value indicating whether to enable extended advertising support (Bluetooth 5.0+). Extended advertising provides larger payloads and additional features.

public bool EnableExtendedAdvertising { get; init; }

Property Value

bool

Remarks

Platform Support:

  • Android: Supported on Android 8.0 (API 26+) with Bluetooth 5.0 hardware
  • iOS/macOS: Automatically supported on devices with Bluetooth 5.0
  • Windows: Supported on Windows 10 version 2004+ with Bluetooth 5.0 adapter

IgnoreDuplicateAdvertisements

Gets a value indicating whether duplicate advertisements should be ignored.

public bool IgnoreDuplicateAdvertisements { get; init; }

Property Value

bool

IgnoreNamelessAdvertisements

Gets a value indicating whether advertisements without a local name should be ignored.

public bool IgnoreNamelessAdvertisements { get; init; }

Property Value

bool

PermissionStrategy

Gets the permission request strategy for this scanning operation.

public PermissionRequestStrategy PermissionStrategy { get; init; }

Property Value

PermissionRequestStrategy

Remarks

Defaults to RequestAutomatically which automatically requests permissions before starting the scan if not already granted.

RssiThreshold

Gets the RSSI threshold in dBm for filtering scan results. Devices with RSSI below this threshold will be filtered out. Only applicable when filtering by signal strength.

public int? RssiThreshold { get; init; }

Property Value

int?

Remarks

Platform Support:

  • Android: Not directly supported, filtering performed in software
  • iOS/macOS: Not directly supported, filtering performed in software
  • Windows: Full support via BluetoothLEAdvertisementWatcher.SignalStrengthFilter

Typical values: -100 (very weak) to -30 (very strong)

ScanMode

Gets the scan mode that controls power consumption and scan latency.

public BluetoothScanMode ScanMode { get; init; }

Property Value

BluetoothScanMode

Remarks

Platform Support:

  • Android: Full support via ScanSettings.ScanMode
  • iOS/macOS: Mapped to CBCentralManagerScanOptions (allowDuplicatesKey affects behavior)
  • Windows: Mapped to sampling interval and signal strength filter settings

LowPower: Optimizes for battery life (infrequent scans)

Balanced: Balanced power and latency (default)

LowLatency: Optimizes for fast discovery (frequent scans, higher power consumption)

ScanStartRetry

Gets the retry configuration for scan start operations.

public RetryOptions? ScanStartRetry { get; init; }

Property Value

RetryOptions

Remarks

Retry configuration applied when starting the BLE scanner fails due to transient issues such as adapter busy, scan already started, or throttling errors.

Platform Support:
  • Android: Retries on ScanFailure errors (except AlreadyStarted)
  • iOS/macOS: Retries on CBCentralManager state issues
  • Windows: Retries on scanner start failures

Defaults to Default (3 retries with 200ms delay). Set to None to disable retry logic.

ServiceUuids

Gets the list of service UUIDs to filter during scanning. When set, only devices advertising these services will be discovered.

public IReadOnlyList<Guid>? ServiceUuids { get; init; }

Property Value

IReadOnlyList<Guid>

Remarks

Platform Support:

  • Android: Full support via ScanFilter
  • iOS/macOS: Full support via CBCentralManager scanForPeripherals serviceUUIDs parameter
  • Windows: Filtering performed in software after advertisement received

SignalStrengthJitterSmoothing

Gets the options for smoothing signal strength jitter.

public SignalStrengthSmoothingOptions SignalStrengthJitterSmoothing { get; init; }

Property Value

SignalStrengthSmoothingOptions