MCPcopy Create free account
hub / github.com/XCSoar/XCSoar / readHeartRateMeasurement

Method readHeartRateMeasurement

android/src/BluetoothSensor.java:139–151  ·  view source on GitHub ↗
(BluetoothGattCharacteristic c)

Source from the content-addressed store, hash-verified

137 }
138
139 private void readHeartRateMeasurement(BluetoothGattCharacteristic c) {
140 int offset = 0;
141 final int flags = c.getIntValue(c.FORMAT_UINT8, offset);
142 ++offset;
143
144 final boolean bpm16 = (flags & 0x1) != 0;
145
146 final int bpm = bpm16
147 ? c.getIntValue(c.FORMAT_UINT16, offset)
148 : c.getIntValue(c.FORMAT_UINT8, offset);
149
150 listener.onHeartRateSensor(bpm);
151 }
152
153 static long toUnsignedLong(int x) {
154 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)

Callers 1

Calls 1

onHeartRateSensorMethod · 0.65

Tested by

no test coverage detected