no.nordicsemi.android.ble.common.profile.bp.IntermediateCuffPressureCallback Java Examples

The following examples show how to use no.nordicsemi.android.ble.common.profile.bp.IntermediateCuffPressureCallback. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BPMActivity.java    From Android-nRF-Toolbox with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void onIntermediateCuffPressureReceived(@NonNull final BluetoothDevice device, final float cuffPressure, final int unit,
											   @Nullable final Float pulseRate, @Nullable final Integer userID,
											   @Nullable final BPMStatus status, @Nullable final Calendar calendar) {
	runOnUiThread(() -> {
		systolicView.setText(String.valueOf(cuffPressure));
		diastolicView.setText(R.string.not_available_value);
		meanAPView.setText(R.string.not_available_value);
		if (pulseRate != null)
			pulseView.setText(String.valueOf(pulseRate));
		else
			pulseView.setText(R.string.not_available_value);
		if (calendar != null)
			timestampView.setText(getString(R.string.bpm_timestamp, calendar));
		else
			timestampView.setText(R.string.not_available);

		systolicUnitView.setText(unit == IntermediateCuffPressureCallback.UNIT_mmHg ? R.string.bpm_unit_mmhg : R.string.bpm_unit_kpa);
		diastolicUnitView.setText(null);
		meanAPUnitView.setText(null);
	});
}