Packages
fit_decoder
0.1.0
A high-performance Elixir library for decoding Garmin .fit files using a C++ NIF.
Current section
Files
Jump to
Current section
Files
c_src/fit_sdk/cpp/fit_tank_update_mesg.hpp
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2025 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.171.0Release
// Tag = production/release/21.171.0-0-g57fed75
/////////////////////////////////////////////////////////////////////////////////////////////
#if !defined(FIT_TANK_UPDATE_MESG_HPP)
#define FIT_TANK_UPDATE_MESG_HPP
#include "fit_mesg.hpp"
namespace fit
{
class TankUpdateMesg : public Mesg
{
public:
class FieldDefNum final
{
public:
static const FIT_UINT8 Timestamp = 253;
static const FIT_UINT8 Sensor = 0;
static const FIT_UINT8 Pressure = 1;
static const FIT_UINT8 Invalid = FIT_FIELD_NUM_INVALID;
};
TankUpdateMesg(void) : Mesg(Profile::MESG_TANK_UPDATE)
{
}
TankUpdateMesg(const Mesg &mesg) : Mesg(mesg)
{
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of timestamp field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsTimestampValid() const
{
const Field* field = GetField(253);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns timestamp field
// Units: s
///////////////////////////////////////////////////////////////////////
FIT_DATE_TIME GetTimestamp(void) const
{
return GetFieldUINT32Value(253, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set timestamp field
// Units: s
///////////////////////////////////////////////////////////////////////
void SetTimestamp(FIT_DATE_TIME timestamp)
{
SetFieldUINT32Value(253, timestamp, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of sensor field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsSensorValid() const
{
const Field* field = GetField(0);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns sensor field
///////////////////////////////////////////////////////////////////////
FIT_ANT_CHANNEL_ID GetSensor(void) const
{
return GetFieldUINT32ZValue(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set sensor field
///////////////////////////////////////////////////////////////////////
void SetSensor(FIT_ANT_CHANNEL_ID sensor)
{
SetFieldUINT32ZValue(0, sensor, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of pressure field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsPressureValid() const
{
const Field* field = GetField(1);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns pressure field
// Units: bar
///////////////////////////////////////////////////////////////////////
FIT_FLOAT32 GetPressure(void) const
{
return GetFieldFLOAT32Value(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set pressure field
// Units: bar
///////////////////////////////////////////////////////////////////////
void SetPressure(FIT_FLOAT32 pressure)
{
SetFieldFLOAT32Value(1, pressure, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
};
} // namespace fit
#endif // !defined(FIT_TANK_UPDATE_MESG_HPP)