Class HealthSensor

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

public final class HealthSensor extends Object
A discovered health sensor: what it is, what it advertises, and how strong its signal was.
  • Method Details

    • getId

      public String getId()

      A stable identifier for this device.

      Persist it and pass it to HealthSensors.connect(String,HealthSensorProfile,SensorSessionOptions) to reconnect to the user's own strap on a later launch without making them pick it out of a scan list again.

      The value is platform-scoped: a MAC address on Android and an opaque per-installation UUID on iOS. It is stable on one device but meaningless on another, so do not sync it between a user's phone and tablet.

    • getName

      public String getName()
      The advertised device name, or null.
    • getProfiles

      public List<HealthSensorProfile> getProfiles()
      The health profiles this device advertised. A dual-purpose device such as a bike computer may report several.
    • getRssi

      public int getRssi()
      The received signal strength in dBm at discovery. Useful for sorting a picker so the strap the user is wearing appears first.
    • supports

      public boolean supports(HealthSensorProfile profile)
      true when this device advertised profile.
    • toString

      public String toString()
      Description copied from class: Object
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object