t.21.120.2.source-code.RespirationRateMesg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fit Show documentation
Show all versions of fit Show documentation
The Official Garmin FIT SDK
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2023 Garmin International, Inc.
// Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
// may not use this file except in compliance with the Flexible and Interoperable Data
// Transfer (FIT) Protocol License.
/////////////////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.120Release
// Tag = production/release/21.120.00-0-g2d77811
/////////////////////////////////////////////////////////////////////////////////////////////
package com.garmin.fit;
public class RespirationRateMesg extends Mesg {
public static final int TimestampFieldNum = 253;
public static final int RespirationRateFieldNum = 0;
protected static final Mesg respirationRateMesg;
static {
// respiration_rate
respirationRateMesg = new Mesg("respiration_rate", MesgNum.RESPIRATION_RATE);
respirationRateMesg.addField(new Field("timestamp", TimestampFieldNum, 134, 1, 0, "", false, Profile.Type.DATE_TIME));
respirationRateMesg.addField(new Field("respiration_rate", RespirationRateFieldNum, 131, 100, 0, "breaths/min", false, Profile.Type.SINT16));
}
public RespirationRateMesg() {
super(Factory.createMesg(MesgNum.RESPIRATION_RATE));
}
public RespirationRateMesg(final Mesg mesg) {
super(mesg);
}
/**
* Get timestamp field
*
* @return timestamp
*/
public DateTime getTimestamp() {
return timestampToDateTime(getFieldLongValue(253, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD));
}
/**
* Set timestamp field
*
* @param timestamp The new timestamp value to be set
*/
public void setTimestamp(DateTime timestamp) {
setFieldValue(253, 0, timestamp.getTimestamp(), Fit.SUBFIELD_INDEX_MAIN_FIELD);
}
/**
* Get respiration_rate field
* Units: breaths/min
* Comment: Breaths * 100 /min, -300 indicates invalid, -200 indicates large motion, -100 indicates off wrist
*
* @return respiration_rate
*/
public Float getRespirationRate() {
return getFieldFloatValue(0, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
}
/**
* Set respiration_rate field
* Units: breaths/min
* Comment: Breaths * 100 /min, -300 indicates invalid, -200 indicates large motion, -100 indicates off wrist
*
* @param respirationRate The new respirationRate value to be set
*/
public void setRespirationRate(Float respirationRate) {
setFieldValue(0, 0, respirationRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
}
}