ScanSettings class

The ScanSettings class encapsulates options that can be used to configure Bluetooth Low Energy (BLE) scan behavior.

Use this class to specify options like the scan mode, report delay, whether to allow duplicates, and the desired callback type.

On Android 8 (API 26) and above, legacyMode controls whether scanning is restricted to legacy PDUs. Setting it to false (the default when omitted) enables extended advertising, which is necessary to receive scan response data from devices that split their advertisement payload across two packets.

Example usage:

var settings = ScanSettings(scanMode: ScanMode.lowPower, legacyMode: false);

Constructors

ScanSettings({ScanMode? scanMode, int? reportDelayMillis, bool? allowDuplicates, bool? legacyMode})
Constructs a ScanSettings instance with the specified scan settings.

Properties

allowDuplicates bool?
Whether to report only unique advertisements or to include duplicates.
final
hashCode int
The hash code for this object.
no setterinherited
legacyMode bool?
Whether to restrict scanning to legacy BLE advertising PDUs.
final
reportDelayMillis int?
The delay in milliseconds for reporting the scan results.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scanMode ScanMode?
The mode to be used for the BLE scan.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts the ScanSettings instance into a map representation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited