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_hrv_mesg.hpp
Raw

c_src/fit_sdk/cpp/fit_hrv_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_HRV_MESG_HPP)
#define FIT_HRV_MESG_HPP
#include "fit_mesg.hpp"
namespace fit
{
class HrvMesg : public Mesg
{
public:
class FieldDefNum final
{
public:
static const FIT_UINT8 Time = 0;
static const FIT_UINT8 Invalid = FIT_FIELD_NUM_INVALID;
};
HrvMesg(void) : Mesg(Profile::MESG_HRV)
{
}
HrvMesg(const Mesg &mesg) : Mesg(mesg)
{
}
///////////////////////////////////////////////////////////////////////
// Returns number of time
///////////////////////////////////////////////////////////////////////
FIT_UINT8 GetNumTime(void) const
{
return GetFieldNumValues(0, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Checks the validity of time field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsTimeValid(FIT_UINT8 index) const
{
const Field* field = GetField(0);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
return field->IsValueValid(index);
}
///////////////////////////////////////////////////////////////////////
// Returns time field
// Units: s
// Comment: Time between beats
///////////////////////////////////////////////////////////////////////
FIT_FLOAT32 GetTime(FIT_UINT8 index) const
{
return GetFieldFLOAT32Value(0, index, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
///////////////////////////////////////////////////////////////////////
// Set time field
// Units: s
// Comment: Time between beats
///////////////////////////////////////////////////////////////////////
void SetTime(FIT_UINT8 index, FIT_FLOAT32 time)
{
SetFieldFLOAT32Value(0, time, index, FIT_SUBFIELD_INDEX_MAIN_FIELD);
}
};
} // namespace fit
#endif // !defined(FIT_HRV_MESG_HPP)