t.21.120.2.source-code.TankUpdateMesg 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 TankUpdateMesg extends Mesg {
public static final int TimestampFieldNum = 253;
public static final int SensorFieldNum = 0;
public static final int PressureFieldNum = 1;
protected static final Mesg tankUpdateMesg;
static {
// tank_update
tankUpdateMesg = new Mesg("tank_update", MesgNum.TANK_UPDATE);
tankUpdateMesg.addField(new Field("timestamp", TimestampFieldNum, 134, 1, 0, "s", false, Profile.Type.DATE_TIME));
tankUpdateMesg.addField(new Field("sensor", SensorFieldNum, 140, 1, 0, "", false, Profile.Type.ANT_CHANNEL_ID));
tankUpdateMesg.addField(new Field("pressure", PressureFieldNum, 132, 100, 0, "bar", false, Profile.Type.UINT16));
}
public TankUpdateMesg() {
super(Factory.createMesg(MesgNum.TANK_UPDATE));
}
public TankUpdateMesg(final Mesg mesg) {
super(mesg);
}
/**
* Get timestamp field
* Units: s
*
* @return timestamp
*/
public DateTime getTimestamp() {
return timestampToDateTime(getFieldLongValue(253, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD));
}
/**
* Set timestamp field
* Units: s
*
* @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 sensor field
*
* @return sensor
*/
public Long getSensor() {
return getFieldLongValue(0, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
}
/**
* Set sensor field
*
* @param sensor The new sensor value to be set
*/
public void setSensor(Long sensor) {
setFieldValue(0, 0, sensor, Fit.SUBFIELD_INDEX_MAIN_FIELD);
}
/**
* Get pressure field
* Units: bar
*
* @return pressure
*/
public Float getPressure() {
return getFieldFloatValue(1, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
}
/**
* Set pressure field
* Units: bar
*
* @param pressure The new pressure value to be set
*/
public void setPressure(Float pressure) {
setFieldValue(1, 0, pressure, Fit.SUBFIELD_INDEX_MAIN_FIELD);
}
}