public final class SensorScanSettings

  1. Object
  2. SensorScanSettings
Which sensors to look for and for how long.

Constructors

public SensorScanSettings()

Methods

public SensorScanSettings addProfile(HealthSensorProfile profile)Looks for devices advertising this profile.
public List<HealthSensorProfile> getProfiles()The profiles being scanned for, empty meaning all of them.
public SensorScanSettings setTimeout(Duration value)How long to scan before giving up.
public Duration getTimeout()How long to scan before giving up, as a Duration.
public SensorScanSettings setTimeoutMillis(int timeoutMillis)
public int getTimeoutMillis()The scan timeout in milliseconds.
public SensorScanSettings setLowPower(boolean lowPower)Scans at a lower duty cycle, trading discovery latency for battery.
public boolean isLowPower()true when a low-power scan was requested.

Inherited methods

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 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 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.