Class SensorScanSettings

java.lang.Object
com.codename1.health.sensors.SensorScanSettings

public final class SensorScanSettings extends Object
Which sensors to look for and for how long.
  • Constructor Details

    • SensorScanSettings

      public SensorScanSettings()
  • Method Details

    • addProfile

      public SensorScanSettings addProfile(HealthSensorProfile profile)
      Looks for devices advertising this profile. Add several to scan for more than one kind at once; adding none scans for every profile this framework understands.
    • getProfiles

      public List<HealthSensorProfile> getProfiles()
      The profiles being scanned for, empty meaning all of them.
    • setTimeout

      public SensorScanSettings setTimeout(Duration value)

      How long to scan before giving up.

      The

      invalid reference
      Duration
      form of setTimeoutMillis(int), which is the type the rest of

      the framework speaks; the millis form stays for the ports and the wire format.

    • getTimeout

      public Duration getTimeout()

      How long to scan before giving up, as a

      invalid reference
      Duration
      .
    • setTimeoutMillis

      public SensorScanSettings setTimeoutMillis(int timeoutMillis)
    • getTimeoutMillis

      public int getTimeoutMillis()
      The scan timeout in milliseconds.
    • setLowPower

      public SensorScanSettings setLowPower(boolean lowPower)
      Scans at a lower duty cycle, trading discovery latency for battery. Worth setting when scanning in the background or for a long time.
    • isLowPower

      public boolean isLowPower()
      true when a low-power scan was requested.