public final class HealthSensorProfile

  1. Object
  2. HealthSensorProfile

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.

Fields

public static final HealthSensorProfile HEART_RATEHeart Rate, service 0x180D.
public static final HealthSensorProfile CYCLING_POWERCycling Power, service 0x1818.
public static final HealthSensorProfile CYCLING_SPEED_CADENCECycling Speed and Cadence, service 0x1816.
public static final HealthSensorProfile RUNNING_SPEED_CADENCERunning Speed and Cadence, service 0x1814.
public static final HealthSensorProfile HEALTH_THERMOMETERHealth Thermometer, service 0x1809.
public static final HealthSensorProfile WEIGHT_SCALEWeight Scale, service 0x181D.
public static final HealthSensorProfile BLOOD_PRESSUREBlood Pressure, service 0x1810.
public static final HealthSensorProfile GLUCOSEGlucose, service 0x1808.

Methods

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

Inherited methods

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()
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())