public enum SensorWorn {
UNSUPPORTED, WORN, NOT_WORN
}
public HeartRateMeasurement(byte[] value) {
GattByteBuffer bb = GattByteBuffer.wrap(value);
byte flags = bb.getInt8();
if (isHeartRateInUINT16(flags)) {
hrmval = bb.getUint16();
} else {
hrmval = bb.getUint8();
}
if (isWornStatusPresent(flags)) {
if (isSensorWorn(flags)) {
sensorWorn = SensorWorn.WORN;
} else {
sensorWorn = SensorWorn.NOT_WORN;
}
}
if (isEePresent(flags)) {
eeval = bb.getUint16();
}
if (isRrIntPresent(flags)) {
while (bb.hasRemaining()) {
rrIntervals.add(bb.getUint16() / 1024F);
}
}
}