# Class HealthSensorProfile

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

public final class HealthSensorProfile extends Object

A standard Bluetooth SIG health sensor profile -- the service a device advertises and the measurements it produces.

These are the adopted profiles, so any conforming device works without per-vendor code: a heart-rate strap from any manufacturer speaks `0x180D`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final HealthSensorProfile`
  `BLOOD_PRESSURE`
  Blood Pressure, service `0x1810`.
  `static final HealthSensorProfile`
  `CYCLING_POWER`
  Cycling Power, service `0x1818`.
  `static final HealthSensorProfile`
  `CYCLING_SPEED_CADENCE`
  Cycling Speed and Cadence, service `0x1816`.
  `static final HealthSensorProfile`
  `GLUCOSE`
  Glucose, service `0x1808`.
  `static final HealthSensorProfile`
  `HEALTH_THERMOMETER`
  Health Thermometer, service `0x1809`.
  `static final HealthSensorProfile`
  `HEART_RATE`
  Heart Rate, service `0x180D`.
  `static final HealthSensorProfile`
  `RUNNING_SPEED_CADENCE`
  Running Speed and Cadence, service `0x1814`.
  `static final HealthSensorProfile`
  `WEIGHT_SCALE`
  Weight Scale, service `0x181D`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BluetoothUuid`
  `getMeasurementUuid()`
  The characteristic carrying this profile's measurements.
  `String`
  `getName()`
  The profile's human-readable name.
  `List<HealthDataType>`
  `getProducedTypes()`
  The health data types a session with this profile can produce.
  `BluetoothUuid`
  `getServiceUuid()`
  The GATT service UUID a conforming device advertises.
  `boolean`
  `isStreaming()`
  `true` for profiles that notify continuously -- heart rate, power, cadence.
  `String`
  `toString()`
  Returns a string representation of the object.
  `static List<HealthSensorProfile>`
  `values()`
  Every profile this framework understands.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### HEART_RATE

    public static final HealthSensorProfile HEART_RATE
    Heart Rate, service `0x180D`. Streams heart rate and, on most straps, RR intervals for heart-rate variability.

  - ### CYCLING_POWER

    public static final HealthSensorProfile CYCLING_POWER
    Cycling Power, service `0x1818`. Streams power and, when the meter reports crank data, cadence.

  - ### CYCLING_SPEED_CADENCE

    public static final HealthSensorProfile CYCLING_SPEED_CADENCE

    Cycling Speed and Cadence, service `0x1816`. Streams derived speed and cadence -- the raw characteristic carries cumulative counters, which `SensorSession` differences for you. Cycling Speed and Cadence, service `0x1816`.

    Only cadence is produced. Speed would need a wheel circumference the profile does not carry, and guessing a tyre size scales every distance the app derives -- so the wheel block is decoded and discarded rather than published. Advertising SPEED here left apps waiting forever for a sample that never came.

  - ### RUNNING_SPEED_CADENCE

    public static final HealthSensorProfile RUNNING_SPEED_CADENCE
    Running Speed and Cadence, service `0x1814`. Streams speed and step cadence from a foot pod.

  - ### HEALTH_THERMOMETER

    public static final HealthSensorProfile HEALTH_THERMOMETER
    Health Thermometer, service `0x1809`. Reports one measurement at a time rather than streaming.

  - ### WEIGHT_SCALE

    public static final HealthSensorProfile WEIGHT_SCALE
    Weight Scale, service `0x181D`. Reports one measurement per weighing.

  - ### BLOOD_PRESSURE

    public static final HealthSensorProfile BLOOD_PRESSURE
    Blood Pressure, service `0x1810`. Reports one measurement per inflation cycle.

  - ### GLUCOSE

    public static final HealthSensorProfile GLUCOSE
    Glucose, service `0x1808`. Reports a measurement when the user tests, and can replay stored records -- see `SensorSession.requestStoredRecords(GlucoseRecordFilter)`.

- ## Method Details

  - ### getName

    public String getName()
    The profile's human-readable name.

  - ### getServiceUuid

    public BluetoothUuid getServiceUuid()
    The GATT service UUID a conforming device advertises.

  - ### getMeasurementUuid

    public BluetoothUuid getMeasurementUuid()
    The characteristic carrying this profile's measurements.

  - ### getProducedTypes

    public List<HealthDataType> getProducedTypes()
    The health data types a session with this profile can produce.

  - ### isStreaming

    public boolean isStreaming()

    `true` for profiles that notify continuously -- heart rate, power, cadence. `false` for episodic ones that report a single reading per measurement, such as a scale or a blood-pressure cuff.

    Worth branching on in UI: a streaming sensor should show a live value, while an episodic one should show "waiting for a measurement" until the user actually takes one.

  - ### values

    public static List<HealthSensorProfile> values()
    Every profile this framework understands.

  - ### 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`