Examples of GattByteBuffer


Examples of com.movisens.smartgattlib.GattByteBuffer

  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);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.