class CyclingSpeedAndCadenceMeasurementDataCallback extends ProfileReadResponse implements CyclingSpeedAndCadenceMeasurementCallback, CyclingSpeedAndCadenceCallback {

	@Override
	public void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data) {
		super.onDataReceived(device, data);

		if (data.size() < 1) {
			onInvalidDataReceived(device, data);
			return;
		}

		// Decode the new data
		int offset = 0;
		final int flags = data.getByte(offset);
		offset += 1;

		final boolean wheelRevPresent = (flags & 0x01) != 0;
		final boolean crankRevPreset = (flags & 0x02) != 0;

		if (data.size() < 1 + (wheelRevPresent ? 6 : 0) + (crankRevPreset ? 4 : 0)) {
			onInvalidDataReceived(device, data);
			return;
		}

		if (wheelRevPresent) {
			final long wheelRevolutions = data.getIntValue(Data.FORMAT_UINT32, offset) & 0xFFFFFFFFL;
			offset += 4;

			final int lastWheelEventTime = data.getIntValue(Data.FORMAT_UINT16, offset); // 1/1024 s
			offset += 2;

			if (mInitialWheelRevolutions < 0)
				mInitialWheelRevolutions = wheelRevolutions;

			// Notify listener about the new measurement
			onWheelMeasurementReceived(device, wheelRevolutions, lastWheelEventTime);
		}

		if (crankRevPreset) {
			final int crankRevolutions = data.getIntValue(Data.FORMAT_UINT16, offset);
			offset += 2;

			final int lastCrankEventTime = data.getIntValue(Data.FORMAT_UINT16, offset);
			// offset += 2;

			// Notify listener about the new measurement
			onCrankMeasurementReceived(device, crankRevolutions, lastCrankEventTime);
		}
	}

	public  CyclingSpeedAndCadenceMeasurementDataCallback();
	protected  CyclingSpeedAndCadenceMeasurementDataCallback(final Parcel in);

}