Class HealthSensor
java.lang.Object
com.codename1.health.sensors.HealthSensor
A discovered health sensor: what it is, what it advertises, and how
strong its signal was.
-
Method Summary
Modifier and TypeMethodDescriptiongetId()A stable identifier for this device.getName()The advertised device name, or null.The health profiles this device advertised.intgetRssi()The received signal strength in dBm at discovery.booleansupports(HealthSensorProfile profile) truewhen this device advertisedprofile.toString()Returns a string representation of the object.
-
Method Details
-
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
The advertised device name, or null. -
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
truewhen this device advertisedprofile. -
toString
Description copied from class:ObjectReturns 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())
-