Packages

A high-performance Elixir library for decoding Garmin .fit files using a C++ NIF.

Current section

Files

Jump to
fit_decoder c_src fit_sdk cpp fit_training_settings_mesg.hpp
Raw

c_src/fit_sdk/cpp/fit_training_settings_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_TRAINING_SETTINGS_MESG_HPP)
#define FIT_TRAINING_SETTINGS_MESG_HPP
#include "fit_mesg.hpp"
namespace fit
{
class TrainingSettingsMesg : public Mesg
{
public:
class FieldDefNum final
{
public:
static const FIT_UINT8 TargetDistance = 31;
static const FIT_UINT8 TargetSpeed = 32;
static const FIT_UINT8 TargetTime = 33;
static const FIT_UINT8 PreciseTargetSpeed = 153;
static const FIT_UINT8 Invalid = FIT_FIELD_NUM_INVALID;
};
TrainingSettingsMesg(void) : Mesg(Profile::MESG_TRAINING_SETTINGS)
{
}
TrainingSettingsMesg(const Mesg &mesg) : Mesg(mesg)
{
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of target_distance field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsTargetDistanceValid() const
{
const Field* field = GetField(31);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns target_distance field
// Units: m
///////////////////////////////////////////////////////////////////////
FIT_FLOAT32 GetTargetDistance(void) const
{
return GetFieldFLOAT32Value(31, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set target_distance field
// Units: m
///////////////////////////////////////////////////////////////////////
void SetTargetDistance(FIT_FLOAT32 targetDistance)
{
SetFieldFLOAT32Value(31, targetDistance, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of target_speed field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsTargetSpeedValid() const
{
const Field* field = GetField(32);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns target_speed field
// Units: m/s
///////////////////////////////////////////////////////////////////////
FIT_FLOAT32 GetTargetSpeed(void) const
{
return GetFieldFLOAT32Value(32, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set target_speed field
// Units: m/s
///////////////////////////////////////////////////////////////////////
void SetTargetSpeed(FIT_FLOAT32 targetSpeed)
{
SetFieldFLOAT32Value(32, targetSpeed, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of target_time field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsTargetTimeValid() const
{
const Field* field = GetField(33);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns target_time field
// Units: s
///////////////////////////////////////////////////////////////////////
FIT_UINT32 GetTargetTime(void) const
{
return GetFieldUINT32Value(33, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set target_time field
// Units: s
///////////////////////////////////////////////////////////////////////
void SetTargetTime(FIT_UINT32 targetTime)
{
SetFieldUINT32Value(33, targetTime, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of precise_target_speed field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsPreciseTargetSpeedValid() const
{
const Field* field = GetField(153);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid();
}
///////////////////////////////////////////////////////////////////////
// Returns precise_target_speed field
// Units: m/s
// Comment: A more precise target speed field
///////////////////////////////////////////////////////////////////////
FIT_FLOAT32 GetPreciseTargetSpeed(void) const
{
return GetFieldFLOAT32Value(153, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set precise_target_speed field
// Units: m/s
// Comment: A more precise target speed field
///////////////////////////////////////////////////////////////////////
void SetPreciseTargetSpeed(FIT_FLOAT32 preciseTargetSpeed)
{
SetFieldFLOAT32Value(153, preciseTargetSpeed, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
};
} // namespace fit
#endif // !defined(FIT_TRAINING_SETTINGS_MESG_HPP)