Class RscMeasurement
java.lang.Object
com.codename1.health.sensors.RscMeasurement
A decoded Running Speed and Cadence Measurement, characteristic
0x2A53.
Wire format
A flags byte -- bit 0 stride length present, bit 1 total distance
present, bit 2 running rather than walking -- then a uint16 speed and
a uint8 cadence, then the optional fields.
Cadence is in steps per minute, not strides
The profile transmits steps, so a runner at a typical 90 strides
per minute reports 180. Foot pods differ in which they display, and
halving the value to get strides is a decision for your UI, not
something this parser does silently. getStrideRatePerMinute() is
provided for when you want the other convention explicitly.
Speed arrives in 1/256 m/s and total distance in tenths of a metre.
-
Method Summary
Modifier and TypeMethodDescriptionintCadence in steps per minute, as transmitted.doubleInstantaneous speed in metres per second.doubleStride length in metres, orDouble.NaNwhen absent.doubleCadence expressed in strides per minute -- half the step rate.doubleCumulative distance in metres since the pod powered on, orDouble.NaNwhen absent.booleantruewhen the pod classified the motion as running rather than walking.static RscMeasurementparse(byte[] value) Decodes a0x2A53value.toString()Returns a string representation of the object.
-
Method Details
-
parse
Decodes a0x2A53value. Returnsnullfor a malformed or truncated payload; never throws. -
getSpeedMetersPerSecond
public double getSpeedMetersPerSecond()Instantaneous speed in metres per second. -
getCadenceStepsPerMinute
public int getCadenceStepsPerMinute()Cadence in steps per minute, as transmitted. -
getStrideRatePerMinute
public double getStrideRatePerMinute()Cadence expressed in strides per minute -- half the step rate. Provided so the conversion is explicit at the call site rather than guessed. -
getStrideLengthMeters
public double getStrideLengthMeters()Stride length in metres, orDouble.NaNwhen absent. -
getTotalDistanceMeters
public double getTotalDistanceMeters()Cumulative distance in metres since the pod powered on, orDouble.NaNwhen absent. -
isRunning
public boolean isRunning()truewhen the pod classified the motion as running rather than walking. -
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())
-