Class ScanSettings

java.lang.Object
com.codename1.bluetooth.le.ScanSettings

public class ScanSettings extends Object
Options for a BLE scan started via BluetoothLE.startScan(ScanSettings, ScanListener). Fluent setters return this for chaining.
  • Constructor Details

    • ScanSettings

      public ScanSettings()
  • Method Details

    • setScanMode

      public ScanSettings setScanMode(ScanMode mode)
      The power/latency trade-off; defaults to ScanMode.BALANCED.
    • setAllowDuplicates

      public ScanSettings setAllowDuplicates(boolean allow)
      When false (the default) each device is reported once per scan; when true every advertisement sighting is reported -- required for RSSI tracking and beacon monitoring.
    • addFilter

      public ScanSettings addFilter(ScanFilter filter)
      Adds a filter; multiple filters are OR-combined. A scan without filters reports every advertising device.
    • getScanMode

      public ScanMode getScanMode()
      The configured scan mode.
    • isAllowDuplicates

      public boolean isAllowDuplicates()
      Whether duplicate sightings are reported.
    • getFilters

      public List<ScanFilter> getFilters()
      The filters added via addFilter(ScanFilter); empty means match-all.
    • matches

      public boolean matches(ScanResult result)
      true when the given result passes this settings object's filter set (no filters == match all). Used by the core scan demultiplexer.