fit

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2015 License: MIT Imports: 15 Imported by: 0

README

fit

license GoDoc Build Status

This library is at the moment very much in flux.

fit is a Go package that implements decoding of the Flexible and Interoperable Data Transfer (FIT) Protocol. Fit is a "compact binary format designed for storing and sharing data from sport, fitness and health devices". Fit files are created by newer GPS enabled Garmin sport watches and cycling computers, such as the Forerunner/Edge/Fenix series.

Current supported FIT SDK version: 16.20

Features
  • Supports all FIT file types.
  • Accessors for scaled fields.
  • Accessors for dynamic fields.
  • Field components expansion.
  • Go code generation for custom FIT product profiles.
Installation
$ go get github.com/tormoder/fit
About fit

Documentation

Overview

Package fit implements decoding of the Flexible and Interoperable Data Transfer (FIT) Protocol. For more information see https://github.com/tormoder/fit.

Example
package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"path/filepath"

	"github.com/tormoder/fit"
)

func main() {
	// Read our FIT test file data
	testFile := filepath.Join("testdata", "fitsdk", "Activity.fit")
	testData, err := ioutil.ReadFile(testFile)
	if err != nil {
		fmt.Println(err)
		return
	}

	// Decode the FIT file data
	fit, err := fit.Decode(bytes.NewReader(testData))
	if err != nil {
		fmt.Println(err)
		return
	}

	// Inspect the TimeCreated field in the FileId message
	fmt.Println(fit.FileId.TimeCreated)

	// Inspect the dynamic Product field in the FileId message
	fmt.Println(fit.FileId.GetProduct())

	// Inspect the FIT file type
	fmt.Println(fit.FileType())

	// Get the actual activity
	activity, err := fit.Activity()
	if err != nil {
		fmt.Println(err)
		return
	}

	// Print the latitude and longitude of the first Record message
	for _, record := range activity.Records {
		fmt.Println(record.PositionLat)
		fmt.Println(record.PositionLong)
		break
	}

	// Print the sport of the first Session message
	for _, session := range activity.Sessions {
		fmt.Println(session.Sport)
		break
	}

}
Output:

2012-04-09 21:22:26 +0000 UTC
Hrm1
Activity
41.51393
-73.14859
Running

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIntegrity

func CheckIntegrity(r io.Reader, headerOnly bool) error

CheckIntegrity verifies the FIT header and file CRC. Only the header CRC is verified if headerOnly is true.

func DecodeHeaderAndFileID

func DecodeHeaderAndFileID(r io.Reader) (*Header, *FileIdMsg, error)

DecodeHeaderAndFileID returns the FIT file header and FileId message without decoding the entire FIT file. The FileId message must be present in all FIT files.

Types

type AccelerometerDataMsg

type AccelerometerDataMsg struct {
}

AccelerometerDataMsg represents the accelerometer_data FIT message type.

type ActivityClass

type ActivityClass byte

ActivityClass represents the activity_class FIT type.

const (
	ActivityClassLevel    ActivityClass = 0x7F // 0 to 100
	ActivityClassLevelMax ActivityClass = 100
	ActivityClassAthlete  ActivityClass = 0x80
	ActivityClassInvalid  ActivityClass = 0xFF
)

func (ActivityClass) String

func (i ActivityClass) String() string

type ActivityFile

type ActivityFile struct {
	Activity *ActivityMsg
	Sessions []*SessionMsg
	Laps     []*LapMsg
	Lengths  []*LengthMsg
	Records  []*RecordMsg
	Events   []*EventMsg
	Hrvs     []*HrvMsg
}

ActivityFile represents the Activity FIT file type. Records sensor data and events from active sessions.

type ActivityLevel

type ActivityLevel byte

ActivityLevel represents the activity_level FIT type.

const (
	ActivityLevelLow     ActivityLevel = 0
	ActivityLevelMedium  ActivityLevel = 1
	ActivityLevelHigh    ActivityLevel = 2
	ActivityLevelInvalid ActivityLevel = 0xFF
)

func (ActivityLevel) String

func (i ActivityLevel) String() string

type ActivityMode

type ActivityMode byte

ActivityMode represents the activity FIT type.

const (
	ActivityModeManual         ActivityMode = 0
	ActivityModeAutoMultiSport ActivityMode = 1
	ActivityModeInvalid        ActivityMode = 0xFF
)

func (ActivityMode) String

func (i ActivityMode) String() string

type ActivityMsg

type ActivityMsg struct {
	Timestamp      time.Time
	TotalTimerTime uint32 // Exclude pauses
	NumSessions    uint16
	Type           ActivityMode
	Event          Event
	EventType      EventType
	LocalTimestamp time.Time // timestamp epoch expressed in local time, used to convert activity timestamps to local time
	EventGroup     uint8
}

ActivityMsg represents the activity FIT message type.

func (*ActivityMsg) GetTotalTimerTimeScaled

func (x *ActivityMsg) GetTotalTimerTimeScaled() float64

GetTotalTimerTimeScaled returns TotalTimerTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

type ActivitySubtype

type ActivitySubtype byte

ActivitySubtype represents the activity_subtype FIT type.

const (
	ActivitySubtypeGeneric       ActivitySubtype = 0
	ActivitySubtypeTreadmill     ActivitySubtype = 1  // Run
	ActivitySubtypeStreet        ActivitySubtype = 2  // Run
	ActivitySubtypeTrail         ActivitySubtype = 3  // Run
	ActivitySubtypeTrack         ActivitySubtype = 4  // Run
	ActivitySubtypeSpin          ActivitySubtype = 5  // Cycling
	ActivitySubtypeIndoorCycling ActivitySubtype = 6  // Cycling
	ActivitySubtypeRoad          ActivitySubtype = 7  // Cycling
	ActivitySubtypeMountain      ActivitySubtype = 8  // Cycling
	ActivitySubtypeDownhill      ActivitySubtype = 9  // Cycling
	ActivitySubtypeRecumbent     ActivitySubtype = 10 // Cycling
	ActivitySubtypeCyclocross    ActivitySubtype = 11 // Cycling
	ActivitySubtypeHandCycling   ActivitySubtype = 12 // Cycling
	ActivitySubtypeTrackCycling  ActivitySubtype = 13 // Cycling
	ActivitySubtypeIndoorRowing  ActivitySubtype = 14 // Fitness Equipment
	ActivitySubtypeElliptical    ActivitySubtype = 15 // Fitness Equipment
	ActivitySubtypeStairClimbing ActivitySubtype = 16 // Fitness Equipment
	ActivitySubtypeLapSwimming   ActivitySubtype = 17 // Swimming
	ActivitySubtypeOpenWater     ActivitySubtype = 18 // Swimming
	ActivitySubtypeAll           ActivitySubtype = 254
	ActivitySubtypeInvalid       ActivitySubtype = 0xFF
)

func (ActivitySubtype) String

func (i ActivitySubtype) String() string

type ActivitySummaryFile

type ActivitySummaryFile struct {
	Activity *ActivityMsg
	Sessions []*SessionMsg
	Laps     []*LapMsg
}

ActivitySummaryFile represents the Activity Summary FIT file type. Similar to Activity file, contains summary information only.

type ActivityType

type ActivityType byte

ActivityType represents the activity_type FIT type.

const (
	ActivityTypeGeneric          ActivityType = 0
	ActivityTypeRunning          ActivityType = 1
	ActivityTypeCycling          ActivityType = 2
	ActivityTypeTransition       ActivityType = 3 // Mulitsport transition
	ActivityTypeFitnessEquipment ActivityType = 4
	ActivityTypeSwimming         ActivityType = 5
	ActivityTypeWalking          ActivityType = 6
	ActivityTypeAll              ActivityType = 254 // All is for goals only to include all sports.
	ActivityTypeInvalid          ActivityType = 0xFF
)

func (ActivityType) String

func (i ActivityType) String() string

type AntNetwork

type AntNetwork byte

AntNetwork represents the ant_network FIT type.

const (
	AntNetworkPublic  AntNetwork = 0
	AntNetworkAntplus AntNetwork = 1
	AntNetworkAntfs   AntNetwork = 2
	AntNetworkPrivate AntNetwork = 3
	AntNetworkInvalid AntNetwork = 0xFF
)

func (AntNetwork) String

func (i AntNetwork) String() string

type AntplusDeviceType

type AntplusDeviceType uint8

AntplusDeviceType represents the antplus_device_type FIT type.

const (
	AntplusDeviceTypeAntfs                   AntplusDeviceType = 1
	AntplusDeviceTypeBikePower               AntplusDeviceType = 11
	AntplusDeviceTypeEnvironmentSensorLegacy AntplusDeviceType = 12
	AntplusDeviceTypeMultiSportSpeedDistance AntplusDeviceType = 15
	AntplusDeviceTypeControl                 AntplusDeviceType = 16
	AntplusDeviceTypeFitnessEquipment        AntplusDeviceType = 17
	AntplusDeviceTypeBloodPressure           AntplusDeviceType = 18
	AntplusDeviceTypeGeocacheNode            AntplusDeviceType = 19
	AntplusDeviceTypeLightElectricVehicle    AntplusDeviceType = 20
	AntplusDeviceTypeEnvSensor               AntplusDeviceType = 25
	AntplusDeviceTypeRacquet                 AntplusDeviceType = 26
	AntplusDeviceTypeWeightScale             AntplusDeviceType = 119
	AntplusDeviceTypeHeartRate               AntplusDeviceType = 120
	AntplusDeviceTypeBikeSpeedCadence        AntplusDeviceType = 121
	AntplusDeviceTypeBikeCadence             AntplusDeviceType = 122
	AntplusDeviceTypeBikeSpeed               AntplusDeviceType = 123
	AntplusDeviceTypeStrideSpeedDistance     AntplusDeviceType = 124
	AntplusDeviceTypeInvalid                 AntplusDeviceType = 0xFF
)

func (AntplusDeviceType) String

func (i AntplusDeviceType) String() string

type AttitudeStage

type AttitudeStage byte

AttitudeStage represents the attitude_stage FIT type.

const (
	AttitudeStageFailed   AttitudeStage = 0
	AttitudeStageAligning AttitudeStage = 1
	AttitudeStageDegraded AttitudeStage = 2
	AttitudeStageValid    AttitudeStage = 3
	AttitudeStageInvalid  AttitudeStage = 0xFF
)

func (AttitudeStage) String

func (i AttitudeStage) String() string

type AttitudeValidity

type AttitudeValidity uint16

AttitudeValidity represents the attitude_validity FIT type.

const (
	AttitudeValidityTrackAngleHeadingValid AttitudeValidity = 0x0001
	AttitudeValidityPitchValid             AttitudeValidity = 0x0002
	AttitudeValidityRollValid              AttitudeValidity = 0x0004
	AttitudeValidityLateralBodyAccelValid  AttitudeValidity = 0x0008
	AttitudeValidityNormalBodyAccelValid   AttitudeValidity = 0x0010
	AttitudeValidityTurnRateValid          AttitudeValidity = 0x0020
	AttitudeValidityHwFail                 AttitudeValidity = 0x0040
	AttitudeValidityMagInvalid             AttitudeValidity = 0x0080
	AttitudeValidityNoGps                  AttitudeValidity = 0x0100
	AttitudeValidityGpsInvalid             AttitudeValidity = 0x0200
	AttitudeValiditySolutionCoasting       AttitudeValidity = 0x0400
	AttitudeValidityTrueTrackAngle         AttitudeValidity = 0x0800
	AttitudeValidityMagneticHeading        AttitudeValidity = 0x1000
	AttitudeValidityInvalid                AttitudeValidity = 0xFFFF
)

func (AttitudeValidity) String

func (i AttitudeValidity) String() string

type AutolapTrigger

type AutolapTrigger byte

AutolapTrigger represents the autolap_trigger FIT type.

const (
	AutolapTriggerTime             AutolapTrigger = 0
	AutolapTriggerDistance         AutolapTrigger = 1
	AutolapTriggerPositionStart    AutolapTrigger = 2
	AutolapTriggerPositionLap      AutolapTrigger = 3
	AutolapTriggerPositionWaypoint AutolapTrigger = 4
	AutolapTriggerPositionMarked   AutolapTrigger = 5
	AutolapTriggerOff              AutolapTrigger = 6
	AutolapTriggerInvalid          AutolapTrigger = 0xFF
)

func (AutolapTrigger) String

func (i AutolapTrigger) String() string

type AviationAttitudeMsg

type AviationAttitudeMsg struct {
	Timestamp             time.Time // Timestamp message was output
	TimestampMs           uint16    // Fractional part of timestamp, added to timestamp
	SystemTime            []uint32  // System time associated with sample expressed in ms.
	Pitch                 []int16   // Range -PI/2 to +PI/2
	Roll                  []int16   // Range -PI to +PI
	AccelLateral          []int16   // Range -78.4 to +78.4 (-8 Gs to 8 Gs)
	AccelNormal           []int16   // Range -78.4 to +78.4 (-8 Gs to 8 Gs)
	TurnRate              []int16   // Range -8.727 to +8.727 (-500 degs/sec to +500 degs/sec)
	Stage                 []AttitudeStage
	AttitudeStageComplete []uint8  // The percent complete of the current attitude stage.  Set to 0 for attitude stages 0, 1 and 2 and to 100 for attitude stage 3 by AHRS modules that do not support it.  Range - 100
	Track                 []uint16 // Track Angle/Heading Range 0 - 2pi
	Validity              []AttitudeValidity
}

AviationAttitudeMsg represents the aviation_attitude FIT message type.

func (*AviationAttitudeMsg) GetAccelLateralScaled

func (x *AviationAttitudeMsg) GetAccelLateralScaled() []float64

GetAccelLateralScaled returns AccelLateral as a slice with scale and any offset applied to every element. Units: m/s^2

func (*AviationAttitudeMsg) GetAccelNormalScaled

func (x *AviationAttitudeMsg) GetAccelNormalScaled() []float64

GetAccelNormalScaled returns AccelNormal as a slice with scale and any offset applied to every element. Units: m/s^2

func (*AviationAttitudeMsg) GetPitchScaled

func (x *AviationAttitudeMsg) GetPitchScaled() []float64

GetPitchScaled returns Pitch as a slice with scale and any offset applied to every element. Units: radians

func (*AviationAttitudeMsg) GetRollScaled

func (x *AviationAttitudeMsg) GetRollScaled() []float64

GetRollScaled returns Roll as a slice with scale and any offset applied to every element. Units: radians

func (*AviationAttitudeMsg) GetTrackScaled

func (x *AviationAttitudeMsg) GetTrackScaled() []float64

GetTrackScaled returns Track as a slice with scale and any offset applied to every element. Units: radians

func (*AviationAttitudeMsg) GetTurnRateScaled

func (x *AviationAttitudeMsg) GetTurnRateScaled() []float64

GetTurnRateScaled returns TurnRate as a slice with scale and any offset applied to every element. Units: radians/second

type BatteryStatus

type BatteryStatus uint8

BatteryStatus represents the battery_status FIT type.

const (
	BatteryStatusNew      BatteryStatus = 1
	BatteryStatusGood     BatteryStatus = 2
	BatteryStatusOk       BatteryStatus = 3
	BatteryStatusLow      BatteryStatus = 4
	BatteryStatusCritical BatteryStatus = 5
	BatteryStatusUnknown  BatteryStatus = 7
	BatteryStatusInvalid  BatteryStatus = 0xFF
)

func (BatteryStatus) String

func (i BatteryStatus) String() string

type BikeProfileMsg

type BikeProfileMsg struct {
	MessageIndex             MessageIndex
	Name                     string
	Sport                    Sport
	SubSport                 SubSport
	Odometer                 uint32
	BikeSpdAntId             uint16
	BikeCadAntId             uint16
	BikeSpdcadAntId          uint16
	BikePowerAntId           uint16
	CustomWheelsize          uint16
	AutoWheelsize            uint16
	BikeWeight               uint16
	PowerCalFactor           uint16
	AutoWheelCal             Bool
	AutoPowerZero            Bool
	Id                       uint8
	SpdEnabled               Bool
	CadEnabled               Bool
	SpdcadEnabled            Bool
	PowerEnabled             Bool
	CrankLength              uint8
	Enabled                  Bool
	BikeSpdAntIdTransType    uint8
	BikeCadAntIdTransType    uint8
	BikeSpdcadAntIdTransType uint8
	BikePowerAntIdTransType  uint8
	OdometerRollover         uint8   // Rollover counter that can be used to extend the odometer
	FrontGearNum             uint8   // Number of front gears
	FrontGear                []uint8 // Number of teeth on each gear 0 is innermost
	RearGearNum              uint8   // Number of rear gears
	RearGear                 []uint8 // Number of teeth on each gear 0 is innermost
	ShimanoDi2Enabled        Bool
}

BikeProfileMsg represents the bike_profile FIT message type.

func (*BikeProfileMsg) GetAutoWheelsizeScaled

func (x *BikeProfileMsg) GetAutoWheelsizeScaled() float64

GetAutoWheelsizeScaled returns AutoWheelsize with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*BikeProfileMsg) GetBikeWeightScaled

func (x *BikeProfileMsg) GetBikeWeightScaled() float64

GetBikeWeightScaled returns BikeWeight with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kg

func (*BikeProfileMsg) GetCrankLengthScaled

func (x *BikeProfileMsg) GetCrankLengthScaled() float64

GetCrankLengthScaled returns CrankLength with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: mm

func (*BikeProfileMsg) GetCustomWheelsizeScaled

func (x *BikeProfileMsg) GetCustomWheelsizeScaled() float64

GetCustomWheelsizeScaled returns CustomWheelsize with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*BikeProfileMsg) GetOdometerScaled

func (x *BikeProfileMsg) GetOdometerScaled() float64

GetOdometerScaled returns Odometer with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*BikeProfileMsg) GetPowerCalFactorScaled

func (x *BikeProfileMsg) GetPowerCalFactorScaled() float64

GetPowerCalFactorScaled returns PowerCalFactor with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

type BloodPressureFile

type BloodPressureFile struct {
	UserProfile    *UserProfileMsg
	BloodPressures []*BloodPressureMsg
}

BloodPressureFile represents the Bload Pressure FIT file type. Records blood pressure data.

type BloodPressureMsg

type BloodPressureMsg struct {
	Timestamp            time.Time
	SystolicPressure     uint16
	DiastolicPressure    uint16
	MeanArterialPressure uint16
	Map3SampleMean       uint16
	MapMorningValues     uint16
	MapEveningValues     uint16
	HeartRate            uint8
	HeartRateType        HrType
	Status               BpStatus
	UserProfileIndex     MessageIndex // Associates this blood pressure message to a user.  This corresponds to the index of the user profile message in the blood pressure file.
}

BloodPressureMsg represents the blood_pressure FIT message type.

type BodyLocation

type BodyLocation byte

BodyLocation represents the body_location FIT type.

const (
	BodyLocationLeftLeg               BodyLocation = 0
	BodyLocationLeftCalf              BodyLocation = 1
	BodyLocationLeftShin              BodyLocation = 2
	BodyLocationLeftHamstring         BodyLocation = 3
	BodyLocationLeftQuad              BodyLocation = 4
	BodyLocationLeftGlute             BodyLocation = 5
	BodyLocationRightLeg              BodyLocation = 6
	BodyLocationRightCalf             BodyLocation = 7
	BodyLocationRightShin             BodyLocation = 8
	BodyLocationRightHamstring        BodyLocation = 9
	BodyLocationRightQuad             BodyLocation = 10
	BodyLocationRightGlute            BodyLocation = 11
	BodyLocationTorsoBack             BodyLocation = 12
	BodyLocationLeftLowerBack         BodyLocation = 13
	BodyLocationLeftUpperBack         BodyLocation = 14
	BodyLocationRightLowerBack        BodyLocation = 15
	BodyLocationRightUpperBack        BodyLocation = 16
	BodyLocationTorsoFront            BodyLocation = 17
	BodyLocationLeftAbdomen           BodyLocation = 18
	BodyLocationLeftChest             BodyLocation = 19
	BodyLocationRightAbdomen          BodyLocation = 20
	BodyLocationRightChest            BodyLocation = 21
	BodyLocationLeftArm               BodyLocation = 22
	BodyLocationLeftShoulder          BodyLocation = 23
	BodyLocationLeftBicep             BodyLocation = 24
	BodyLocationLeftTricep            BodyLocation = 25
	BodyLocationLeftBrachioradialis   BodyLocation = 26 // Left anterior forearm
	BodyLocationLeftForearmExtensors  BodyLocation = 27 // Left posterior forearm
	BodyLocationRightArm              BodyLocation = 28
	BodyLocationRightShoulder         BodyLocation = 29
	BodyLocationRightBicep            BodyLocation = 30
	BodyLocationRightTricep           BodyLocation = 31
	BodyLocationRightBrachioradialis  BodyLocation = 32 // Right anterior forearm
	BodyLocationRightForearmExtensors BodyLocation = 33 // Right posterior forearm
	BodyLocationNeck                  BodyLocation = 34
	BodyLocationThroat                BodyLocation = 35
	BodyLocationInvalid               BodyLocation = 0xFF
)

func (BodyLocation) String

func (i BodyLocation) String() string

type Bool

type Bool byte
const (
	BoolFalse   Bool = 0
	BoolTrue    Bool = 1
	BoolInvalid Bool = 255
)

func (Bool) String

func (i Bool) String() string

type BpStatus

type BpStatus byte

BpStatus represents the bp_status FIT type.

const (
	BpStatusNoError                 BpStatus = 0
	BpStatusErrorIncompleteData     BpStatus = 1
	BpStatusErrorNoMeasurement      BpStatus = 2
	BpStatusErrorDataOutOfRange     BpStatus = 3
	BpStatusErrorIrregularHeartRate BpStatus = 4
	BpStatusInvalid                 BpStatus = 0xFF
)

func (BpStatus) String

func (i BpStatus) String() string

type CadenceZoneMsg

type CadenceZoneMsg struct {
	MessageIndex MessageIndex
	HighValue    uint8
	Name         string
}

CadenceZoneMsg represents the cadence_zone FIT message type.

type CameraEventMsg

type CameraEventMsg struct {
}

CameraEventMsg represents the camera_event FIT message type.

type CameraEventType

type CameraEventType byte

CameraEventType represents the camera_event_type FIT type.

const (
	CameraEventTypeVideoStart                  CameraEventType = 0 // Start of video recording
	CameraEventTypeVideoSplit                  CameraEventType = 1 // Mark of video file split (end of one file, beginning of the other)
	CameraEventTypeVideoEnd                    CameraEventType = 2 // End of video recording
	CameraEventTypePhotoTaken                  CameraEventType = 3 // Still photo taken
	CameraEventTypeVideoSecondStreamStart      CameraEventType = 4
	CameraEventTypeVideoSecondStreamSplit      CameraEventType = 5
	CameraEventTypeVideoSecondStreamEnd        CameraEventType = 6
	CameraEventTypeVideoSplitStart             CameraEventType = 7 // Mark of video file split start
	CameraEventTypeVideoSecondStreamSplitStart CameraEventType = 8
	CameraEventTypeInvalid                     CameraEventType = 0xFF
)

func (CameraEventType) String

func (i CameraEventType) String() string

type CameraOrientationType

type CameraOrientationType byte

CameraOrientationType represents the camera_orientation_type FIT type.

const (
	CameraOrientationTypeCameraOrientation0   CameraOrientationType = 0
	CameraOrientationTypeCameraOrientation90  CameraOrientationType = 1
	CameraOrientationTypeCameraOrientation180 CameraOrientationType = 2
	CameraOrientationTypeCameraOrientation270 CameraOrientationType = 3
	CameraOrientationTypeInvalid              CameraOrientationType = 0xFF
)

func (CameraOrientationType) String

func (i CameraOrientationType) String() string

type CapabilitiesMsg

type CapabilitiesMsg struct {
	Languages             []uint8      // Use language_bits_x types where x is index of array.
	Sports                []SportBits0 // Use sport_bits_x types where x is index of array.
	WorkoutsSupported     WorkoutCapabilities
	ConnectivitySupported ConnectivityCapabilities
}

CapabilitiesMsg represents the capabilities FIT message type.

type Checksum

type Checksum uint8

Checksum represents the checksum FIT type.

const (
	ChecksumClear   Checksum = 0 // Allows clear of checksum for flash memory where can only write 1 to 0 without erasing sector.
	ChecksumOk      Checksum = 1 // Set to mark checksum as valid if computes to invalid values 0 or 0xFF.  Checksum can also be set to ok to save encoding computation time.
	ChecksumInvalid Checksum = 0xFF
)

func (Checksum) String

func (i Checksum) String() string

type CommTimeoutType

type CommTimeoutType uint16

CommTimeoutType represents the comm_timeout_type FIT type.

const (
	CommTimeoutTypeWildcardPairingTimeout CommTimeoutType = 0 // Timeout pairing to any device
	CommTimeoutTypePairingTimeout         CommTimeoutType = 1 // Timeout pairing to previously paired device
	CommTimeoutTypeConnectionLost         CommTimeoutType = 2 // Temporary loss of communications
	CommTimeoutTypeConnectionTimeout      CommTimeoutType = 3 // Connection closed due to extended bad communications
	CommTimeoutTypeInvalid                CommTimeoutType = 0xFFFF
)

func (CommTimeoutType) String

func (i CommTimeoutType) String() string

type ConnectivityCapabilities

type ConnectivityCapabilities uint32

ConnectivityCapabilities represents the connectivity_capabilities FIT type.

const (
	ConnectivityCapabilitiesBluetooth                       ConnectivityCapabilities = 0x00000001
	ConnectivityCapabilitiesBluetoothLe                     ConnectivityCapabilities = 0x00000002
	ConnectivityCapabilitiesAnt                             ConnectivityCapabilities = 0x00000004
	ConnectivityCapabilitiesActivityUpload                  ConnectivityCapabilities = 0x00000008
	ConnectivityCapabilitiesCourseDownload                  ConnectivityCapabilities = 0x00000010
	ConnectivityCapabilitiesWorkoutDownload                 ConnectivityCapabilities = 0x00000020
	ConnectivityCapabilitiesLiveTrack                       ConnectivityCapabilities = 0x00000040
	ConnectivityCapabilitiesWeatherConditions               ConnectivityCapabilities = 0x00000080
	ConnectivityCapabilitiesWeatherAlerts                   ConnectivityCapabilities = 0x00000100
	ConnectivityCapabilitiesGpsEphemerisDownload            ConnectivityCapabilities = 0x00000200
	ConnectivityCapabilitiesExplicitArchive                 ConnectivityCapabilities = 0x00000400
	ConnectivityCapabilitiesSetupIncomplete                 ConnectivityCapabilities = 0x00000800
	ConnectivityCapabilitiesContinueSyncAfterSoftwareUpdate ConnectivityCapabilities = 0x00001000
	ConnectivityCapabilitiesConnectIqAppDownload            ConnectivityCapabilities = 0x00002000
	ConnectivityCapabilitiesInvalid                         ConnectivityCapabilities = 0x00000000
)

func (ConnectivityCapabilities) String

func (i ConnectivityCapabilities) String() string

type CourseCapabilities

type CourseCapabilities uint32

CourseCapabilities represents the course_capabilities FIT type.

const (
	CourseCapabilitiesProcessed  CourseCapabilities = 0x00000001
	CourseCapabilitiesValid      CourseCapabilities = 0x00000002
	CourseCapabilitiesTime       CourseCapabilities = 0x00000004
	CourseCapabilitiesDistance   CourseCapabilities = 0x00000008
	CourseCapabilitiesPosition   CourseCapabilities = 0x00000010
	CourseCapabilitiesHeartRate  CourseCapabilities = 0x00000020
	CourseCapabilitiesPower      CourseCapabilities = 0x00000040
	CourseCapabilitiesCadence    CourseCapabilities = 0x00000080
	CourseCapabilitiesTraining   CourseCapabilities = 0x00000100
	CourseCapabilitiesNavigation CourseCapabilities = 0x00000200
	CourseCapabilitiesBikeway    CourseCapabilities = 0x00000400
	CourseCapabilitiesInvalid    CourseCapabilities = 0x00000000
)

func (CourseCapabilities) String

func (i CourseCapabilities) String() string

type CourseFile

type CourseFile struct {
	Course       *CourseMsg
	Laps         []*LapMsg
	CoursePoints []*CoursePointMsg
	Records      []*RecordMsg
}

CourseFile represents the Course FIT file type. Uses data from an activity to recreate a course.

type CourseMsg

type CourseMsg struct {
	Sport        Sport
	Name         string
	Capabilities CourseCapabilities
}

CourseMsg represents the course FIT message type.

type CoursePoint

type CoursePoint byte

CoursePoint represents the course_point FIT type.

const (
	CoursePointGeneric        CoursePoint = 0
	CoursePointSummit         CoursePoint = 1
	CoursePointValley         CoursePoint = 2
	CoursePointWater          CoursePoint = 3
	CoursePointFood           CoursePoint = 4
	CoursePointDanger         CoursePoint = 5
	CoursePointLeft           CoursePoint = 6
	CoursePointRight          CoursePoint = 7
	CoursePointStraight       CoursePoint = 8
	CoursePointFirstAid       CoursePoint = 9
	CoursePointFourthCategory CoursePoint = 10
	CoursePointThirdCategory  CoursePoint = 11
	CoursePointSecondCategory CoursePoint = 12
	CoursePointFirstCategory  CoursePoint = 13
	CoursePointHorsCategory   CoursePoint = 14
	CoursePointSprint         CoursePoint = 15
	CoursePointLeftFork       CoursePoint = 16
	CoursePointRightFork      CoursePoint = 17
	CoursePointMiddleFork     CoursePoint = 18
	CoursePointSlightLeft     CoursePoint = 19
	CoursePointSharpLeft      CoursePoint = 20
	CoursePointSlightRight    CoursePoint = 21
	CoursePointSharpRight     CoursePoint = 22
	CoursePointUTurn          CoursePoint = 23
	CoursePointInvalid        CoursePoint = 0xFF
)

func (CoursePoint) String

func (i CoursePoint) String() string

type CoursePointMsg

type CoursePointMsg struct {
	MessageIndex MessageIndex
	Timestamp    time.Time
	PositionLat  Latitude
	PositionLong Longitude
	Distance     uint32
	Type         CoursePoint
	Name         string
	Favorite     Bool
}

CoursePointMsg represents the course_point FIT message type.

func (*CoursePointMsg) GetDistanceScaled

func (x *CoursePointMsg) GetDistanceScaled() float64

GetDistanceScaled returns Distance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

type DeviceFile

type DeviceFile struct {
	Softwares         []*SoftwareMsg
	Capabilities      []*CapabilitiesMsg
	FileCapabilities  []*FileCapabilitiesMsg
	MesgCapabilities  []*MesgCapabilitiesMsg
	FieldCapabilities []*FieldCapabilitiesMsg
}

DeviceFile represents the Device FIT file type. Describes a device's file structure and capabilities.

type DeviceIndex

type DeviceIndex uint8

DeviceIndex represents the device_index FIT type.

const (
	DeviceIndexCreator DeviceIndex = 0 // Creator of the file is always device index 0.
	DeviceIndexInvalid DeviceIndex = 0xFF
)

func (DeviceIndex) String

func (i DeviceIndex) String() string

type DeviceInfoMsg

type DeviceInfoMsg struct {
	Timestamp           time.Time
	DeviceIndex         DeviceIndex
	DeviceType          uint8
	Manufacturer        Manufacturer
	SerialNumber        uint32
	Product             uint16
	SoftwareVersion     uint16
	HardwareVersion     uint8
	CumOperatingTime    uint32 // Reset by new battery or charge.
	BatteryVoltage      uint16
	BatteryStatus       BatteryStatus
	SensorPosition      BodyLocation // Indicates the location of the sensor
	Descriptor          string       // Used to describe the sensor or location
	AntTransmissionType uint8
	AntDeviceNumber     uint16
	AntNetwork          AntNetwork
	SourceType          SourceType
	ProductName         string // Optional free form string to indicate the devices name or model
}

DeviceInfoMsg represents the device_info FIT message type.

func (*DeviceInfoMsg) GetBatteryVoltageScaled

func (x *DeviceInfoMsg) GetBatteryVoltageScaled() float64

GetBatteryVoltageScaled returns BatteryVoltage with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: V

func (*DeviceInfoMsg) GetDeviceType

func (x *DeviceInfoMsg) GetDeviceType() interface{}

GetDeviceType returns the appropriate DeviceType subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*DeviceInfoMsg) GetProduct

func (x *DeviceInfoMsg) GetProduct() interface{}

GetProduct returns the appropriate Product subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*DeviceInfoMsg) GetSoftwareVersionScaled

func (x *DeviceInfoMsg) GetSoftwareVersionScaled() float64

GetSoftwareVersionScaled returns SoftwareVersion with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set).

type DeviceSettingsMsg

type DeviceSettingsMsg struct {
	ActiveTimeZone uint8  // Index into time zone arrays.
	UtcOffset      uint32 // Offset from system time. Required to convert timestamp from system time to UTC.
	TimeZoneOffset []int8 // timezone offset in 1/4 hour increments
}

DeviceSettingsMsg represents the device_settings FIT message type.

func (*DeviceSettingsMsg) GetTimeZoneOffsetScaled

func (x *DeviceSettingsMsg) GetTimeZoneOffsetScaled() []float64

GetTimeZoneOffsetScaled returns TimeZoneOffset as a slice with scale and any offset applied to every element. Units: hr

type DisplayHeart

type DisplayHeart byte

DisplayHeart represents the display_heart FIT type.

const (
	DisplayHeartBpm     DisplayHeart = 0
	DisplayHeartMax     DisplayHeart = 1
	DisplayHeartReserve DisplayHeart = 2
	DisplayHeartInvalid DisplayHeart = 0xFF
)

func (DisplayHeart) String

func (i DisplayHeart) String() string

type DisplayMeasure

type DisplayMeasure byte

DisplayMeasure represents the display_measure FIT type.

const (
	DisplayMeasureMetric  DisplayMeasure = 0
	DisplayMeasureStatute DisplayMeasure = 1
	DisplayMeasureInvalid DisplayMeasure = 0xFF
)

func (DisplayMeasure) String

func (i DisplayMeasure) String() string

type DisplayPosition

type DisplayPosition byte

DisplayPosition represents the display_position FIT type.

const (
	DisplayPositionDegree               DisplayPosition = 0  // dd.dddddd
	DisplayPositionDegreeMinute         DisplayPosition = 1  // dddmm.mmm
	DisplayPositionDegreeMinuteSecond   DisplayPosition = 2  // dddmmss
	DisplayPositionAustrianGrid         DisplayPosition = 3  // Austrian Grid (BMN)
	DisplayPositionBritishGrid          DisplayPosition = 4  // British National Grid
	DisplayPositionDutchGrid            DisplayPosition = 5  // Dutch grid system
	DisplayPositionHungarianGrid        DisplayPosition = 6  // Hungarian grid system
	DisplayPositionFinnishGrid          DisplayPosition = 7  // Finnish grid system Zone3 KKJ27
	DisplayPositionGermanGrid           DisplayPosition = 8  // Gausss Krueger (German)
	DisplayPositionIcelandicGrid        DisplayPosition = 9  // Icelandic Grid
	DisplayPositionIndonesianEquatorial DisplayPosition = 10 // Indonesian Equatorial LCO
	DisplayPositionIndonesianIrian      DisplayPosition = 11 // Indonesian Irian LCO
	DisplayPositionIndonesianSouthern   DisplayPosition = 12 // Indonesian Southern LCO
	DisplayPositionIndiaZone0           DisplayPosition = 13 // India zone 0
	DisplayPositionIndiaZoneIA          DisplayPosition = 14 // India zone IA
	DisplayPositionIndiaZoneIB          DisplayPosition = 15 // India zone IB
	DisplayPositionIndiaZoneIIA         DisplayPosition = 16 // India zone IIA
	DisplayPositionIndiaZoneIIB         DisplayPosition = 17 // India zone IIB
	DisplayPositionIndiaZoneIIIA        DisplayPosition = 18 // India zone IIIA
	DisplayPositionIndiaZoneIIIB        DisplayPosition = 19 // India zone IIIB
	DisplayPositionIndiaZoneIVA         DisplayPosition = 20 // India zone IVA
	DisplayPositionIndiaZoneIVB         DisplayPosition = 21 // India zone IVB
	DisplayPositionIrishTransverse      DisplayPosition = 22 // Irish Transverse Mercator
	DisplayPositionIrishGrid            DisplayPosition = 23 // Irish Grid
	DisplayPositionLoran                DisplayPosition = 24 // Loran TD
	DisplayPositionMaidenheadGrid       DisplayPosition = 25 // Maidenhead grid system
	DisplayPositionMgrsGrid             DisplayPosition = 26 // MGRS grid system
	DisplayPositionNewZealandGrid       DisplayPosition = 27 // New Zealand grid system
	DisplayPositionNewZealandTransverse DisplayPosition = 28 // New Zealand Transverse Mercator
	DisplayPositionQatarGrid            DisplayPosition = 29 // Qatar National Grid
	DisplayPositionModifiedSwedishGrid  DisplayPosition = 30 // Modified RT-90 (Sweden)
	DisplayPositionSwedishGrid          DisplayPosition = 31 // RT-90 (Sweden)
	DisplayPositionSouthAfricanGrid     DisplayPosition = 32 // South African Grid
	DisplayPositionSwissGrid            DisplayPosition = 33 // Swiss CH-1903 grid
	DisplayPositionTaiwanGrid           DisplayPosition = 34 // Taiwan Grid
	DisplayPositionUnitedStatesGrid     DisplayPosition = 35 // United States National Grid
	DisplayPositionUtmUpsGrid           DisplayPosition = 36 // UTM/UPS grid system
	DisplayPositionWestMalayan          DisplayPosition = 37 // West Malayan RSO
	DisplayPositionBorneoRso            DisplayPosition = 38 // Borneo RSO
	DisplayPositionEstonianGrid         DisplayPosition = 39 // Estonian grid system
	DisplayPositionLatvianGrid          DisplayPosition = 40 // Latvian Transverse Mercator
	DisplayPositionSwedishRef99Grid     DisplayPosition = 41 // Reference Grid 99 TM (Swedish)
	DisplayPositionInvalid              DisplayPosition = 0xFF
)

func (DisplayPosition) String

func (i DisplayPosition) String() string

type DisplayPower

type DisplayPower byte

DisplayPower represents the display_power FIT type.

const (
	DisplayPowerWatts      DisplayPower = 0
	DisplayPowerPercentFtp DisplayPower = 1
	DisplayPowerInvalid    DisplayPower = 0xFF
)

func (DisplayPower) String

func (i DisplayPower) String() string

type Event

type Event byte

Event represents the event FIT type.

const (
	EventTimer                 Event = 0  // Group 0.  Start / stop_all
	EventWorkout               Event = 3  // start / stop
	EventWorkoutStep           Event = 4  // Start at beginning of workout.  Stop at end of each step.
	EventPowerDown             Event = 5  // stop_all group 0
	EventPowerUp               Event = 6  // stop_all group 0
	EventOffCourse             Event = 7  // start / stop group 0
	EventSession               Event = 8  // Stop at end of each session.
	EventLap                   Event = 9  // Stop at end of each lap.
	EventCoursePoint           Event = 10 // marker
	EventBattery               Event = 11 // marker
	EventVirtualPartnerPace    Event = 12 // Group 1. Start at beginning of activity if VP enabled, when VP pace is changed during activity or VP enabled mid activity.  stop_disable when VP disabled.
	EventHrHighAlert           Event = 13 // Group 0.  Start / stop when in alert condition.
	EventHrLowAlert            Event = 14 // Group 0.  Start / stop when in alert condition.
	EventSpeedHighAlert        Event = 15 // Group 0.  Start / stop when in alert condition.
	EventSpeedLowAlert         Event = 16 // Group 0.  Start / stop when in alert condition.
	EventCadHighAlert          Event = 17 // Group 0.  Start / stop when in alert condition.
	EventCadLowAlert           Event = 18 // Group 0.  Start / stop when in alert condition.
	EventPowerHighAlert        Event = 19 // Group 0.  Start / stop when in alert condition.
	EventPowerLowAlert         Event = 20 // Group 0.  Start / stop when in alert condition.
	EventRecoveryHr            Event = 21 // marker
	EventBatteryLow            Event = 22 // marker
	EventTimeDurationAlert     Event = 23 // Group 1.  Start if enabled mid activity (not required at start of activity). Stop when duration is reached.  stop_disable if disabled.
	EventDistanceDurationAlert Event = 24 // Group 1.  Start if enabled mid activity (not required at start of activity). Stop when duration is reached.  stop_disable if disabled.
	EventCalorieDurationAlert  Event = 25 // Group 1.  Start if enabled mid activity (not required at start of activity). Stop when duration is reached.  stop_disable if disabled.
	EventActivity              Event = 26 // Group 1..  Stop at end of activity.
	EventFitnessEquipment      Event = 27 // marker
	EventLength                Event = 28 // Stop at end of each length.
	EventUserMarker            Event = 32 // marker
	EventSportPoint            Event = 33 // marker
	EventCalibration           Event = 36 // start/stop/marker
	EventFrontGearChange       Event = 42 // marker
	EventRearGearChange        Event = 43 // marker
	EventRiderPositionChange   Event = 44 // marker
	EventElevHighAlert         Event = 45 // Group 0.  Start / stop when in alert condition.
	EventElevLowAlert          Event = 46 // Group 0.  Start / stop when in alert condition.
	EventCommTimeout           Event = 47 // marker
	EventInvalid               Event = 0xFF
)

func (Event) String

func (i Event) String() string

type EventMsg

type EventMsg struct {
	Timestamp     time.Time
	Event         Event
	EventType     EventType
	Data16        uint16
	Data          uint32
	EventGroup    uint8
	Score         uint16 // Do not populate directly.  Autogenerated by decoder for sport_point subfield components
	OpponentScore uint16 // Do not populate directly.  Autogenerated by decoder for sport_point subfield components
	FrontGearNum  uint8  // Do not populate directly.  Autogenerated by decoder for gear_change subfield components.  Front gear number. 1 is innermost.
	FrontGear     uint8  // Do not populate directly.  Autogenerated by decoder for gear_change subfield components.  Number of front teeth.
	RearGearNum   uint8  // Do not populate directly.  Autogenerated by decoder for gear_change subfield components.  Rear gear number. 1 is innermost.
	RearGear      uint8  // Do not populate directly.  Autogenerated by decoder for gear_change subfield components.  Number of rear teeth.
}

EventMsg represents the event FIT message type.

func (*EventMsg) GetData

func (x *EventMsg) GetData() interface{}

GetData returns the appropriate Data subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

type EventType

type EventType byte

EventType represents the event_type FIT type.

const (
	EventTypeStart                  EventType = 0
	EventTypeStop                   EventType = 1
	EventTypeConsecutiveDepreciated EventType = 2
	EventTypeMarker                 EventType = 3
	EventTypeStopAll                EventType = 4
	EventTypeBeginDepreciated       EventType = 5
	EventTypeEndDepreciated         EventType = 6
	EventTypeEndAllDepreciated      EventType = 7
	EventTypeStopDisable            EventType = 8
	EventTypeStopDisableAll         EventType = 9
	EventTypeInvalid                EventType = 0xFF
)

func (EventType) String

func (i EventType) String() string

type FieldCapabilitiesMsg

type FieldCapabilitiesMsg struct {
	MessageIndex MessageIndex
	File         File
	MesgNum      MesgNum
	FieldNum     uint8
	Count        uint16
}

FieldCapabilitiesMsg represents the field_capabilities FIT message type.

type File

type File byte

File represents the file FIT type.

const (
	FileDevice          File = 1  // Read only, single file. Must be in root directory.
	FileSettings        File = 2  // Read/write, single file. Directory=Settings
	FileSport           File = 3  // Read/write, multiple files, file number = sport type. Directory=Sports
	FileActivity        File = 4  // Read/erase, multiple files. Directory=Activities
	FileWorkout         File = 5  // Read/write/erase, multiple files. Directory=Workouts
	FileCourse          File = 6  // Read/write/erase, multiple files. Directory=Courses
	FileSchedules       File = 7  // Read/write, single file. Directory=Schedules
	FileWeight          File = 9  // Read only, single file. Circular buffer. All message definitions at start of file. Directory=Weight
	FileTotals          File = 10 // Read only, single file. Directory=Totals
	FileGoals           File = 11 // Read/write, single file. Directory=Goals
	FileBloodPressure   File = 14 // Read only. Directory=Blood Pressure
	FileMonitoringA     File = 15 // Read only. Directory=Monitoring. File number=sub type.
	FileActivitySummary File = 20 // Read/erase, multiple files. Directory=Activities
	FileMonitoringDaily File = 28
	FileMonitoringB     File = 32   // Read only. Directory=Monitoring. File number=identifier
	FileSegment         File = 34   // Read/write/erase. Multiple Files.  Directory=Segments
	FileSegmentList     File = 35   // Read/write/erase. Single File.  Directory=Segments
	FileMfgRangeMin     File = 0xF7 // 0xF7 - 0xFE reserved for manufacturer specific file types
	FileMfgRangeMax     File = 0xFE // 0xF7 - 0xFE reserved for manufacturer specific file types
	FileInvalid         File = 0xFF
)

func (File) String

func (i File) String() string

type FileCapabilitiesMsg

type FileCapabilitiesMsg struct {
	MessageIndex MessageIndex
	Type         File
	Flags        FileFlags
	Directory    string
	MaxCount     uint16
	MaxSize      uint32
}

FileCapabilitiesMsg represents the file_capabilities FIT message type.

type FileCreatorMsg

type FileCreatorMsg struct {
	SoftwareVersion uint16
	HardwareVersion uint8
}

FileCreatorMsg represents the file_creator FIT message type.

type FileFlags

type FileFlags uint8

FileFlags represents the file_flags FIT type.

const (
	FileFlagsRead    FileFlags = 0x02
	FileFlagsWrite   FileFlags = 0x04
	FileFlagsErase   FileFlags = 0x08
	FileFlagsInvalid FileFlags = 0x00
)

func (FileFlags) String

func (i FileFlags) String() string

type FileIdMsg

type FileIdMsg struct {
	Type         File
	Manufacturer Manufacturer
	Product      uint16
	SerialNumber uint32
	TimeCreated  time.Time // Only set for files that are can be created/erased.
	Number       uint16    // Only set for files that are not created/erased.
	ProductName  string    // Optional free form string to indicate the devices name or model
}

FileIdMsg represents the file_id FIT message type.

func (*FileIdMsg) GetProduct

func (x *FileIdMsg) GetProduct() interface{}

GetProduct returns the appropriate Product subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

type Fit

type Fit struct {
	// Header is the FIT file header.
	Header *Header

	// CRC is the FIT file CRC.
	CRC uint16

	// Common messages for all FIT file types.
	FileId               FileIdMsg
	FileCreator          FileCreatorMsg
	TimestampCorrelation TimestampCorrelationMsg
	DeviceInfo           DeviceInfoMsg

	// UnknownMessages is a map that maps an unknown message number to how
	// many times the message was encountered during encoding.
	UnknownMessages map[MesgNum]int

	// UnknownFields is a map that maps an unknown field to how many times
	// the field was encountered during encoding.
	UnknownFields map[UnknownField]int
	// contains filtered or unexported fields
}

Fit represents a decoded FIT file.

func Decode

func Decode(r io.Reader) (*Fit, error)

Decode reads a FIT file from r and returns it as a *Fit.

func (*Fit) Activity

func (f *Fit) Activity() (*ActivityFile, error)

Activity returns f's Activity file. An error is returned if the FIT file is not of type activity.

func (*Fit) ActivitySummary

func (f *Fit) ActivitySummary() (*ActivitySummaryFile, error)

ActivitySummary returns f's ActivitySummary file. An error is returned if the FIT file is not of type activity summary.

func (*Fit) BloodPressure

func (f *Fit) BloodPressure() (*BloodPressureFile, error)

BloodPressure returns f's BloodPressure file. An error is returned if the FIT file is not of type blood pressure.

func (*Fit) Course

func (f *Fit) Course() (*CourseFile, error)

Course returns f's Course file. An error is returned if the FIT file is not of type course.

func (*Fit) Device

func (f *Fit) Device() (*DeviceFile, error)

Device returns f's Device file. An error is returned if the FIT file is not of type device.

func (*Fit) FileType

func (f *Fit) FileType() File

FileType returns the FIT file type.

func (*Fit) Goals

func (f *Fit) Goals() (*GoalsFile, error)

Goals returns f's Goals file. An error is returned if the FIT file is not of type goals.

func (*Fit) MonitoringA

func (f *Fit) MonitoringA() (*MonitoringAFile, error)

MonitoringA returns f's MonitoringA file. An error is returned if the FIT file is not of type monitoring A.

func (*Fit) MonitoringB

func (f *Fit) MonitoringB() (*MonitoringBFile, error)

MonitoringB returns f's MonitoringB file. An error is returned if the FIT file is not of type monitoring B.

func (*Fit) MonitoringDaily

func (f *Fit) MonitoringDaily() (*MonitoringDailyFile, error)

MonitoringDaily returns f's MonitoringDaily file. An error is returned if the FIT file is not of type monitoring daily.

func (*Fit) Schedules

func (f *Fit) Schedules() (*SchedulesFile, error)

Schedules returns f's Schedules file. An error is returned if the FIT file is not of type schedules.

func (*Fit) Segment

func (f *Fit) Segment() (*SegmentFile, error)

Segment returns f's Segment file. An error is returned if the FIT file is not of type segment.

func (*Fit) SegmentList

func (f *Fit) SegmentList() (*SegmentListFile, error)

SegmentList returns f's SegmentList file. An error is returned if the FIT file is not of type segment list.

func (*Fit) Settings

func (f *Fit) Settings() (*SettingsFile, error)

Settings returns f's Settings file. An error is returned if the FIT file is not of type settings.

func (*Fit) Sport

func (f *Fit) Sport() (*SportFile, error)

Sport returns f's Sport file. An error is returned if the FIT file is not of type sport.

func (*Fit) Totals

func (f *Fit) Totals() (*TotalsFile, error)

Totals returns f's Totals file. An error is returned if the FIT file is not of type totals.

func (*Fit) Weight

func (f *Fit) Weight() (*WeightFile, error)

Weight returns f's Weight file. An error is returned if the FIT file is not of type weight.

func (*Fit) Workout

func (f *Fit) Workout() (*WorkoutFile, error)

Workout returns f's Workout file. An error is returned if the FIT file is not of type workout.

type FitnessEquipmentState

type FitnessEquipmentState byte

FitnessEquipmentState represents the fitness_equipment_state FIT type.

const (
	FitnessEquipmentStateReady   FitnessEquipmentState = 0
	FitnessEquipmentStateInUse   FitnessEquipmentState = 1
	FitnessEquipmentStatePaused  FitnessEquipmentState = 2
	FitnessEquipmentStateUnknown FitnessEquipmentState = 3 // lost connection to fitness equipment
	FitnessEquipmentStateInvalid FitnessEquipmentState = 0xFF
)

func (FitnessEquipmentState) String

func (i FitnessEquipmentState) String() string

type FormatError

type FormatError string

A FormatError reports that the input is not valid FIT.

func (FormatError) Error

func (e FormatError) Error() string

type GarminProduct

type GarminProduct uint16

GarminProduct represents the garmin_product FIT type.

const (
	GarminProductHrm1                      GarminProduct = 1
	GarminProductAxh01                     GarminProduct = 2 // AXH01 HRM chipset
	GarminProductAxb01                     GarminProduct = 3
	GarminProductAxb02                     GarminProduct = 4
	GarminProductHrm2ss                    GarminProduct = 5
	GarminProductDsiAlf02                  GarminProduct = 6
	GarminProductHrm3ss                    GarminProduct = 7
	GarminProductHrmRunSingleByteProductId GarminProduct = 8  // hrm_run model for HRM ANT+ messaging
	GarminProductBsm                       GarminProduct = 9  // BSM model for ANT+ messaging
	GarminProductBcm                       GarminProduct = 10 // BCM model for ANT+ messaging
	GarminProductAxs01                     GarminProduct = 11 // AXS01 HRM Bike Chipset model for ANT+ messaging
	GarminProductHrmTriSingleByteProductId GarminProduct = 12 // hrm_tri model for HRM ANT+ messaging
	GarminProductFr225SingleByteProductId  GarminProduct = 14 // fr225 model for HRM ANT+ messaging
	GarminProductFr301China                GarminProduct = 473
	GarminProductFr301Japan                GarminProduct = 474
	GarminProductFr301Korea                GarminProduct = 475
	GarminProductFr301Taiwan               GarminProduct = 494
	GarminProductFr405                     GarminProduct = 717 // Forerunner 405
	GarminProductFr50                      GarminProduct = 782 // Forerunner 50
	GarminProductFr405Japan                GarminProduct = 987
	GarminProductFr60                      GarminProduct = 988 // Forerunner 60
	GarminProductDsiAlf01                  GarminProduct = 1011
	GarminProductFr310xt                   GarminProduct = 1018 // Forerunner 310
	GarminProductEdge500                   GarminProduct = 1036
	GarminProductFr110                     GarminProduct = 1124 // Forerunner 110
	GarminProductEdge800                   GarminProduct = 1169
	GarminProductEdge500Taiwan             GarminProduct = 1199
	GarminProductEdge500Japan              GarminProduct = 1213
	GarminProductChirp                     GarminProduct = 1253
	GarminProductFr110Japan                GarminProduct = 1274
	GarminProductEdge200                   GarminProduct = 1325
	GarminProductFr910xt                   GarminProduct = 1328
	GarminProductEdge800Taiwan             GarminProduct = 1333
	GarminProductEdge800Japan              GarminProduct = 1334
	GarminProductAlf04                     GarminProduct = 1341
	GarminProductFr610                     GarminProduct = 1345
	GarminProductFr210Japan                GarminProduct = 1360
	GarminProductVectorSs                  GarminProduct = 1380
	GarminProductVectorCp                  GarminProduct = 1381
	GarminProductEdge800China              GarminProduct = 1386
	GarminProductEdge500China              GarminProduct = 1387
	GarminProductFr610Japan                GarminProduct = 1410
	GarminProductEdge500Korea              GarminProduct = 1422
	GarminProductFr70                      GarminProduct = 1436
	GarminProductFr310xt4t                 GarminProduct = 1446
	GarminProductAmx                       GarminProduct = 1461
	GarminProductFr10                      GarminProduct = 1482
	GarminProductEdge800Korea              GarminProduct = 1497
	GarminProductSwim                      GarminProduct = 1499
	GarminProductFr910xtChina              GarminProduct = 1537
	GarminProductFenix                     GarminProduct = 1551
	GarminProductEdge200Taiwan             GarminProduct = 1555
	GarminProductEdge510                   GarminProduct = 1561
	GarminProductEdge810                   GarminProduct = 1567
	GarminProductTempe                     GarminProduct = 1570
	GarminProductFr910xtJapan              GarminProduct = 1600
	GarminProductFr620                     GarminProduct = 1623
	GarminProductFr220                     GarminProduct = 1632
	GarminProductFr910xtKorea              GarminProduct = 1664
	GarminProductFr10Japan                 GarminProduct = 1688
	GarminProductEdge810Japan              GarminProduct = 1721
	GarminProductVirbElite                 GarminProduct = 1735
	GarminProductEdgeTouring               GarminProduct = 1736 // Also Edge Touring Plus
	GarminProductEdge510Japan              GarminProduct = 1742
	GarminProductHrmTri                    GarminProduct = 1743
	GarminProductHrmRun                    GarminProduct = 1752
	GarminProductFr920xt                   GarminProduct = 1765
	GarminProductEdge510Asia               GarminProduct = 1821
	GarminProductEdge810China              GarminProduct = 1822
	GarminProductEdge810Taiwan             GarminProduct = 1823
	GarminProductEdge1000                  GarminProduct = 1836
	GarminProductVivoFit                   GarminProduct = 1837
	GarminProductVirbRemote                GarminProduct = 1853
	GarminProductVivoKi                    GarminProduct = 1885
	GarminProductFr15                      GarminProduct = 1903
	GarminProductVivoActive                GarminProduct = 1907
	GarminProductEdge510Korea              GarminProduct = 1918
	GarminProductFr620Japan                GarminProduct = 1928
	GarminProductFr620China                GarminProduct = 1929
	GarminProductFr220Japan                GarminProduct = 1930
	GarminProductFr220China                GarminProduct = 1931
	GarminProductApproachS6                GarminProduct = 1936
	GarminProductVivoSmart                 GarminProduct = 1956
	GarminProductFenix2                    GarminProduct = 1967
	GarminProductEpix                      GarminProduct = 1988
	GarminProductFenix3                    GarminProduct = 2050
	GarminProductEdge1000Taiwan            GarminProduct = 2052
	GarminProductEdge1000Japan             GarminProduct = 2053
	GarminProductFr15Japan                 GarminProduct = 2061
	GarminProductEdge520                   GarminProduct = 2067
	GarminProductEdge1000China             GarminProduct = 2070
	GarminProductFr620Russia               GarminProduct = 2072
	GarminProductFr220Russia               GarminProduct = 2073
	GarminProductVectorS                   GarminProduct = 2079
	GarminProductEdge1000Korea             GarminProduct = 2100
	GarminProductFr920xtTaiwan             GarminProduct = 2130
	GarminProductFr920xtChina              GarminProduct = 2131
	GarminProductFr920xtJapan              GarminProduct = 2132
	GarminProductVirbx                     GarminProduct = 2134
	GarminProductVivoSmartApac             GarminProduct = 2135
	GarminProductEtrexTouch                GarminProduct = 2140
	GarminProductEdge25                    GarminProduct = 2147
	GarminProductVivoFit2                  GarminProduct = 2150
	GarminProductFr225                     GarminProduct = 2153
	GarminProductVivoActiveApac            GarminProduct = 2160
	GarminProductVector2                   GarminProduct = 2161
	GarminProductVector2s                  GarminProduct = 2162
	GarminProductVirbxe                    GarminProduct = 2172
	GarminProductFr620Taiwan               GarminProduct = 2173
	GarminProductFr220Taiwan               GarminProduct = 2174
	GarminProductFenix3China               GarminProduct = 2188
	GarminProductFenix3Twn                 GarminProduct = 2189
	GarminProductVariaHeadlight            GarminProduct = 2192
	GarminProductVariaTaillightOld         GarminProduct = 2193
	GarminProductFr225Asia                 GarminProduct = 2219
	GarminProductVariaRadarTaillight       GarminProduct = 2225
	GarminProductVariaRadarDisplay         GarminProduct = 2226
	GarminProductEdge20                    GarminProduct = 2238
	GarminProductD2Bravo                   GarminProduct = 2262
	GarminProductVariaRemote               GarminProduct = 2276
	GarminProductSdm4                      GarminProduct = 10007 // SDM4 footpod
	GarminProductEdgeRemote                GarminProduct = 10014
	GarminProductTrainingCenter            GarminProduct = 20119
	GarminProductAndroidAntplusPlugin      GarminProduct = 65532
	GarminProductConnect                   GarminProduct = 65534 // Garmin Connect website
	GarminProductInvalid                   GarminProduct = 0xFFFF
)

func (GarminProduct) String

func (i GarminProduct) String() string

type Gender

type Gender byte

Gender represents the gender FIT type.

const (
	GenderFemale  Gender = 0
	GenderMale    Gender = 1
	GenderInvalid Gender = 0xFF
)

func (Gender) String

func (i Gender) String() string

type Goal

type Goal byte

Goal represents the goal FIT type.

const (
	GoalTime      Goal = 0
	GoalDistance  Goal = 1
	GoalCalories  Goal = 2
	GoalFrequency Goal = 3
	GoalSteps     Goal = 4
	GoalInvalid   Goal = 0xFF
)

func (Goal) String

func (i Goal) String() string

type GoalMsg

type GoalMsg struct {
	MessageIndex    MessageIndex
	Sport           Sport
	SubSport        SubSport
	StartDate       time.Time
	EndDate         time.Time
	Type            Goal
	Value           uint32
	Repeat          Bool
	TargetValue     uint32
	Recurrence      GoalRecurrence
	RecurrenceValue uint16
	Enabled         Bool
}

GoalMsg represents the goal FIT message type.

type GoalRecurrence

type GoalRecurrence byte

GoalRecurrence represents the goal_recurrence FIT type.

const (
	GoalRecurrenceOff     GoalRecurrence = 0
	GoalRecurrenceDaily   GoalRecurrence = 1
	GoalRecurrenceWeekly  GoalRecurrence = 2
	GoalRecurrenceMonthly GoalRecurrence = 3
	GoalRecurrenceYearly  GoalRecurrence = 4
	GoalRecurrenceCustom  GoalRecurrence = 5
	GoalRecurrenceInvalid GoalRecurrence = 0xFF
)

func (GoalRecurrence) String

func (i GoalRecurrence) String() string

type GoalsFile

type GoalsFile struct {
	Goals []*GoalMsg
}

GoalsFile represents the Goals FIT file type. Describes a user’s exercise/health goals.

type GyroscopeDataMsg

type GyroscopeDataMsg struct {
}

GyroscopeDataMsg represents the gyroscope_data FIT message type.

type Header struct {
	Size            byte
	ProtocolVersion byte
	ProfileVersion  uint16
	DataSize        uint32
	DataType        [4]byte
	CRC             uint16
}

Header represents a FIT file header.

func DecodeHeader

func DecodeHeader(r io.Reader) (*Header, error)

DecodeHeader returns the FIT file header without decoding the entire FIT file.

func (*Header) CheckIntegrity

func (h *Header) CheckIntegrity() error

CheckIntegrity verifies the FIT header CRC.

func (*Header) MarshalJSON

func (h *Header) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Header) String

func (h Header) String() string

type HrType

type HrType byte

HrType represents the hr_type FIT type.

const (
	HrTypeNormal    HrType = 0
	HrTypeIrregular HrType = 1
	HrTypeInvalid   HrType = 0xFF
)

func (HrType) String

func (i HrType) String() string

type HrZoneCalc

type HrZoneCalc byte

HrZoneCalc represents the hr_zone_calc FIT type.

const (
	HrZoneCalcCustom       HrZoneCalc = 0
	HrZoneCalcPercentMaxHr HrZoneCalc = 1
	HrZoneCalcPercentHrr   HrZoneCalc = 2
	HrZoneCalcInvalid      HrZoneCalc = 0xFF
)

func (HrZoneCalc) String

func (i HrZoneCalc) String() string

type HrZoneMsg

type HrZoneMsg struct {
	MessageIndex MessageIndex
	HighBpm      uint8
	Name         string
}

HrZoneMsg represents the hr_zone FIT message type.

type HrmProfileMsg

type HrmProfileMsg struct {
	MessageIndex      MessageIndex
	Enabled           Bool
	HrmAntId          uint16
	LogHrv            Bool
	HrmAntIdTransType uint8
}

HrmProfileMsg represents the hrm_profile FIT message type.

type HrvMsg

type HrvMsg struct {
	Time []uint16 // Time between beats
}

HrvMsg represents the hrv FIT message type.

func (*HrvMsg) GetTimeScaled

func (x *HrvMsg) GetTimeScaled() []float64

GetTimeScaled returns Time as a slice with scale and any offset applied to every element. Units: s

type IntegrityError

type IntegrityError string

An IntegrityError reports that a header or file CRC check failed.

func (IntegrityError) Error

func (e IntegrityError) Error() string

type Intensity

type Intensity byte

Intensity represents the intensity FIT type.

const (
	IntensityActive   Intensity = 0
	IntensityRest     Intensity = 1
	IntensityWarmup   Intensity = 2
	IntensityCooldown Intensity = 3
	IntensityInvalid  Intensity = 0xFF
)

func (Intensity) String

func (i Intensity) String() string

type Language

type Language byte

Language represents the language FIT type.

const (
	LanguageEnglish    Language = 0
	LanguageFrench     Language = 1
	LanguageItalian    Language = 2
	LanguageGerman     Language = 3
	LanguageSpanish    Language = 4
	LanguageCroatian   Language = 5
	LanguageCzech      Language = 6
	LanguageDanish     Language = 7
	LanguageDutch      Language = 8
	LanguageFinnish    Language = 9
	LanguageGreek      Language = 10
	LanguageHungarian  Language = 11
	LanguageNorwegian  Language = 12
	LanguagePolish     Language = 13
	LanguagePortuguese Language = 14
	LanguageSlovakian  Language = 15
	LanguageSlovenian  Language = 16
	LanguageSwedish    Language = 17
	LanguageRussian    Language = 18
	LanguageTurkish    Language = 19
	LanguageLatvian    Language = 20
	LanguageUkrainian  Language = 21
	LanguageArabic     Language = 22
	LanguageFarsi      Language = 23
	LanguageBulgarian  Language = 24
	LanguageRomanian   Language = 25
	LanguageCustom     Language = 254
	LanguageInvalid    Language = 0xFF
)

func (Language) String

func (i Language) String() string

type LapMsg

type LapMsg struct {
	MessageIndex                  MessageIndex
	Timestamp                     time.Time // Lap end time.
	Event                         Event
	EventType                     EventType
	StartTime                     time.Time
	StartPositionLat              Latitude
	StartPositionLong             Longitude
	EndPositionLat                Latitude
	EndPositionLong               Longitude
	TotalElapsedTime              uint32 // Time (includes pauses)
	TotalTimerTime                uint32 // Timer Time (excludes pauses)
	TotalDistance                 uint32
	TotalCycles                   uint32
	TotalCalories                 uint16
	TotalFatCalories              uint16 // If New Leaf
	AvgSpeed                      uint16
	MaxSpeed                      uint16
	AvgHeartRate                  uint8
	MaxHeartRate                  uint8
	AvgCadence                    uint8 // total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time
	MaxCadence                    uint8
	AvgPower                      uint16 // total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time
	MaxPower                      uint16
	TotalAscent                   uint16
	TotalDescent                  uint16
	Intensity                     Intensity
	LapTrigger                    LapTrigger
	Sport                         Sport
	EventGroup                    uint8
	NumLengths                    uint16 // # of lengths of swim pool
	NormalizedPower               uint16
	LeftRightBalance              LeftRightBalance100
	FirstLengthIndex              uint16
	AvgStrokeDistance             uint16
	SwimStroke                    SwimStroke
	SubSport                      SubSport
	NumActiveLengths              uint16 // # of active lengths of swim pool
	TotalWork                     uint32
	AvgAltitude                   uint16
	MaxAltitude                   uint16
	GpsAccuracy                   uint8
	AvgGrade                      int16
	AvgPosGrade                   int16
	AvgNegGrade                   int16
	MaxPosGrade                   int16
	MaxNegGrade                   int16
	AvgTemperature                int8
	MaxTemperature                int8
	TotalMovingTime               uint32
	AvgPosVerticalSpeed           int16
	AvgNegVerticalSpeed           int16
	MaxPosVerticalSpeed           int16
	MaxNegVerticalSpeed           int16
	TimeInHrZone                  []uint32
	TimeInSpeedZone               []uint32
	TimeInCadenceZone             []uint32
	TimeInPowerZone               []uint32
	RepetitionNum                 uint16
	MinAltitude                   uint16
	MinHeartRate                  uint8
	WktStepIndex                  MessageIndex
	OpponentScore                 uint16
	StrokeCount                   []uint16 // stroke_type enum used as the index
	ZoneCount                     []uint16 // zone number used as the index
	AvgVerticalOscillation        uint16
	AvgStanceTimePercent          uint16
	AvgStanceTime                 uint16
	AvgFractionalCadence          uint8 // fractional part of the avg_cadence
	MaxFractionalCadence          uint8 // fractional part of the max_cadence
	TotalFractionalCycles         uint8 // fractional part of the total_cycles
	PlayerScore                   uint16
	AvgTotalHemoglobinConc        []uint16 // Avg saturated and unsaturated hemoglobin
	MinTotalHemoglobinConc        []uint16 // Min saturated and unsaturated hemoglobin
	MaxTotalHemoglobinConc        []uint16 // Max saturated and unsaturated hemoglobin
	AvgSaturatedHemoglobinPercent []uint16 // Avg percentage of hemoglobin saturated with oxygen
	MinSaturatedHemoglobinPercent []uint16 // Min percentage of hemoglobin saturated with oxygen
	MaxSaturatedHemoglobinPercent []uint16 // Max percentage of hemoglobin saturated with oxygen
	EnhancedAvgSpeed              uint32
	EnhancedMaxSpeed              uint32
	EnhancedAvgAltitude           uint32
	EnhancedMinAltitude           uint32
	EnhancedMaxAltitude           uint32
}

LapMsg represents the lap FIT message type.

func (*LapMsg) GetAvgAltitudeScaled

func (x *LapMsg) GetAvgAltitudeScaled() float64

GetAvgAltitudeScaled returns AvgAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetAvgCadence

func (x *LapMsg) GetAvgCadence() interface{}

GetAvgCadence returns the appropriate AvgCadence subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*LapMsg) GetAvgFractionalCadenceScaled

func (x *LapMsg) GetAvgFractionalCadenceScaled() float64

GetAvgFractionalCadenceScaled returns AvgFractionalCadence with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*LapMsg) GetAvgGradeScaled

func (x *LapMsg) GetAvgGradeScaled() float64

GetAvgGradeScaled returns AvgGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*LapMsg) GetAvgNegGradeScaled

func (x *LapMsg) GetAvgNegGradeScaled() float64

GetAvgNegGradeScaled returns AvgNegGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*LapMsg) GetAvgNegVerticalSpeedScaled

func (x *LapMsg) GetAvgNegVerticalSpeedScaled() float64

GetAvgNegVerticalSpeedScaled returns AvgNegVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetAvgPosGradeScaled

func (x *LapMsg) GetAvgPosGradeScaled() float64

GetAvgPosGradeScaled returns AvgPosGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*LapMsg) GetAvgPosVerticalSpeedScaled

func (x *LapMsg) GetAvgPosVerticalSpeedScaled() float64

GetAvgPosVerticalSpeedScaled returns AvgPosVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetAvgSaturatedHemoglobinPercentScaled

func (x *LapMsg) GetAvgSaturatedHemoglobinPercentScaled() []float64

GetAvgSaturatedHemoglobinPercentScaled returns AvgSaturatedHemoglobinPercent as a slice with scale and any offset applied to every element. Units: %

func (*LapMsg) GetAvgSpeedScaled

func (x *LapMsg) GetAvgSpeedScaled() float64

GetAvgSpeedScaled returns AvgSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetAvgStanceTimePercentScaled

func (x *LapMsg) GetAvgStanceTimePercentScaled() float64

GetAvgStanceTimePercentScaled returns AvgStanceTimePercent with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*LapMsg) GetAvgStanceTimeScaled

func (x *LapMsg) GetAvgStanceTimeScaled() float64

GetAvgStanceTimeScaled returns AvgStanceTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: ms

func (*LapMsg) GetAvgStrokeDistanceScaled

func (x *LapMsg) GetAvgStrokeDistanceScaled() float64

GetAvgStrokeDistanceScaled returns AvgStrokeDistance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetAvgTotalHemoglobinConcScaled

func (x *LapMsg) GetAvgTotalHemoglobinConcScaled() []float64

GetAvgTotalHemoglobinConcScaled returns AvgTotalHemoglobinConc as a slice with scale and any offset applied to every element. Units: g/dL

func (*LapMsg) GetAvgVerticalOscillationScaled

func (x *LapMsg) GetAvgVerticalOscillationScaled() float64

GetAvgVerticalOscillationScaled returns AvgVerticalOscillation with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: mm

func (*LapMsg) GetEnhancedAvgAltitudeScaled

func (x *LapMsg) GetEnhancedAvgAltitudeScaled() float64

GetEnhancedAvgAltitudeScaled returns EnhancedAvgAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetEnhancedAvgSpeedScaled

func (x *LapMsg) GetEnhancedAvgSpeedScaled() float64

GetEnhancedAvgSpeedScaled returns EnhancedAvgSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetEnhancedMaxAltitudeScaled

func (x *LapMsg) GetEnhancedMaxAltitudeScaled() float64

GetEnhancedMaxAltitudeScaled returns EnhancedMaxAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetEnhancedMaxSpeedScaled

func (x *LapMsg) GetEnhancedMaxSpeedScaled() float64

GetEnhancedMaxSpeedScaled returns EnhancedMaxSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetEnhancedMinAltitudeScaled

func (x *LapMsg) GetEnhancedMinAltitudeScaled() float64

GetEnhancedMinAltitudeScaled returns EnhancedMinAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetMaxAltitudeScaled

func (x *LapMsg) GetMaxAltitudeScaled() float64

GetMaxAltitudeScaled returns MaxAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetMaxCadence

func (x *LapMsg) GetMaxCadence() interface{}

GetMaxCadence returns the appropriate MaxCadence subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*LapMsg) GetMaxFractionalCadenceScaled

func (x *LapMsg) GetMaxFractionalCadenceScaled() float64

GetMaxFractionalCadenceScaled returns MaxFractionalCadence with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*LapMsg) GetMaxNegGradeScaled

func (x *LapMsg) GetMaxNegGradeScaled() float64

GetMaxNegGradeScaled returns MaxNegGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*LapMsg) GetMaxNegVerticalSpeedScaled

func (x *LapMsg) GetMaxNegVerticalSpeedScaled() float64

GetMaxNegVerticalSpeedScaled returns MaxNegVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetMaxPosGradeScaled

func (x *LapMsg) GetMaxPosGradeScaled() float64

GetMaxPosGradeScaled returns MaxPosGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*LapMsg) GetMaxPosVerticalSpeedScaled

func (x *LapMsg) GetMaxPosVerticalSpeedScaled() float64

GetMaxPosVerticalSpeedScaled returns MaxPosVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetMaxSaturatedHemoglobinPercentScaled

func (x *LapMsg) GetMaxSaturatedHemoglobinPercentScaled() []float64

GetMaxSaturatedHemoglobinPercentScaled returns MaxSaturatedHemoglobinPercent as a slice with scale and any offset applied to every element. Units: %

func (*LapMsg) GetMaxSpeedScaled

func (x *LapMsg) GetMaxSpeedScaled() float64

GetMaxSpeedScaled returns MaxSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LapMsg) GetMaxTotalHemoglobinConcScaled

func (x *LapMsg) GetMaxTotalHemoglobinConcScaled() []float64

GetMaxTotalHemoglobinConcScaled returns MaxTotalHemoglobinConc as a slice with scale and any offset applied to every element. Units: g/dL

func (*LapMsg) GetMinAltitudeScaled

func (x *LapMsg) GetMinAltitudeScaled() float64

GetMinAltitudeScaled returns MinAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetMinSaturatedHemoglobinPercentScaled

func (x *LapMsg) GetMinSaturatedHemoglobinPercentScaled() []float64

GetMinSaturatedHemoglobinPercentScaled returns MinSaturatedHemoglobinPercent as a slice with scale and any offset applied to every element. Units: %

func (*LapMsg) GetMinTotalHemoglobinConcScaled

func (x *LapMsg) GetMinTotalHemoglobinConcScaled() []float64

GetMinTotalHemoglobinConcScaled returns MinTotalHemoglobinConc as a slice with scale and any offset applied to every element. Units: g/dL

func (*LapMsg) GetTimeInCadenceZoneScaled

func (x *LapMsg) GetTimeInCadenceZoneScaled() []float64

GetTimeInCadenceZoneScaled returns TimeInCadenceZone as a slice with scale and any offset applied to every element. Units: s

func (*LapMsg) GetTimeInHrZoneScaled

func (x *LapMsg) GetTimeInHrZoneScaled() []float64

GetTimeInHrZoneScaled returns TimeInHrZone as a slice with scale and any offset applied to every element. Units: s

func (*LapMsg) GetTimeInPowerZoneScaled

func (x *LapMsg) GetTimeInPowerZoneScaled() []float64

GetTimeInPowerZoneScaled returns TimeInPowerZone as a slice with scale and any offset applied to every element. Units: s

func (*LapMsg) GetTimeInSpeedZoneScaled

func (x *LapMsg) GetTimeInSpeedZoneScaled() []float64

GetTimeInSpeedZoneScaled returns TimeInSpeedZone as a slice with scale and any offset applied to every element. Units: s

func (*LapMsg) GetTotalCycles

func (x *LapMsg) GetTotalCycles() interface{}

GetTotalCycles returns the appropriate TotalCycles subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*LapMsg) GetTotalDistanceScaled

func (x *LapMsg) GetTotalDistanceScaled() float64

GetTotalDistanceScaled returns TotalDistance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*LapMsg) GetTotalElapsedTimeScaled

func (x *LapMsg) GetTotalElapsedTimeScaled() float64

GetTotalElapsedTimeScaled returns TotalElapsedTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*LapMsg) GetTotalFractionalCyclesScaled

func (x *LapMsg) GetTotalFractionalCyclesScaled() float64

GetTotalFractionalCyclesScaled returns TotalFractionalCycles with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: cycles

func (*LapMsg) GetTotalMovingTimeScaled

func (x *LapMsg) GetTotalMovingTimeScaled() float64

GetTotalMovingTimeScaled returns TotalMovingTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*LapMsg) GetTotalTimerTimeScaled

func (x *LapMsg) GetTotalTimerTimeScaled() float64

GetTotalTimerTimeScaled returns TotalTimerTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

type LapTrigger

type LapTrigger byte

LapTrigger represents the lap_trigger FIT type.

const (
	LapTriggerManual           LapTrigger = 0
	LapTriggerTime             LapTrigger = 1
	LapTriggerDistance         LapTrigger = 2
	LapTriggerPositionStart    LapTrigger = 3
	LapTriggerPositionLap      LapTrigger = 4
	LapTriggerPositionWaypoint LapTrigger = 5
	LapTriggerPositionMarked   LapTrigger = 6
	LapTriggerSessionEnd       LapTrigger = 7
	LapTriggerFitnessEquipment LapTrigger = 8
	LapTriggerInvalid          LapTrigger = 0xFF
)

func (LapTrigger) String

func (i LapTrigger) String() string

type Latitude

type Latitude struct {
	// contains filtered or unexported fields
}

Latitude represents the geographical coordinate latitude.

func NewLatitude

func NewLatitude(semicircles int32) Latitude

NewLatitude returns a new latitude from a semicircle. If semicircles is outside the range of a latitude, (math.MinInt32/2, math.MaxInt32/2) then an invalid latitude is returned.

func NewLatitudeDegrees

func NewLatitudeDegrees(degrees float64) Latitude

NewLatitudeDegrees returns a new latitude from a degree. If degrees is outside the range of a latitude (+/- 90°) then an invalid latitude is returned.

func NewLatitudeInvalid

func NewLatitudeInvalid() Latitude

NewLatitudeInvalid returns an invalid latitude. The underlying storage is set to the invalid value of the FIT base type (sint32) used to represent a latitude.

func (Latitude) Degrees

func (l Latitude) Degrees() float64

Degrees returns l in degrees. If l is invalid then NaN is returned.

func (Latitude) Semicircles

func (l Latitude) Semicircles() int32

Semicircles returns l in semicircles.

func (Latitude) String

func (l Latitude) String() string

String returns a string representation of l in degrees with 5 decimal places. If l is invalid then the string "Invalid" is returned.

type LeftRightBalance

type LeftRightBalance uint8

LeftRightBalance represents the left_right_balance FIT type.

const (
	LeftRightBalanceMask    LeftRightBalance = 0x7F // % contribution
	LeftRightBalanceRight   LeftRightBalance = 0x80 // data corresponds to right if set, otherwise unknown
	LeftRightBalanceInvalid LeftRightBalance = 0xFF
)

func (LeftRightBalance) String

func (i LeftRightBalance) String() string

type LeftRightBalance100

type LeftRightBalance100 uint16

LeftRightBalance100 represents the left_right_balance_100 FIT type.

const (
	LeftRightBalance100Mask    LeftRightBalance100 = 0x3FFF // % contribution scaled by 100
	LeftRightBalance100Right   LeftRightBalance100 = 0x8000 // data corresponds to right if set, otherwise unknown
	LeftRightBalance100Invalid LeftRightBalance100 = 0xFFFF
)

func (LeftRightBalance100) String

func (i LeftRightBalance100) String() string

type LengthMsg

type LengthMsg struct {
	MessageIndex       MessageIndex
	Timestamp          time.Time
	Event              Event
	EventType          EventType
	StartTime          time.Time
	TotalElapsedTime   uint32
	TotalTimerTime     uint32
	TotalStrokes       uint16
	AvgSpeed           uint16
	SwimStroke         SwimStroke
	AvgSwimmingCadence uint8
	EventGroup         uint8
	TotalCalories      uint16
	LengthType         LengthType
	PlayerScore        uint16
	OpponentScore      uint16
	StrokeCount        []uint16 // stroke_type enum used as the index
	ZoneCount          []uint16 // zone number used as the index
}

LengthMsg represents the length FIT message type.

func (*LengthMsg) GetAvgSpeedScaled

func (x *LengthMsg) GetAvgSpeedScaled() float64

GetAvgSpeedScaled returns AvgSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*LengthMsg) GetTotalElapsedTimeScaled

func (x *LengthMsg) GetTotalElapsedTimeScaled() float64

GetTotalElapsedTimeScaled returns TotalElapsedTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*LengthMsg) GetTotalTimerTimeScaled

func (x *LengthMsg) GetTotalTimerTimeScaled() float64

GetTotalTimerTimeScaled returns TotalTimerTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

type LengthType

type LengthType byte

LengthType represents the length_type FIT type.

const (
	LengthTypeIdle    LengthType = 0 // Rest period. Length with no strokes
	LengthTypeActive  LengthType = 1 // Length with strokes.
	LengthTypeInvalid LengthType = 0xFF
)

func (LengthType) String

func (i LengthType) String() string

type Longitude

type Longitude struct {
	// contains filtered or unexported fields
}

Longitude represents the geographical coordinate longitude.

func NewLongitude

func NewLongitude(semicircles int32) Longitude

NewLongitude returns a new longitude from a semicircle.

func NewLongitudeDegrees

func NewLongitudeDegrees(degrees float64) Longitude

NewLongitudeDegrees returns a new longitude from a degree. If degrees is outside the range of a longitude (+/- 180°) then an invalid longitude is returned.

func NewLongitudeInvalid

func NewLongitudeInvalid() Longitude

NewLongitudeInvalid returns an invalid longitude. The underlying storage is set to the invalid value of the FIT base type (sint32) used to represent a longitude.

func (Longitude) Degrees

func (l Longitude) Degrees() float64

Degrees returns l in degrees. If l is invalid then NaN is returned.

func (Longitude) Semicircles

func (l Longitude) Semicircles() int32

Semicircles returns l in semicircles.

func (Longitude) String

func (l Longitude) String() string

String returns a string representation of l in degrees with 5 decimal places. If l is invalid then the string "Invalid" is returned.

type Manufacturer

type Manufacturer uint16

Manufacturer represents the manufacturer FIT type.

const (
	ManufacturerGarmin                 Manufacturer = 1
	ManufacturerGarminFr405Antfs       Manufacturer = 2 // Do not use.  Used by FR405 for ANTFS man id.
	ManufacturerZephyr                 Manufacturer = 3
	ManufacturerDayton                 Manufacturer = 4
	ManufacturerIdt                    Manufacturer = 5
	ManufacturerSrm                    Manufacturer = 6
	ManufacturerQuarq                  Manufacturer = 7
	ManufacturerIbike                  Manufacturer = 8
	ManufacturerSaris                  Manufacturer = 9
	ManufacturerSparkHk                Manufacturer = 10
	ManufacturerTanita                 Manufacturer = 11
	ManufacturerEchowell               Manufacturer = 12
	ManufacturerDynastreamOem          Manufacturer = 13
	ManufacturerNautilus               Manufacturer = 14
	ManufacturerDynastream             Manufacturer = 15
	ManufacturerTimex                  Manufacturer = 16
	ManufacturerMetrigear              Manufacturer = 17
	ManufacturerXelic                  Manufacturer = 18
	ManufacturerBeurer                 Manufacturer = 19
	ManufacturerCardiosport            Manufacturer = 20
	ManufacturerAAndD                  Manufacturer = 21
	ManufacturerHmm                    Manufacturer = 22
	ManufacturerSuunto                 Manufacturer = 23
	ManufacturerThitaElektronik        Manufacturer = 24
	ManufacturerGpulse                 Manufacturer = 25
	ManufacturerCleanMobile            Manufacturer = 26
	ManufacturerPedalBrain             Manufacturer = 27
	ManufacturerPeaksware              Manufacturer = 28
	ManufacturerSaxonar                Manufacturer = 29
	ManufacturerLemondFitness          Manufacturer = 30
	ManufacturerDexcom                 Manufacturer = 31
	ManufacturerWahooFitness           Manufacturer = 32
	ManufacturerOctaneFitness          Manufacturer = 33
	ManufacturerArchinoetics           Manufacturer = 34
	ManufacturerTheHurtBox             Manufacturer = 35
	ManufacturerCitizenSystems         Manufacturer = 36
	ManufacturerMagellan               Manufacturer = 37
	ManufacturerOsynce                 Manufacturer = 38
	ManufacturerHolux                  Manufacturer = 39
	ManufacturerConcept2               Manufacturer = 40
	ManufacturerOneGiantLeap           Manufacturer = 42
	ManufacturerAceSensor              Manufacturer = 43
	ManufacturerBrimBrothers           Manufacturer = 44
	ManufacturerXplova                 Manufacturer = 45
	ManufacturerPerceptionDigital      Manufacturer = 46
	ManufacturerBf1systems             Manufacturer = 47
	ManufacturerPioneer                Manufacturer = 48
	ManufacturerSpantec                Manufacturer = 49
	ManufacturerMetalogics             Manufacturer = 50
	Manufacturer4iiiis                 Manufacturer = 51
	ManufacturerSeikoEpson             Manufacturer = 52
	ManufacturerSeikoEpsonOem          Manufacturer = 53
	ManufacturerIforPowell             Manufacturer = 54
	ManufacturerMaxwellGuider          Manufacturer = 55
	ManufacturerStarTrac               Manufacturer = 56
	ManufacturerBreakaway              Manufacturer = 57
	ManufacturerAlatechTechnologyLtd   Manufacturer = 58
	ManufacturerMioTechnologyEurope    Manufacturer = 59
	ManufacturerRotor                  Manufacturer = 60
	ManufacturerGeonaute               Manufacturer = 61
	ManufacturerIdBike                 Manufacturer = 62
	ManufacturerSpecialized            Manufacturer = 63
	ManufacturerWtek                   Manufacturer = 64
	ManufacturerPhysicalEnterprises    Manufacturer = 65
	ManufacturerNorthPoleEngineering   Manufacturer = 66
	ManufacturerBkool                  Manufacturer = 67
	ManufacturerCateye                 Manufacturer = 68
	ManufacturerStagesCycling          Manufacturer = 69
	ManufacturerSigmasport             Manufacturer = 70
	ManufacturerTomtom                 Manufacturer = 71
	ManufacturerPeripedal              Manufacturer = 72
	ManufacturerWattbike               Manufacturer = 73
	ManufacturerMoxy                   Manufacturer = 76
	ManufacturerCiclosport             Manufacturer = 77
	ManufacturerPowerbahn              Manufacturer = 78
	ManufacturerAcornProjectsAps       Manufacturer = 79
	ManufacturerLifebeam               Manufacturer = 80
	ManufacturerBontrager              Manufacturer = 81
	ManufacturerWellgo                 Manufacturer = 82
	ManufacturerScosche                Manufacturer = 83
	ManufacturerMagura                 Manufacturer = 84
	ManufacturerWoodway                Manufacturer = 85
	ManufacturerElite                  Manufacturer = 86
	ManufacturerNielsenKellerman       Manufacturer = 87
	ManufacturerDkCity                 Manufacturer = 88
	ManufacturerTacx                   Manufacturer = 89
	ManufacturerDirectionTechnology    Manufacturer = 90
	ManufacturerMagtonic               Manufacturer = 91
	Manufacturer1partcarbon            Manufacturer = 92
	ManufacturerInsideRideTechnologies Manufacturer = 93
	ManufacturerSoundOfMotion          Manufacturer = 94
	ManufacturerStryd                  Manufacturer = 95
	ManufacturerIcg                    Manufacturer = 96 // Indoorcycling Group
	ManufacturerMiPulse                Manufacturer = 97
	ManufacturerBsxAthletics           Manufacturer = 98
	ManufacturerLook                   Manufacturer = 99
	ManufacturerDevelopment            Manufacturer = 255
	ManufacturerHealthandlife          Manufacturer = 257
	ManufacturerLezyne                 Manufacturer = 258
	ManufacturerScribeLabs             Manufacturer = 259
	ManufacturerZwift                  Manufacturer = 260
	ManufacturerWatteam                Manufacturer = 261
	ManufacturerRecon                  Manufacturer = 262
	ManufacturerFaveroElectronics      Manufacturer = 263
	ManufacturerDynovelo               Manufacturer = 264
	ManufacturerStrava                 Manufacturer = 265
	ManufacturerActigraphcorp          Manufacturer = 5759
	ManufacturerInvalid                Manufacturer = 0xFFFF
)

func (Manufacturer) String

func (i Manufacturer) String() string

type MemoGlobMsg

type MemoGlobMsg struct {
}

MemoGlobMsg represents the memo_glob FIT message type.

type MesgCapabilitiesMsg

type MesgCapabilitiesMsg struct {
	MessageIndex MessageIndex
	File         File
	MesgNum      MesgNum
	CountType    MesgCount
	Count        uint16
}

MesgCapabilitiesMsg represents the mesg_capabilities FIT message type.

func (*MesgCapabilitiesMsg) GetCount

func (x *MesgCapabilitiesMsg) GetCount() interface{}

GetCount returns the appropriate Count subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

type MesgCount

type MesgCount byte

MesgCount represents the mesg_count FIT type.

const (
	MesgCountNumPerFile     MesgCount = 0
	MesgCountMaxPerFile     MesgCount = 1
	MesgCountMaxPerFileType MesgCount = 2
	MesgCountInvalid        MesgCount = 0xFF
)

func (MesgCount) String

func (i MesgCount) String() string

type MesgNum

type MesgNum uint16

MesgNum represents the mesg_num FIT type.

const (
	MesgNumFileId                  MesgNum = 0
	MesgNumCapabilities            MesgNum = 1
	MesgNumDeviceSettings          MesgNum = 2
	MesgNumUserProfile             MesgNum = 3
	MesgNumHrmProfile              MesgNum = 4
	MesgNumSdmProfile              MesgNum = 5
	MesgNumBikeProfile             MesgNum = 6
	MesgNumZonesTarget             MesgNum = 7
	MesgNumHrZone                  MesgNum = 8
	MesgNumPowerZone               MesgNum = 9
	MesgNumMetZone                 MesgNum = 10
	MesgNumSport                   MesgNum = 12
	MesgNumGoal                    MesgNum = 15
	MesgNumSession                 MesgNum = 18
	MesgNumLap                     MesgNum = 19
	MesgNumRecord                  MesgNum = 20
	MesgNumEvent                   MesgNum = 21
	MesgNumDeviceInfo              MesgNum = 23
	MesgNumWorkout                 MesgNum = 26
	MesgNumWorkoutStep             MesgNum = 27
	MesgNumSchedule                MesgNum = 28
	MesgNumWeightScale             MesgNum = 30
	MesgNumCourse                  MesgNum = 31
	MesgNumCoursePoint             MesgNum = 32
	MesgNumTotals                  MesgNum = 33
	MesgNumActivity                MesgNum = 34
	MesgNumSoftware                MesgNum = 35
	MesgNumFileCapabilities        MesgNum = 37
	MesgNumMesgCapabilities        MesgNum = 38
	MesgNumFieldCapabilities       MesgNum = 39
	MesgNumFileCreator             MesgNum = 49
	MesgNumBloodPressure           MesgNum = 51
	MesgNumSpeedZone               MesgNum = 53
	MesgNumMonitoring              MesgNum = 55
	MesgNumTrainingFile            MesgNum = 72
	MesgNumHrv                     MesgNum = 78
	MesgNumLength                  MesgNum = 101
	MesgNumMonitoringInfo          MesgNum = 103
	MesgNumPad                     MesgNum = 105
	MesgNumSlaveDevice             MesgNum = 106
	MesgNumCadenceZone             MesgNum = 131
	MesgNumSegmentLap              MesgNum = 142
	MesgNumMemoGlob                MesgNum = 145
	MesgNumSegmentId               MesgNum = 148
	MesgNumSegmentLeaderboardEntry MesgNum = 149
	MesgNumSegmentPoint            MesgNum = 150
	MesgNumSegmentFile             MesgNum = 151
	MesgNumGpsMetadata             MesgNum = 160
	MesgNumCameraEvent             MesgNum = 161
	MesgNumTimestampCorrelation    MesgNum = 162
	MesgNumGyroscopeData           MesgNum = 164
	MesgNumAccelerometerData       MesgNum = 165
	MesgNumThreeDSensorCalibration MesgNum = 167
	MesgNumVideoFrame              MesgNum = 169
	MesgNumObdiiData               MesgNum = 174
	MesgNumNmeaSentence            MesgNum = 177
	MesgNumAviationAttitude        MesgNum = 178
	MesgNumVideo                   MesgNum = 184
	MesgNumVideoTitle              MesgNum = 185
	MesgNumVideoDescription        MesgNum = 186
	MesgNumVideoClip               MesgNum = 187
	MesgNumMfgRangeMin             MesgNum = 0xFF00 // 0xFF00 - 0xFFFE reserved for manufacturer specific messages
	MesgNumMfgRangeMax             MesgNum = 0xFFFE // 0xFF00 - 0xFFFE reserved for manufacturer specific messages
	MesgNumInvalid                 MesgNum = 0xFFFF
)

func (MesgNum) String

func (i MesgNum) String() string

type MessageIndex

type MessageIndex uint16

MessageIndex represents the message_index FIT type.

const (
	MessageIndexSelected MessageIndex = 0x8000 // message is selected if set
	MessageIndexReserved MessageIndex = 0x7000 // reserved (default 0)
	MessageIndexMask     MessageIndex = 0x0FFF // index
	MessageIndexInvalid  MessageIndex = 0xFFFF
)

func (MessageIndex) String

func (i MessageIndex) String() string

type MetZoneMsg

type MetZoneMsg struct {
	MessageIndex MessageIndex
	HighBpm      uint8
	Calories     uint16
	FatCalories  uint8
}

MetZoneMsg represents the met_zone FIT message type.

func (*MetZoneMsg) GetCaloriesScaled

func (x *MetZoneMsg) GetCaloriesScaled() float64

GetCaloriesScaled returns Calories with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kcal / min

func (*MetZoneMsg) GetFatCaloriesScaled

func (x *MetZoneMsg) GetFatCaloriesScaled() float64

GetFatCaloriesScaled returns FatCalories with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kcal / min

type MonitoringAFile

type MonitoringAFile struct {
	MonitoringInfo *MonitoringInfoMsg
	Monitorings    []*MonitoringMsg
}

MonitoringAFile represents the MonitoringA FIT file type. Records detailed monitoring data (i.e. logging interval < 24 Hr).

type MonitoringBFile

type MonitoringBFile struct {
	MonitoringInfo *MonitoringInfoMsg
	Monitorings    []*MonitoringMsg
}

MonitoringBFile represents the MonitoringB FIT file type. Records detailed monitoring data (i.e. logging interval < 24 Hr).

type MonitoringDailyFile

type MonitoringDailyFile struct {
	MonitoringInfo *MonitoringInfoMsg
	Monitorings    []*MonitoringMsg
}

MonitoringDailyFile represents the Daily Monitoring FIT file type. Records daily summary monitoring data (i.e. logging interval = 24 hour).

type MonitoringInfoMsg

type MonitoringInfoMsg struct {
	Timestamp      time.Time
	LocalTimestamp time.Time // Use to convert activity timestamps to local time if device does not support time zone and daylight savings time correction.
}

MonitoringInfoMsg represents the monitoring_info FIT message type.

type MonitoringMsg

type MonitoringMsg struct {
	Timestamp       time.Time   // Must align to logging interval, for example, time must be 00:00:00 for daily log.
	DeviceIndex     DeviceIndex // Associates this data to device_info message.  Not required for file with single device (sensor).
	Calories        uint16      // Accumulated total calories.  Maintained by MonitoringReader for each activity_type.  See SDK documentation
	Distance        uint32      // Accumulated distance.  Maintained by MonitoringReader for each activity_type.  See SDK documentation.
	Cycles          uint32      // Accumulated cycles.  Maintained by MonitoringReader for each activity_type.  See SDK documentation.
	ActiveTime      uint32
	ActivityType    ActivityType
	ActivitySubtype ActivitySubtype
	Distance16      uint16
	Cycles16        uint16
	ActiveTime16    uint16
	LocalTimestamp  time.Time // Must align to logging interval, for example, time must be 00:00:00 for daily log.
}

MonitoringMsg represents the monitoring FIT message type.

func (*MonitoringMsg) GetActiveTimeScaled

func (x *MonitoringMsg) GetActiveTimeScaled() float64

GetActiveTimeScaled returns ActiveTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*MonitoringMsg) GetCycles

func (x *MonitoringMsg) GetCycles() interface{}

GetCycles returns the appropriate Cycles subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*MonitoringMsg) GetCyclesScaled

func (x *MonitoringMsg) GetCyclesScaled() float64

GetCyclesScaled returns Cycles with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: cycles

func (*MonitoringMsg) GetDistanceScaled

func (x *MonitoringMsg) GetDistanceScaled() float64

GetDistanceScaled returns Distance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

type NmeaSentenceMsg

type NmeaSentenceMsg struct {
	Timestamp   time.Time // Timestamp message was output
	TimestampMs uint16    // Fractional part of timestamp, added to timestamp
	Sentence    string    // NMEA sentence
}

NmeaSentenceMsg represents the nmea_sentence FIT message type.

type NotSupportedError

type NotSupportedError string

A NotSupportedError reports that the input uses a valid but unimplemented FIT feature.

func (NotSupportedError) Error

func (e NotSupportedError) Error() string

type ObdiiDataMsg

type ObdiiDataMsg struct {
}

ObdiiDataMsg represents the obdii_data FIT message type.

type PowerPhaseType

type PowerPhaseType byte

PowerPhaseType represents the power_phase_type FIT type.

const (
	PowerPhaseTypePowerPhaseStartAngle PowerPhaseType = 0
	PowerPhaseTypePowerPhaseEndAngle   PowerPhaseType = 1
	PowerPhaseTypePowerPhaseArcLength  PowerPhaseType = 2
	PowerPhaseTypePowerPhaseCenter     PowerPhaseType = 3
	PowerPhaseTypeInvalid              PowerPhaseType = 0xFF
)

func (PowerPhaseType) String

func (i PowerPhaseType) String() string

type PowerZoneMsg

type PowerZoneMsg struct {
	MessageIndex MessageIndex
	HighValue    uint16
	Name         string
}

PowerZoneMsg represents the power_zone FIT message type.

type PwrZoneCalc

type PwrZoneCalc byte

PwrZoneCalc represents the pwr_zone_calc FIT type.

const (
	PwrZoneCalcCustom     PwrZoneCalc = 0
	PwrZoneCalcPercentFtp PwrZoneCalc = 1
	PwrZoneCalcInvalid    PwrZoneCalc = 0xFF
)

func (PwrZoneCalc) String

func (i PwrZoneCalc) String() string

type RecordMsg

type RecordMsg struct {
	Timestamp                     time.Time
	PositionLat                   Latitude
	PositionLong                  Longitude
	Altitude                      uint16
	HeartRate                     uint8
	Cadence                       uint8
	Distance                      uint32
	Speed                         uint16
	Power                         uint16
	CompressedSpeedDistance       []byte
	Grade                         int16
	Resistance                    uint8 // Relative. 0 is none  254 is Max.
	TimeFromCourse                int32
	CycleLength                   uint8
	Temperature                   int8
	Speed1s                       []uint8 // Speed at 1s intervals.  Timestamp field indicates time of last array element.
	Cycles                        uint8
	TotalCycles                   uint32
	CompressedAccumulatedPower    uint16
	AccumulatedPower              uint32
	LeftRightBalance              LeftRightBalance
	GpsAccuracy                   uint8
	VerticalSpeed                 int16
	Calories                      uint16
	VerticalOscillation           uint16
	StanceTimePercent             uint16
	StanceTime                    uint16
	ActivityType                  ActivityType
	LeftTorqueEffectiveness       uint8
	RightTorqueEffectiveness      uint8
	LeftPedalSmoothness           uint8
	RightPedalSmoothness          uint8
	CombinedPedalSmoothness       uint8
	Time128                       uint8
	StrokeType                    StrokeType
	Zone                          uint8
	BallSpeed                     uint16
	Cadence256                    uint16 // Log cadence and fractional cadence for backwards compatability
	FractionalCadence             uint8
	TotalHemoglobinConc           uint16 // Total saturated and unsaturated hemoglobin
	TotalHemoglobinConcMin        uint16 // Min saturated and unsaturated hemoglobin
	TotalHemoglobinConcMax        uint16 // Max saturated and unsaturated hemoglobin
	SaturatedHemoglobinPercent    uint16 // Percentage of hemoglobin saturated with oxygen
	SaturatedHemoglobinPercentMin uint16 // Min percentage of hemoglobin saturated with oxygen
	SaturatedHemoglobinPercentMax uint16 // Max percentage of hemoglobin saturated with oxygen
	DeviceIndex                   DeviceIndex
	EnhancedSpeed                 uint32
	EnhancedAltitude              uint32
}

RecordMsg represents the record FIT message type.

func (*RecordMsg) GetAltitudeScaled

func (x *RecordMsg) GetAltitudeScaled() float64

GetAltitudeScaled returns Altitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*RecordMsg) GetBallSpeedScaled

func (x *RecordMsg) GetBallSpeedScaled() float64

GetBallSpeedScaled returns BallSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*RecordMsg) GetCadence256Scaled

func (x *RecordMsg) GetCadence256Scaled() float64

GetCadence256Scaled returns Cadence256 with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*RecordMsg) GetCombinedPedalSmoothnessScaled

func (x *RecordMsg) GetCombinedPedalSmoothnessScaled() float64

GetCombinedPedalSmoothnessScaled returns CombinedPedalSmoothness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*RecordMsg) GetCycleLengthScaled

func (x *RecordMsg) GetCycleLengthScaled() float64

GetCycleLengthScaled returns CycleLength with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*RecordMsg) GetDistanceFromCompressedSpeedDistance

func (x *RecordMsg) GetDistanceFromCompressedSpeedDistance() float64

GetDistanceFromCompressedSpeedDistance returns Distance with the scale and offset defined by the "Distance" component in the CompressedSpeedDistance field. NaN is if the field has an invalid value (i.e. has not been set).

func (*RecordMsg) GetDistanceScaled

func (x *RecordMsg) GetDistanceScaled() float64

GetDistanceScaled returns Distance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*RecordMsg) GetEnhancedAltitudeScaled

func (x *RecordMsg) GetEnhancedAltitudeScaled() float64

GetEnhancedAltitudeScaled returns EnhancedAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*RecordMsg) GetEnhancedSpeedScaled

func (x *RecordMsg) GetEnhancedSpeedScaled() float64

GetEnhancedSpeedScaled returns EnhancedSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*RecordMsg) GetFractionalCadenceScaled

func (x *RecordMsg) GetFractionalCadenceScaled() float64

GetFractionalCadenceScaled returns FractionalCadence with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*RecordMsg) GetGradeScaled

func (x *RecordMsg) GetGradeScaled() float64

GetGradeScaled returns Grade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*RecordMsg) GetLeftPedalSmoothnessScaled

func (x *RecordMsg) GetLeftPedalSmoothnessScaled() float64

GetLeftPedalSmoothnessScaled returns LeftPedalSmoothness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*RecordMsg) GetLeftTorqueEffectivenessScaled

func (x *RecordMsg) GetLeftTorqueEffectivenessScaled() float64

GetLeftTorqueEffectivenessScaled returns LeftTorqueEffectiveness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*RecordMsg) GetRightPedalSmoothnessScaled

func (x *RecordMsg) GetRightPedalSmoothnessScaled() float64

GetRightPedalSmoothnessScaled returns RightPedalSmoothness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*RecordMsg) GetRightTorqueEffectivenessScaled

func (x *RecordMsg) GetRightTorqueEffectivenessScaled() float64

GetRightTorqueEffectivenessScaled returns RightTorqueEffectiveness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*RecordMsg) GetSaturatedHemoglobinPercentMaxScaled

func (x *RecordMsg) GetSaturatedHemoglobinPercentMaxScaled() float64

GetSaturatedHemoglobinPercentMaxScaled returns SaturatedHemoglobinPercentMax with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*RecordMsg) GetSaturatedHemoglobinPercentMinScaled

func (x *RecordMsg) GetSaturatedHemoglobinPercentMinScaled() float64

GetSaturatedHemoglobinPercentMinScaled returns SaturatedHemoglobinPercentMin with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*RecordMsg) GetSaturatedHemoglobinPercentScaled

func (x *RecordMsg) GetSaturatedHemoglobinPercentScaled() float64

GetSaturatedHemoglobinPercentScaled returns SaturatedHemoglobinPercent with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*RecordMsg) GetSpeed1sScaled

func (x *RecordMsg) GetSpeed1sScaled() []float64

GetSpeed1sScaled returns Speed1s as a slice with scale and any offset applied to every element. Units: m/s

func (*RecordMsg) GetSpeedFromCompressedSpeedDistance

func (x *RecordMsg) GetSpeedFromCompressedSpeedDistance() float64

GetSpeedFromCompressedSpeedDistance returns Speed with the scale and offset defined by the "Speed" component in the CompressedSpeedDistance field. NaN is if the field has an invalid value (i.e. has not been set).

func (*RecordMsg) GetSpeedScaled

func (x *RecordMsg) GetSpeedScaled() float64

GetSpeedScaled returns Speed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*RecordMsg) GetStanceTimePercentScaled

func (x *RecordMsg) GetStanceTimePercentScaled() float64

GetStanceTimePercentScaled returns StanceTimePercent with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*RecordMsg) GetStanceTimeScaled

func (x *RecordMsg) GetStanceTimeScaled() float64

GetStanceTimeScaled returns StanceTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: ms

func (*RecordMsg) GetTime128Scaled

func (x *RecordMsg) GetTime128Scaled() float64

GetTime128Scaled returns Time128 with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*RecordMsg) GetTimeFromCourseScaled

func (x *RecordMsg) GetTimeFromCourseScaled() float64

GetTimeFromCourseScaled returns TimeFromCourse with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*RecordMsg) GetTotalHemoglobinConcMaxScaled

func (x *RecordMsg) GetTotalHemoglobinConcMaxScaled() float64

GetTotalHemoglobinConcMaxScaled returns TotalHemoglobinConcMax with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: g/dL

func (*RecordMsg) GetTotalHemoglobinConcMinScaled

func (x *RecordMsg) GetTotalHemoglobinConcMinScaled() float64

GetTotalHemoglobinConcMinScaled returns TotalHemoglobinConcMin with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: g/dL

func (*RecordMsg) GetTotalHemoglobinConcScaled

func (x *RecordMsg) GetTotalHemoglobinConcScaled() float64

GetTotalHemoglobinConcScaled returns TotalHemoglobinConc with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: g/dL

func (*RecordMsg) GetVerticalOscillationScaled

func (x *RecordMsg) GetVerticalOscillationScaled() float64

GetVerticalOscillationScaled returns VerticalOscillation with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: mm

func (*RecordMsg) GetVerticalSpeedScaled

func (x *RecordMsg) GetVerticalSpeedScaled() float64

GetVerticalSpeedScaled returns VerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

type RiderPositionType

type RiderPositionType byte

RiderPositionType represents the rider_position_type FIT type.

const (
	RiderPositionTypeSeated   RiderPositionType = 0
	RiderPositionTypeStanding RiderPositionType = 1
	RiderPositionTypeInvalid  RiderPositionType = 0xFF
)

func (RiderPositionType) String

func (i RiderPositionType) String() string

type Schedule

type Schedule byte

Schedule represents the schedule FIT type.

const (
	ScheduleWorkout Schedule = 0
	ScheduleCourse  Schedule = 1
	ScheduleInvalid Schedule = 0xFF
)

func (Schedule) String

func (i Schedule) String() string

type ScheduleMsg

type ScheduleMsg struct {
	Manufacturer  Manufacturer // Corresponds to file_id of scheduled workout / course.
	Product       uint16       // Corresponds to file_id of scheduled workout / course.
	SerialNumber  uint32       // Corresponds to file_id of scheduled workout / course.
	TimeCreated   time.Time    // Corresponds to file_id of scheduled workout / course.
	Completed     Bool         // TRUE if this activity has been started
	Type          Schedule
	ScheduledTime time.Time
}

ScheduleMsg represents the schedule FIT message type.

func (*ScheduleMsg) GetProduct

func (x *ScheduleMsg) GetProduct() interface{}

GetProduct returns the appropriate Product subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

type SchedulesFile

type SchedulesFile struct {
	Schedules []*ScheduleMsg
}

SchedulesFile represents the Schedules FIT file type. Provides scheduling of workouts and courses.

type SdmProfileMsg

type SdmProfileMsg struct {
	MessageIndex      MessageIndex
	Enabled           Bool
	SdmAntId          uint16
	SdmCalFactor      uint16
	Odometer          uint32
	SpeedSource       Bool // Use footpod for speed source instead of GPS
	SdmAntIdTransType uint8
	OdometerRollover  uint8 // Rollover counter that can be used to extend the odometer
}

SdmProfileMsg represents the sdm_profile FIT message type.

func (*SdmProfileMsg) GetOdometerScaled

func (x *SdmProfileMsg) GetOdometerScaled() float64

GetOdometerScaled returns Odometer with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SdmProfileMsg) GetSdmCalFactorScaled

func (x *SdmProfileMsg) GetSdmCalFactorScaled() float64

GetSdmCalFactorScaled returns SdmCalFactor with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

type SegmentDeleteStatus

type SegmentDeleteStatus byte

SegmentDeleteStatus represents the segment_delete_status FIT type.

const (
	SegmentDeleteStatusDoNotDelete SegmentDeleteStatus = 0
	SegmentDeleteStatusDeleteOne   SegmentDeleteStatus = 1
	SegmentDeleteStatusDeleteAll   SegmentDeleteStatus = 2
	SegmentDeleteStatusInvalid     SegmentDeleteStatus = 0xFF
)

func (SegmentDeleteStatus) String

func (i SegmentDeleteStatus) String() string

type SegmentFile

type SegmentFile struct {
	SegmentId               *SegmentIdMsg
	SegmentLeaderboardEntry *SegmentLeaderboardEntryMsg
	SegmentLap              *SegmentLapMsg
	SegmentPoints           []*SegmentPointMsg
}

SegmentFile represents the Segment FIT file type. Describes timing data for virtual races.

type SegmentFileMsg

type SegmentFileMsg struct {
	MessageIndex          MessageIndex
	FileUuid              string                   // UUID of the segment file
	Enabled               Bool                     // Enabled state of the segment file
	UserProfilePrimaryKey uint32                   // Primary key of the user that created the segment file
	LeaderType            []SegmentLeaderboardType // Leader type of each leader in the segment file
	LeaderGroupPrimaryKey []uint32                 // Group primary key of each leader in the segment file
	LeaderActivityId      []uint32                 // Activity ID of each leader in the segment file
}

SegmentFileMsg represents the segment_file FIT message type.

type SegmentIdMsg

type SegmentIdMsg struct {
	Name                  string               // Friendly name assigned to segment
	Uuid                  string               // UUID of the segment
	Sport                 Sport                // Sport associated with the segment
	Enabled               Bool                 // Segment enabled for evaluation
	UserProfilePrimaryKey uint32               // Primary key of the user that created the segment
	DeviceId              uint32               // ID of the device that created the segment
	DefaultRaceLeader     uint8                // Index for the Leader Board entry selected as the default race participant
	DeleteStatus          SegmentDeleteStatus  // Indicates if any segments should be deleted
	SelectionType         SegmentSelectionType // Indicates how the segment was selected to be sent to the device
}

SegmentIdMsg represents the segment_id FIT message type.

type SegmentLapMsg

type SegmentLapMsg struct {
	MessageIndex                MessageIndex
	Timestamp                   time.Time // Lap end time.
	Event                       Event
	EventType                   EventType
	StartTime                   time.Time
	StartPositionLat            Latitude
	StartPositionLong           Longitude
	EndPositionLat              Latitude
	EndPositionLong             Longitude
	TotalElapsedTime            uint32 // Time (includes pauses)
	TotalTimerTime              uint32 // Timer Time (excludes pauses)
	TotalDistance               uint32
	TotalCycles                 uint32
	TotalCalories               uint16
	TotalFatCalories            uint16 // If New Leaf
	AvgSpeed                    uint16
	MaxSpeed                    uint16
	AvgHeartRate                uint8
	MaxHeartRate                uint8
	AvgCadence                  uint8 // total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time
	MaxCadence                  uint8
	AvgPower                    uint16 // total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time
	MaxPower                    uint16
	TotalAscent                 uint16
	TotalDescent                uint16
	Sport                       Sport
	EventGroup                  uint8
	NecLat                      Latitude  // North east corner latitude.
	NecLong                     Longitude // North east corner longitude.
	SwcLat                      Latitude  // South west corner latitude.
	SwcLong                     Longitude // South west corner latitude.
	Name                        string
	NormalizedPower             uint16
	LeftRightBalance            LeftRightBalance100
	SubSport                    SubSport
	TotalWork                   uint32
	AvgAltitude                 uint16
	MaxAltitude                 uint16
	GpsAccuracy                 uint8
	AvgGrade                    int16
	AvgPosGrade                 int16
	AvgNegGrade                 int16
	MaxPosGrade                 int16
	MaxNegGrade                 int16
	AvgTemperature              int8
	MaxTemperature              int8
	TotalMovingTime             uint32
	AvgPosVerticalSpeed         int16
	AvgNegVerticalSpeed         int16
	MaxPosVerticalSpeed         int16
	MaxNegVerticalSpeed         int16
	TimeInHrZone                []uint32
	TimeInSpeedZone             []uint32
	TimeInCadenceZone           []uint32
	TimeInPowerZone             []uint32
	RepetitionNum               uint16
	MinAltitude                 uint16
	MinHeartRate                uint8
	ActiveTime                  uint32
	WktStepIndex                MessageIndex
	SportEvent                  SportEvent
	AvgLeftTorqueEffectiveness  uint8
	AvgRightTorqueEffectiveness uint8
	AvgLeftPedalSmoothness      uint8
	AvgRightPedalSmoothness     uint8
	AvgCombinedPedalSmoothness  uint8
	Status                      SegmentLapStatus
	Uuid                        string
	AvgFractionalCadence        uint8 // fractional part of the avg_cadence
	MaxFractionalCadence        uint8 // fractional part of the max_cadence
	TotalFractionalCycles       uint8 // fractional part of the total_cycles
	FrontGearShiftCount         uint16
	RearGearShiftCount          uint16
}

SegmentLapMsg represents the segment_lap FIT message type.

func (*SegmentLapMsg) GetActiveTimeScaled

func (x *SegmentLapMsg) GetActiveTimeScaled() float64

GetActiveTimeScaled returns ActiveTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*SegmentLapMsg) GetAvgAltitudeScaled

func (x *SegmentLapMsg) GetAvgAltitudeScaled() float64

GetAvgAltitudeScaled returns AvgAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SegmentLapMsg) GetAvgCombinedPedalSmoothnessScaled

func (x *SegmentLapMsg) GetAvgCombinedPedalSmoothnessScaled() float64

GetAvgCombinedPedalSmoothnessScaled returns AvgCombinedPedalSmoothness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*SegmentLapMsg) GetAvgFractionalCadenceScaled

func (x *SegmentLapMsg) GetAvgFractionalCadenceScaled() float64

GetAvgFractionalCadenceScaled returns AvgFractionalCadence with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*SegmentLapMsg) GetAvgGradeScaled

func (x *SegmentLapMsg) GetAvgGradeScaled() float64

GetAvgGradeScaled returns AvgGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SegmentLapMsg) GetAvgLeftPedalSmoothnessScaled

func (x *SegmentLapMsg) GetAvgLeftPedalSmoothnessScaled() float64

GetAvgLeftPedalSmoothnessScaled returns AvgLeftPedalSmoothness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*SegmentLapMsg) GetAvgLeftTorqueEffectivenessScaled

func (x *SegmentLapMsg) GetAvgLeftTorqueEffectivenessScaled() float64

GetAvgLeftTorqueEffectivenessScaled returns AvgLeftTorqueEffectiveness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*SegmentLapMsg) GetAvgNegGradeScaled

func (x *SegmentLapMsg) GetAvgNegGradeScaled() float64

GetAvgNegGradeScaled returns AvgNegGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SegmentLapMsg) GetAvgNegVerticalSpeedScaled

func (x *SegmentLapMsg) GetAvgNegVerticalSpeedScaled() float64

GetAvgNegVerticalSpeedScaled returns AvgNegVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SegmentLapMsg) GetAvgPosGradeScaled

func (x *SegmentLapMsg) GetAvgPosGradeScaled() float64

GetAvgPosGradeScaled returns AvgPosGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SegmentLapMsg) GetAvgPosVerticalSpeedScaled

func (x *SegmentLapMsg) GetAvgPosVerticalSpeedScaled() float64

GetAvgPosVerticalSpeedScaled returns AvgPosVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SegmentLapMsg) GetAvgRightPedalSmoothnessScaled

func (x *SegmentLapMsg) GetAvgRightPedalSmoothnessScaled() float64

GetAvgRightPedalSmoothnessScaled returns AvgRightPedalSmoothness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*SegmentLapMsg) GetAvgRightTorqueEffectivenessScaled

func (x *SegmentLapMsg) GetAvgRightTorqueEffectivenessScaled() float64

GetAvgRightTorqueEffectivenessScaled returns AvgRightTorqueEffectiveness with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*SegmentLapMsg) GetAvgSpeedScaled

func (x *SegmentLapMsg) GetAvgSpeedScaled() float64

GetAvgSpeedScaled returns AvgSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SegmentLapMsg) GetMaxAltitudeScaled

func (x *SegmentLapMsg) GetMaxAltitudeScaled() float64

GetMaxAltitudeScaled returns MaxAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SegmentLapMsg) GetMaxFractionalCadenceScaled

func (x *SegmentLapMsg) GetMaxFractionalCadenceScaled() float64

GetMaxFractionalCadenceScaled returns MaxFractionalCadence with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*SegmentLapMsg) GetMaxNegGradeScaled

func (x *SegmentLapMsg) GetMaxNegGradeScaled() float64

GetMaxNegGradeScaled returns MaxNegGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SegmentLapMsg) GetMaxNegVerticalSpeedScaled

func (x *SegmentLapMsg) GetMaxNegVerticalSpeedScaled() float64

GetMaxNegVerticalSpeedScaled returns MaxNegVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SegmentLapMsg) GetMaxPosGradeScaled

func (x *SegmentLapMsg) GetMaxPosGradeScaled() float64

GetMaxPosGradeScaled returns MaxPosGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SegmentLapMsg) GetMaxPosVerticalSpeedScaled

func (x *SegmentLapMsg) GetMaxPosVerticalSpeedScaled() float64

GetMaxPosVerticalSpeedScaled returns MaxPosVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SegmentLapMsg) GetMaxSpeedScaled

func (x *SegmentLapMsg) GetMaxSpeedScaled() float64

GetMaxSpeedScaled returns MaxSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SegmentLapMsg) GetMinAltitudeScaled

func (x *SegmentLapMsg) GetMinAltitudeScaled() float64

GetMinAltitudeScaled returns MinAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SegmentLapMsg) GetTimeInCadenceZoneScaled

func (x *SegmentLapMsg) GetTimeInCadenceZoneScaled() []float64

GetTimeInCadenceZoneScaled returns TimeInCadenceZone as a slice with scale and any offset applied to every element. Units: s

func (*SegmentLapMsg) GetTimeInHrZoneScaled

func (x *SegmentLapMsg) GetTimeInHrZoneScaled() []float64

GetTimeInHrZoneScaled returns TimeInHrZone as a slice with scale and any offset applied to every element. Units: s

func (*SegmentLapMsg) GetTimeInPowerZoneScaled

func (x *SegmentLapMsg) GetTimeInPowerZoneScaled() []float64

GetTimeInPowerZoneScaled returns TimeInPowerZone as a slice with scale and any offset applied to every element. Units: s

func (*SegmentLapMsg) GetTimeInSpeedZoneScaled

func (x *SegmentLapMsg) GetTimeInSpeedZoneScaled() []float64

GetTimeInSpeedZoneScaled returns TimeInSpeedZone as a slice with scale and any offset applied to every element. Units: s

func (*SegmentLapMsg) GetTotalCycles

func (x *SegmentLapMsg) GetTotalCycles() interface{}

GetTotalCycles returns the appropriate TotalCycles subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*SegmentLapMsg) GetTotalDistanceScaled

func (x *SegmentLapMsg) GetTotalDistanceScaled() float64

GetTotalDistanceScaled returns TotalDistance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SegmentLapMsg) GetTotalElapsedTimeScaled

func (x *SegmentLapMsg) GetTotalElapsedTimeScaled() float64

GetTotalElapsedTimeScaled returns TotalElapsedTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*SegmentLapMsg) GetTotalFractionalCyclesScaled

func (x *SegmentLapMsg) GetTotalFractionalCyclesScaled() float64

GetTotalFractionalCyclesScaled returns TotalFractionalCycles with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: cycles

func (*SegmentLapMsg) GetTotalMovingTimeScaled

func (x *SegmentLapMsg) GetTotalMovingTimeScaled() float64

GetTotalMovingTimeScaled returns TotalMovingTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*SegmentLapMsg) GetTotalTimerTimeScaled

func (x *SegmentLapMsg) GetTotalTimerTimeScaled() float64

GetTotalTimerTimeScaled returns TotalTimerTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

type SegmentLapStatus

type SegmentLapStatus byte

SegmentLapStatus represents the segment_lap_status FIT type.

const (
	SegmentLapStatusEnd     SegmentLapStatus = 0
	SegmentLapStatusFail    SegmentLapStatus = 1
	SegmentLapStatusInvalid SegmentLapStatus = 0xFF
)

func (SegmentLapStatus) String

func (i SegmentLapStatus) String() string

type SegmentLeaderboardEntryMsg

type SegmentLeaderboardEntryMsg struct {
	MessageIndex    MessageIndex
	Name            string                 // Friendly name assigned to leader
	Type            SegmentLeaderboardType // Leader classification
	GroupPrimaryKey uint32                 // Primary user ID of this leader
	ActivityId      uint32                 // ID of the activity associated with this leader time
	SegmentTime     uint32                 // Segment Time (includes pauses)
}

SegmentLeaderboardEntryMsg represents the segment_leaderboard_entry FIT message type.

func (*SegmentLeaderboardEntryMsg) GetSegmentTimeScaled

func (x *SegmentLeaderboardEntryMsg) GetSegmentTimeScaled() float64

GetSegmentTimeScaled returns SegmentTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

type SegmentLeaderboardType

type SegmentLeaderboardType byte

SegmentLeaderboardType represents the segment_leaderboard_type FIT type.

const (
	SegmentLeaderboardTypeOverall      SegmentLeaderboardType = 0
	SegmentLeaderboardTypePersonalBest SegmentLeaderboardType = 1
	SegmentLeaderboardTypeConnections  SegmentLeaderboardType = 2
	SegmentLeaderboardTypeGroup        SegmentLeaderboardType = 3
	SegmentLeaderboardTypeChallenger   SegmentLeaderboardType = 4
	SegmentLeaderboardTypeKom          SegmentLeaderboardType = 5
	SegmentLeaderboardTypeQom          SegmentLeaderboardType = 6
	SegmentLeaderboardTypePr           SegmentLeaderboardType = 7
	SegmentLeaderboardTypeGoal         SegmentLeaderboardType = 8
	SegmentLeaderboardTypeRival        SegmentLeaderboardType = 9
	SegmentLeaderboardTypeClubLeader   SegmentLeaderboardType = 10
	SegmentLeaderboardTypeInvalid      SegmentLeaderboardType = 0xFF
)

func (SegmentLeaderboardType) String

func (i SegmentLeaderboardType) String() string

type SegmentListFile

type SegmentListFile struct {
	SegmentFiles []*SegmentFileMsg
}

SegmentListFile represents the Segment List FIT file type. Describes available segments.

type SegmentPointMsg

type SegmentPointMsg struct {
	MessageIndex MessageIndex
	PositionLat  Latitude
	PositionLong Longitude
	Distance     uint32   // Accumulated distance along the segment at the described point
	Altitude     uint16   // Accumulated altitude along the segment at the described point
	LeaderTime   []uint32 // Accumualted time each leader board member required to reach the described point. This value is zero for all leader board members at the starting point of the segment.
}

SegmentPointMsg represents the segment_point FIT message type.

func (*SegmentPointMsg) GetAltitudeScaled

func (x *SegmentPointMsg) GetAltitudeScaled() float64

GetAltitudeScaled returns Altitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SegmentPointMsg) GetDistanceScaled

func (x *SegmentPointMsg) GetDistanceScaled() float64

GetDistanceScaled returns Distance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SegmentPointMsg) GetLeaderTimeScaled

func (x *SegmentPointMsg) GetLeaderTimeScaled() []float64

GetLeaderTimeScaled returns LeaderTime as a slice with scale and any offset applied to every element. Units: s

type SegmentSelectionType

type SegmentSelectionType byte

SegmentSelectionType represents the segment_selection_type FIT type.

const (
	SegmentSelectionTypeStarred   SegmentSelectionType = 0
	SegmentSelectionTypeSuggested SegmentSelectionType = 1
	SegmentSelectionTypeInvalid   SegmentSelectionType = 0xFF
)

func (SegmentSelectionType) String

func (i SegmentSelectionType) String() string

type SensorType

type SensorType byte

SensorType represents the sensor_type FIT type.

const (
	SensorTypeAccelerometer SensorType = 0
	SensorTypeGyroscope     SensorType = 1
	SensorTypeCompass       SensorType = 2
	SensorTypeInvalid       SensorType = 0xFF
)

func (SensorType) String

func (i SensorType) String() string

type SessionMsg

type SessionMsg struct {
	MessageIndex           MessageIndex // Selected bit is set for the current session.
	Timestamp              time.Time    // Sesson end time.
	Event                  Event        // session
	EventType              EventType    // stop
	StartTime              time.Time
	StartPositionLat       Latitude
	StartPositionLong      Longitude
	Sport                  Sport
	SubSport               SubSport
	TotalElapsedTime       uint32 // Time (includes pauses)
	TotalTimerTime         uint32 // Timer Time (excludes pauses)
	TotalDistance          uint32
	TotalCycles            uint32
	TotalCalories          uint16
	TotalFatCalories       uint16
	AvgSpeed               uint16 // total_distance / total_timer_time
	MaxSpeed               uint16
	AvgHeartRate           uint8 // average heart rate (excludes pause time)
	MaxHeartRate           uint8
	AvgCadence             uint8 // total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time
	MaxCadence             uint8
	AvgPower               uint16 // total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time
	MaxPower               uint16
	TotalAscent            uint16
	TotalDescent           uint16
	TotalTrainingEffect    uint8
	FirstLapIndex          uint16
	NumLaps                uint16
	EventGroup             uint8
	Trigger                SessionTrigger
	NecLat                 Latitude
	NecLong                Longitude
	SwcLat                 Latitude
	SwcLong                Longitude
	NormalizedPower        uint16
	TrainingStressScore    uint16
	IntensityFactor        uint16
	LeftRightBalance       LeftRightBalance100
	AvgStrokeCount         uint32
	AvgStrokeDistance      uint16
	SwimStroke             SwimStroke
	PoolLength             uint16
	ThresholdPower         uint16
	PoolLengthUnit         DisplayMeasure
	NumActiveLengths       uint16 // # of active lengths of swim pool
	TotalWork              uint32
	AvgAltitude            uint16
	MaxAltitude            uint16
	GpsAccuracy            uint8
	AvgGrade               int16
	AvgPosGrade            int16
	AvgNegGrade            int16
	MaxPosGrade            int16
	MaxNegGrade            int16
	AvgTemperature         int8
	MaxTemperature         int8
	TotalMovingTime        uint32
	AvgPosVerticalSpeed    int16
	AvgNegVerticalSpeed    int16
	MaxPosVerticalSpeed    int16
	MaxNegVerticalSpeed    int16
	MinHeartRate           uint8
	TimeInHrZone           []uint32
	TimeInSpeedZone        []uint32
	TimeInCadenceZone      []uint32
	TimeInPowerZone        []uint32
	AvgLapTime             uint32
	BestLapIndex           uint16
	MinAltitude            uint16
	PlayerScore            uint16
	OpponentScore          uint16
	OpponentName           string
	StrokeCount            []uint16 // stroke_type enum used as the index
	ZoneCount              []uint16 // zone number used as the index
	MaxBallSpeed           uint16
	AvgBallSpeed           uint16
	AvgVerticalOscillation uint16
	AvgStanceTimePercent   uint16
	AvgStanceTime          uint16
	AvgFractionalCadence   uint8 // fractional part of the avg_cadence
	MaxFractionalCadence   uint8 // fractional part of the max_cadence
	TotalFractionalCycles  uint8 // fractional part of the total_cycles
	SportIndex             uint8
	EnhancedAvgSpeed       uint32 // total_distance / total_timer_time
	EnhancedMaxSpeed       uint32
	EnhancedAvgAltitude    uint32
	EnhancedMinAltitude    uint32
	EnhancedMaxAltitude    uint32
}

SessionMsg represents the session FIT message type.

func (*SessionMsg) GetAvgAltitudeScaled

func (x *SessionMsg) GetAvgAltitudeScaled() float64

GetAvgAltitudeScaled returns AvgAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetAvgBallSpeedScaled

func (x *SessionMsg) GetAvgBallSpeedScaled() float64

GetAvgBallSpeedScaled returns AvgBallSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetAvgCadence

func (x *SessionMsg) GetAvgCadence() interface{}

GetAvgCadence returns the appropriate AvgCadence subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*SessionMsg) GetAvgFractionalCadenceScaled

func (x *SessionMsg) GetAvgFractionalCadenceScaled() float64

GetAvgFractionalCadenceScaled returns AvgFractionalCadence with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*SessionMsg) GetAvgGradeScaled

func (x *SessionMsg) GetAvgGradeScaled() float64

GetAvgGradeScaled returns AvgGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SessionMsg) GetAvgLapTimeScaled

func (x *SessionMsg) GetAvgLapTimeScaled() float64

GetAvgLapTimeScaled returns AvgLapTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*SessionMsg) GetAvgNegGradeScaled

func (x *SessionMsg) GetAvgNegGradeScaled() float64

GetAvgNegGradeScaled returns AvgNegGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SessionMsg) GetAvgNegVerticalSpeedScaled

func (x *SessionMsg) GetAvgNegVerticalSpeedScaled() float64

GetAvgNegVerticalSpeedScaled returns AvgNegVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetAvgPosGradeScaled

func (x *SessionMsg) GetAvgPosGradeScaled() float64

GetAvgPosGradeScaled returns AvgPosGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SessionMsg) GetAvgPosVerticalSpeedScaled

func (x *SessionMsg) GetAvgPosVerticalSpeedScaled() float64

GetAvgPosVerticalSpeedScaled returns AvgPosVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetAvgSpeedScaled

func (x *SessionMsg) GetAvgSpeedScaled() float64

GetAvgSpeedScaled returns AvgSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetAvgStanceTimePercentScaled

func (x *SessionMsg) GetAvgStanceTimePercentScaled() float64

GetAvgStanceTimePercentScaled returns AvgStanceTimePercent with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: percent

func (*SessionMsg) GetAvgStanceTimeScaled

func (x *SessionMsg) GetAvgStanceTimeScaled() float64

GetAvgStanceTimeScaled returns AvgStanceTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: ms

func (*SessionMsg) GetAvgStrokeCountScaled

func (x *SessionMsg) GetAvgStrokeCountScaled() float64

GetAvgStrokeCountScaled returns AvgStrokeCount with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: strokes/lap

func (*SessionMsg) GetAvgStrokeDistanceScaled

func (x *SessionMsg) GetAvgStrokeDistanceScaled() float64

GetAvgStrokeDistanceScaled returns AvgStrokeDistance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetAvgVerticalOscillationScaled

func (x *SessionMsg) GetAvgVerticalOscillationScaled() float64

GetAvgVerticalOscillationScaled returns AvgVerticalOscillation with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: mm

func (*SessionMsg) GetEnhancedAvgAltitudeScaled

func (x *SessionMsg) GetEnhancedAvgAltitudeScaled() float64

GetEnhancedAvgAltitudeScaled returns EnhancedAvgAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetEnhancedAvgSpeedScaled

func (x *SessionMsg) GetEnhancedAvgSpeedScaled() float64

GetEnhancedAvgSpeedScaled returns EnhancedAvgSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetEnhancedMaxAltitudeScaled

func (x *SessionMsg) GetEnhancedMaxAltitudeScaled() float64

GetEnhancedMaxAltitudeScaled returns EnhancedMaxAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetEnhancedMaxSpeedScaled

func (x *SessionMsg) GetEnhancedMaxSpeedScaled() float64

GetEnhancedMaxSpeedScaled returns EnhancedMaxSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetEnhancedMinAltitudeScaled

func (x *SessionMsg) GetEnhancedMinAltitudeScaled() float64

GetEnhancedMinAltitudeScaled returns EnhancedMinAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetIntensityFactorScaled

func (x *SessionMsg) GetIntensityFactorScaled() float64

GetIntensityFactorScaled returns IntensityFactor with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: if

func (*SessionMsg) GetMaxAltitudeScaled

func (x *SessionMsg) GetMaxAltitudeScaled() float64

GetMaxAltitudeScaled returns MaxAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetMaxBallSpeedScaled

func (x *SessionMsg) GetMaxBallSpeedScaled() float64

GetMaxBallSpeedScaled returns MaxBallSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetMaxCadence

func (x *SessionMsg) GetMaxCadence() interface{}

GetMaxCadence returns the appropriate MaxCadence subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*SessionMsg) GetMaxFractionalCadenceScaled

func (x *SessionMsg) GetMaxFractionalCadenceScaled() float64

GetMaxFractionalCadenceScaled returns MaxFractionalCadence with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: rpm

func (*SessionMsg) GetMaxNegGradeScaled

func (x *SessionMsg) GetMaxNegGradeScaled() float64

GetMaxNegGradeScaled returns MaxNegGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SessionMsg) GetMaxNegVerticalSpeedScaled

func (x *SessionMsg) GetMaxNegVerticalSpeedScaled() float64

GetMaxNegVerticalSpeedScaled returns MaxNegVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetMaxPosGradeScaled

func (x *SessionMsg) GetMaxPosGradeScaled() float64

GetMaxPosGradeScaled returns MaxPosGrade with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*SessionMsg) GetMaxPosVerticalSpeedScaled

func (x *SessionMsg) GetMaxPosVerticalSpeedScaled() float64

GetMaxPosVerticalSpeedScaled returns MaxPosVerticalSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetMaxSpeedScaled

func (x *SessionMsg) GetMaxSpeedScaled() float64

GetMaxSpeedScaled returns MaxSpeed with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

func (*SessionMsg) GetMinAltitudeScaled

func (x *SessionMsg) GetMinAltitudeScaled() float64

GetMinAltitudeScaled returns MinAltitude with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetPoolLengthScaled

func (x *SessionMsg) GetPoolLengthScaled() float64

GetPoolLengthScaled returns PoolLength with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetTimeInCadenceZoneScaled

func (x *SessionMsg) GetTimeInCadenceZoneScaled() []float64

GetTimeInCadenceZoneScaled returns TimeInCadenceZone as a slice with scale and any offset applied to every element. Units: s

func (*SessionMsg) GetTimeInHrZoneScaled

func (x *SessionMsg) GetTimeInHrZoneScaled() []float64

GetTimeInHrZoneScaled returns TimeInHrZone as a slice with scale and any offset applied to every element. Units: s

func (*SessionMsg) GetTimeInPowerZoneScaled

func (x *SessionMsg) GetTimeInPowerZoneScaled() []float64

GetTimeInPowerZoneScaled returns TimeInPowerZone as a slice with scale and any offset applied to every element. Units: s

func (*SessionMsg) GetTimeInSpeedZoneScaled

func (x *SessionMsg) GetTimeInSpeedZoneScaled() []float64

GetTimeInSpeedZoneScaled returns TimeInSpeedZone as a slice with scale and any offset applied to every element. Units: s

func (*SessionMsg) GetTotalCycles

func (x *SessionMsg) GetTotalCycles() interface{}

GetTotalCycles returns the appropriate TotalCycles subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*SessionMsg) GetTotalDistanceScaled

func (x *SessionMsg) GetTotalDistanceScaled() float64

GetTotalDistanceScaled returns TotalDistance with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*SessionMsg) GetTotalElapsedTimeScaled

func (x *SessionMsg) GetTotalElapsedTimeScaled() float64

GetTotalElapsedTimeScaled returns TotalElapsedTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*SessionMsg) GetTotalFractionalCyclesScaled

func (x *SessionMsg) GetTotalFractionalCyclesScaled() float64

GetTotalFractionalCyclesScaled returns TotalFractionalCycles with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: cycles

func (*SessionMsg) GetTotalMovingTimeScaled

func (x *SessionMsg) GetTotalMovingTimeScaled() float64

GetTotalMovingTimeScaled returns TotalMovingTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*SessionMsg) GetTotalTimerTimeScaled

func (x *SessionMsg) GetTotalTimerTimeScaled() float64

GetTotalTimerTimeScaled returns TotalTimerTime with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: s

func (*SessionMsg) GetTotalTrainingEffectScaled

func (x *SessionMsg) GetTotalTrainingEffectScaled() float64

GetTotalTrainingEffectScaled returns TotalTrainingEffect with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set).

func (*SessionMsg) GetTrainingStressScoreScaled

func (x *SessionMsg) GetTrainingStressScoreScaled() float64

GetTrainingStressScoreScaled returns TrainingStressScore with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: tss

type SessionTrigger

type SessionTrigger byte

SessionTrigger represents the session_trigger FIT type.

const (
	SessionTriggerActivityEnd      SessionTrigger = 0
	SessionTriggerManual           SessionTrigger = 1 // User changed sport.
	SessionTriggerAutoMultiSport   SessionTrigger = 2 // Auto multi-sport feature is enabled and user pressed lap button to advance session.
	SessionTriggerFitnessEquipment SessionTrigger = 3 // Auto sport change caused by user linking to fitness equipment.
	SessionTriggerInvalid          SessionTrigger = 0xFF
)

func (SessionTrigger) String

func (i SessionTrigger) String() string

type SettingsFile

type SettingsFile struct {
	UserProfiles   []*UserProfileMsg
	HrmProfiles    []*HrmProfileMsg
	SdmProfiles    []*SdmProfileMsg
	BikeProfiles   []*BikeProfileMsg
	DeviceSettings []*DeviceSettingsMsg
}

SettingsFile represents the Settings FIT file type. Describes a user’s parameters such as Age & Weight as well as device settings.

type SlaveDeviceMsg

type SlaveDeviceMsg struct {
	Manufacturer Manufacturer
	Product      uint16
}

SlaveDeviceMsg represents the slave_device FIT message type.

func (*SlaveDeviceMsg) GetProduct

func (x *SlaveDeviceMsg) GetProduct() interface{}

GetProduct returns the appropriate Product subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

type SoftwareMsg

type SoftwareMsg struct {
	MessageIndex MessageIndex
	Version      uint16
	PartNumber   string
}

SoftwareMsg represents the software FIT message type.

func (*SoftwareMsg) GetVersionScaled

func (x *SoftwareMsg) GetVersionScaled() float64

GetVersionScaled returns Version with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set).

type SourceType

type SourceType byte

SourceType represents the source_type FIT type.

const (
	SourceTypeAnt                SourceType = 0 // External device connected with ANT
	SourceTypeAntplus            SourceType = 1 // External device connected with ANT+
	SourceTypeBluetooth          SourceType = 2 // External device connected with BT
	SourceTypeBluetoothLowEnergy SourceType = 3 // External device connected with BLE
	SourceTypeWifi               SourceType = 4 // External device connected with Wifi
	SourceTypeLocal              SourceType = 5 // Onboard device
	SourceTypeInvalid            SourceType = 0xFF
)

func (SourceType) String

func (i SourceType) String() string

type SpeedZoneMsg

type SpeedZoneMsg struct {
	MessageIndex MessageIndex
	HighValue    uint16
	Name         string
}

SpeedZoneMsg represents the speed_zone FIT message type.

func (*SpeedZoneMsg) GetHighValueScaled

func (x *SpeedZoneMsg) GetHighValueScaled() float64

GetHighValueScaled returns HighValue with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m/s

type Sport

type Sport byte

Sport represents the sport FIT type.

const (
	SportGeneric               Sport = 0
	SportRunning               Sport = 1
	SportCycling               Sport = 2
	SportTransition            Sport = 3 // Mulitsport transition
	SportFitnessEquipment      Sport = 4
	SportSwimming              Sport = 5
	SportBasketball            Sport = 6
	SportSoccer                Sport = 7
	SportTennis                Sport = 8
	SportAmericanFootball      Sport = 9
	SportTraining              Sport = 10
	SportWalking               Sport = 11
	SportCrossCountrySkiing    Sport = 12
	SportAlpineSkiing          Sport = 13
	SportSnowboarding          Sport = 14
	SportRowing                Sport = 15
	SportMountaineering        Sport = 16
	SportHiking                Sport = 17
	SportMultisport            Sport = 18
	SportPaddling              Sport = 19
	SportFlying                Sport = 20
	SportEBiking               Sport = 21
	SportMotorcycling          Sport = 22
	SportBoating               Sport = 23
	SportDriving               Sport = 24
	SportGolf                  Sport = 25
	SportHangGliding           Sport = 26
	SportHorsebackRiding       Sport = 27
	SportHunting               Sport = 28
	SportFishing               Sport = 29
	SportInlineSkating         Sport = 30
	SportRockClimbing          Sport = 31
	SportSailing               Sport = 32
	SportIceSkating            Sport = 33
	SportSkyDiving             Sport = 34
	SportSnowshoeing           Sport = 35
	SportSnowmobiling          Sport = 36
	SportStandUpPaddleboarding Sport = 37
	SportSurfing               Sport = 38
	SportWakeboarding          Sport = 39
	SportWaterSkiing           Sport = 40
	SportKayaking              Sport = 41
	SportRafting               Sport = 42
	SportWindsurfing           Sport = 43
	SportKitesurfing           Sport = 44
	SportAll                   Sport = 254 // All is for goals only to include all sports.
	SportInvalid               Sport = 0xFF
)

func (Sport) String

func (i Sport) String() string

type SportBits0

type SportBits0 uint8

SportBits0 represents the sport_bits_0 FIT type.

const (
	SportBits0Generic          SportBits0 = 0x01
	SportBits0Running          SportBits0 = 0x02
	SportBits0Cycling          SportBits0 = 0x04
	SportBits0Transition       SportBits0 = 0x08 // Mulitsport transition
	SportBits0FitnessEquipment SportBits0 = 0x10
	SportBits0Swimming         SportBits0 = 0x20
	SportBits0Basketball       SportBits0 = 0x40
	SportBits0Soccer           SportBits0 = 0x80
	SportBits0Invalid          SportBits0 = 0x00
)

func (SportBits0) String

func (i SportBits0) String() string

type SportBits1

type SportBits1 uint8

SportBits1 represents the sport_bits_1 FIT type.

const (
	SportBits1Tennis             SportBits1 = 0x01
	SportBits1AmericanFootball   SportBits1 = 0x02
	SportBits1Training           SportBits1 = 0x04
	SportBits1Walking            SportBits1 = 0x08
	SportBits1CrossCountrySkiing SportBits1 = 0x10
	SportBits1AlpineSkiing       SportBits1 = 0x20
	SportBits1Snowboarding       SportBits1 = 0x40
	SportBits1Rowing             SportBits1 = 0x80
	SportBits1Invalid            SportBits1 = 0x00
)

func (SportBits1) String

func (i SportBits1) String() string

type SportBits2

type SportBits2 uint8

SportBits2 represents the sport_bits_2 FIT type.

const (
	SportBits2Mountaineering SportBits2 = 0x01
	SportBits2Hiking         SportBits2 = 0x02
	SportBits2Multisport     SportBits2 = 0x04
	SportBits2Paddling       SportBits2 = 0x08
	SportBits2Flying         SportBits2 = 0x10
	SportBits2EBiking        SportBits2 = 0x20
	SportBits2Motorcycling   SportBits2 = 0x40
	SportBits2Boating        SportBits2 = 0x80
	SportBits2Invalid        SportBits2 = 0x00
)

func (SportBits2) String

func (i SportBits2) String() string

type SportBits3

type SportBits3 uint8

SportBits3 represents the sport_bits_3 FIT type.

const (
	SportBits3Driving         SportBits3 = 0x01
	SportBits3Golf            SportBits3 = 0x02
	SportBits3HangGliding     SportBits3 = 0x04
	SportBits3HorsebackRiding SportBits3 = 0x08
	SportBits3Hunting         SportBits3 = 0x10
	SportBits3Fishing         SportBits3 = 0x20
	SportBits3InlineSkating   SportBits3 = 0x40
	SportBits3RockClimbing    SportBits3 = 0x80
	SportBits3Invalid         SportBits3 = 0x00
)

func (SportBits3) String

func (i SportBits3) String() string

type SportBits4

type SportBits4 uint8

SportBits4 represents the sport_bits_4 FIT type.

const (
	SportBits4Sailing               SportBits4 = 0x01
	SportBits4IceSkating            SportBits4 = 0x02
	SportBits4SkyDiving             SportBits4 = 0x04
	SportBits4Snowshoeing           SportBits4 = 0x08
	SportBits4Snowmobiling          SportBits4 = 0x10
	SportBits4StandUpPaddleboarding SportBits4 = 0x20
	SportBits4Surfing               SportBits4 = 0x40
	SportBits4Wakeboarding          SportBits4 = 0x80
	SportBits4Invalid               SportBits4 = 0x00
)

func (SportBits4) String

func (i SportBits4) String() string

type SportBits5

type SportBits5 uint8

SportBits5 represents the sport_bits_5 FIT type.

const (
	SportBits5WaterSkiing SportBits5 = 0x01
	SportBits5Kayaking    SportBits5 = 0x02
	SportBits5Rafting     SportBits5 = 0x04
	SportBits5Windsurfing SportBits5 = 0x08
	SportBits5Kitesurfing SportBits5 = 0x10
	SportBits5Invalid     SportBits5 = 0x00
)

func (SportBits5) String

func (i SportBits5) String() string

type SportEvent

type SportEvent byte

SportEvent represents the sport_event FIT type.

const (
	SportEventUncategorized  SportEvent = 0
	SportEventGeocaching     SportEvent = 1
	SportEventFitness        SportEvent = 2
	SportEventRecreation     SportEvent = 3
	SportEventRace           SportEvent = 4
	SportEventSpecialEvent   SportEvent = 5
	SportEventTraining       SportEvent = 6
	SportEventTransportation SportEvent = 7
	SportEventTouring        SportEvent = 8
	SportEventInvalid        SportEvent = 0xFF
)

func (SportEvent) String

func (i SportEvent) String() string

type SportFile

type SportFile struct {
	ZonesTarget  *ZonesTargetMsg
	Sport        *SportMsg
	HrZones      []*HrZoneMsg
	PowerZones   []*PowerZoneMsg
	MetZones     []*MetZoneMsg
	SpeedZones   []*SpeedZoneMsg
	CadenceZones []*CadenceZoneMsg
}

SportFile represents the Sport Settings FIT file type. Describes a user’s desired sport/zone settings.

type SportMsg

type SportMsg struct {
	Sport    Sport
	SubSport SubSport
	Name     string
}

SportMsg represents the sport FIT message type.

type StrokeType

type StrokeType byte

StrokeType represents the stroke_type FIT type.

const (
	StrokeTypeNoEvent  StrokeType = 0
	StrokeTypeOther    StrokeType = 1 // stroke was detected but cannot be identified
	StrokeTypeServe    StrokeType = 2
	StrokeTypeForehand StrokeType = 3
	StrokeTypeBackhand StrokeType = 4
	StrokeTypeSmash    StrokeType = 5
	StrokeTypeInvalid  StrokeType = 0xFF
)

func (StrokeType) String

func (i StrokeType) String() string

type SubSport

type SubSport byte

SubSport represents the sub_sport FIT type.

const (
	SubSportGeneric              SubSport = 0
	SubSportTreadmill            SubSport = 1  // Run/Fitness Equipment
	SubSportStreet               SubSport = 2  // Run
	SubSportTrail                SubSport = 3  // Run
	SubSportTrack                SubSport = 4  // Run
	SubSportSpin                 SubSport = 5  // Cycling
	SubSportIndoorCycling        SubSport = 6  // Cycling/Fitness Equipment
	SubSportRoad                 SubSport = 7  // Cycling
	SubSportMountain             SubSport = 8  // Cycling
	SubSportDownhill             SubSport = 9  // Cycling
	SubSportRecumbent            SubSport = 10 // Cycling
	SubSportCyclocross           SubSport = 11 // Cycling
	SubSportHandCycling          SubSport = 12 // Cycling
	SubSportTrackCycling         SubSport = 13 // Cycling
	SubSportIndoorRowing         SubSport = 14 // Fitness Equipment
	SubSportElliptical           SubSport = 15 // Fitness Equipment
	SubSportStairClimbing        SubSport = 16 // Fitness Equipment
	SubSportLapSwimming          SubSport = 17 // Swimming
	SubSportOpenWater            SubSport = 18 // Swimming
	SubSportFlexibilityTraining  SubSport = 19 // Training
	SubSportStrengthTraining     SubSport = 20 // Training
	SubSportWarmUp               SubSport = 21 // Tennis
	SubSportMatch                SubSport = 22 // Tennis
	SubSportExercise             SubSport = 23 // Tennis
	SubSportChallenge            SubSport = 24 // Tennis
	SubSportIndoorSkiing         SubSport = 25 // Fitness Equipment
	SubSportCardioTraining       SubSport = 26 // Training
	SubSportIndoorWalking        SubSport = 27 // Walking/Fitness Equipment
	SubSportEBikeFitness         SubSport = 28 // E-Biking
	SubSportBmx                  SubSport = 29 // Cycling
	SubSportCasualWalking        SubSport = 30 // Walking
	SubSportSpeedWalking         SubSport = 31 // Walking
	SubSportBikeToRunTransition  SubSport = 32 // Transition
	SubSportRunToBikeTransition  SubSport = 33 // Transition
	SubSportSwimToBikeTransition SubSport = 34 // Transition
	SubSportAtv                  SubSport = 35 // Motorcycling
	SubSportMotocross            SubSport = 36 // Motorcycling
	SubSportBackcountry          SubSport = 37 // Alpine Skiing/Snowboarding
	SubSportResort               SubSport = 38 // Alpine Skiing/Snowboarding
	SubSportRcDrone              SubSport = 39 // Flying
	SubSportWingsuit             SubSport = 40 // Flying
	SubSportWhitewater           SubSport = 41 // Kayaking/Rafting
	SubSportAll                  SubSport = 254
	SubSportInvalid              SubSport = 0xFF
)

func (SubSport) String

func (i SubSport) String() string

type SwimStroke

type SwimStroke byte

SwimStroke represents the swim_stroke FIT type.

const (
	SwimStrokeFreestyle    SwimStroke = 0
	SwimStrokeBackstroke   SwimStroke = 1
	SwimStrokeBreaststroke SwimStroke = 2
	SwimStrokeButterfly    SwimStroke = 3
	SwimStrokeDrill        SwimStroke = 4
	SwimStrokeMixed        SwimStroke = 5
	SwimStrokeIm           SwimStroke = 6 // IM is a mixed interval containing the same number of lengths for each of: Butterfly, Backstroke, Breaststroke, Freestyle, swam in that order.
	SwimStrokeInvalid      SwimStroke = 0xFF
)

func (SwimStroke) String

func (i SwimStroke) String() string

type ThreeDSensorCalibrationMsg

type ThreeDSensorCalibrationMsg struct {
}

ThreeDSensorCalibrationMsg represents the three_d_sensor_calibration FIT message type.

type TimeZone

type TimeZone byte

TimeZone represents the time_zone FIT type.

const (
	TimeZoneAlmaty                   TimeZone = 0
	TimeZoneBangkok                  TimeZone = 1
	TimeZoneBombay                   TimeZone = 2
	TimeZoneBrasilia                 TimeZone = 3
	TimeZoneCairo                    TimeZone = 4
	TimeZoneCapeVerdeIs              TimeZone = 5
	TimeZoneDarwin                   TimeZone = 6
	TimeZoneEniwetok                 TimeZone = 7
	TimeZoneFiji                     TimeZone = 8
	TimeZoneHongKong                 TimeZone = 9
	TimeZoneIslamabad                TimeZone = 10
	TimeZoneKabul                    TimeZone = 11
	TimeZoneMagadan                  TimeZone = 12
	TimeZoneMidAtlantic              TimeZone = 13
	TimeZoneMoscow                   TimeZone = 14
	TimeZoneMuscat                   TimeZone = 15
	TimeZoneNewfoundland             TimeZone = 16
	TimeZoneSamoa                    TimeZone = 17
	TimeZoneSydney                   TimeZone = 18
	TimeZoneTehran                   TimeZone = 19
	TimeZoneTokyo                    TimeZone = 20
	TimeZoneUsAlaska                 TimeZone = 21
	TimeZoneUsAtlantic               TimeZone = 22
	TimeZoneUsCentral                TimeZone = 23
	TimeZoneUsEastern                TimeZone = 24
	TimeZoneUsHawaii                 TimeZone = 25
	TimeZoneUsMountain               TimeZone = 26
	TimeZoneUsPacific                TimeZone = 27
	TimeZoneOther                    TimeZone = 28
	TimeZoneAuckland                 TimeZone = 29
	TimeZoneKathmandu                TimeZone = 30
	TimeZoneEuropeWesternWet         TimeZone = 31
	TimeZoneEuropeCentralCet         TimeZone = 32
	TimeZoneEuropeEasternEet         TimeZone = 33
	TimeZoneJakarta                  TimeZone = 34
	TimeZonePerth                    TimeZone = 35
	TimeZoneAdelaide                 TimeZone = 36
	TimeZoneBrisbane                 TimeZone = 37
	TimeZoneTasmania                 TimeZone = 38
	TimeZoneIceland                  TimeZone = 39
	TimeZoneAmsterdam                TimeZone = 40
	TimeZoneAthens                   TimeZone = 41
	TimeZoneBarcelona                TimeZone = 42
	TimeZoneBerlin                   TimeZone = 43
	TimeZoneBrussels                 TimeZone = 44
	TimeZoneBudapest                 TimeZone = 45
	TimeZoneCopenhagen               TimeZone = 46
	TimeZoneDublin                   TimeZone = 47
	TimeZoneHelsinki                 TimeZone = 48
	TimeZoneLisbon                   TimeZone = 49
	TimeZoneLondon                   TimeZone = 50
	TimeZoneMadrid                   TimeZone = 51
	TimeZoneMunich                   TimeZone = 52
	TimeZoneOslo                     TimeZone = 53
	TimeZoneParis                    TimeZone = 54
	TimeZonePrague                   TimeZone = 55
	TimeZoneReykjavik                TimeZone = 56
	TimeZoneRome                     TimeZone = 57
	TimeZoneStockholm                TimeZone = 58
	TimeZoneVienna                   TimeZone = 59
	TimeZoneWarsaw                   TimeZone = 60
	TimeZoneZurich                   TimeZone = 61
	TimeZoneQuebec                   TimeZone = 62
	TimeZoneOntario                  TimeZone = 63
	TimeZoneManitoba                 TimeZone = 64
	TimeZoneSaskatchewan             TimeZone = 65
	TimeZoneAlberta                  TimeZone = 66
	TimeZoneBritishColumbia          TimeZone = 67
	TimeZoneBoise                    TimeZone = 68
	TimeZoneBoston                   TimeZone = 69
	TimeZoneChicago                  TimeZone = 70
	TimeZoneDallas                   TimeZone = 71
	TimeZoneDenver                   TimeZone = 72
	TimeZoneKansasCity               TimeZone = 73
	TimeZoneLasVegas                 TimeZone = 74
	TimeZoneLosAngeles               TimeZone = 75
	TimeZoneMiami                    TimeZone = 76
	TimeZoneMinneapolis              TimeZone = 77
	TimeZoneNewYork                  TimeZone = 78
	TimeZoneNewOrleans               TimeZone = 79
	TimeZonePhoenix                  TimeZone = 80
	TimeZoneSantaFe                  TimeZone = 81
	TimeZoneSeattle                  TimeZone = 82
	TimeZoneWashingtonDc             TimeZone = 83
	TimeZoneUsArizona                TimeZone = 84
	TimeZoneChita                    TimeZone = 85
	TimeZoneEkaterinburg             TimeZone = 86
	TimeZoneIrkutsk                  TimeZone = 87
	TimeZoneKaliningrad              TimeZone = 88
	TimeZoneKrasnoyarsk              TimeZone = 89
	TimeZoneNovosibirsk              TimeZone = 90
	TimeZonePetropavlovskKamchatskiy TimeZone = 91
	TimeZoneSamara                   TimeZone = 92
	TimeZoneVladivostok              TimeZone = 93
	TimeZoneMexicoCentral            TimeZone = 94
	TimeZoneMexicoMountain           TimeZone = 95
	TimeZoneMexicoPacific            TimeZone = 96
	TimeZoneCapeTown                 TimeZone = 97
	TimeZoneWinkhoek                 TimeZone = 98
	TimeZoneLagos                    TimeZone = 99
	TimeZoneRiyahd                   TimeZone = 100
	TimeZoneVenezuela                TimeZone = 101
	TimeZoneAustraliaLh              TimeZone = 102
	TimeZoneSantiago                 TimeZone = 103
	TimeZoneManual                   TimeZone = 253
	TimeZoneAutomatic                TimeZone = 254
	TimeZoneInvalid                  TimeZone = 0xFF
)

func (TimeZone) String

func (i TimeZone) String() string

type TimerTrigger

type TimerTrigger byte

TimerTrigger represents the timer_trigger FIT type.

const (
	TimerTriggerManual           TimerTrigger = 0
	TimerTriggerAuto             TimerTrigger = 1
	TimerTriggerFitnessEquipment TimerTrigger = 2
	TimerTriggerInvalid          TimerTrigger = 0xFF
)

func (TimerTrigger) String

func (i TimerTrigger) String() string

type TimestampCorrelationMsg

type TimestampCorrelationMsg struct {
}

TimestampCorrelationMsg represents the timestamp_correlation FIT message type.

type TotalsFile

type TotalsFile struct {
	Totals []*TotalsMsg
}

TotalsFile represents the Totals FIT file type. Summarizes a user’s total activity, characterized by sport.

type TotalsMsg

type TotalsMsg struct {
	MessageIndex MessageIndex
	Timestamp    time.Time
	TimerTime    uint32 // Excludes pauses
	Distance     uint32
	Calories     uint32
	Sport        Sport
	ElapsedTime  uint32 // Includes pauses
	Sessions     uint16
	ActiveTime   uint32
}

TotalsMsg represents the totals FIT message type.

type TrainingFileMsg

type TrainingFileMsg struct {
	Timestamp    time.Time
	Type         File
	Manufacturer Manufacturer
	Product      uint16
	SerialNumber uint32
	TimeCreated  time.Time
}

TrainingFileMsg represents the training_file FIT message type.

func (*TrainingFileMsg) GetProduct

func (x *TrainingFileMsg) GetProduct() interface{}

GetProduct returns the appropriate Product subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

type UnknownField

type UnknownField struct {
	MesgNum  MesgNum
	FieldNum byte
}

UnknownField represents an unknown FIT message field not found in the official profile. It contains the global message and field number.

type UserLocalId

type UserLocalId uint16

UserLocalId represents the user_local_id FIT type.

const (
	UserLocalIdLocalMin      UserLocalId = 0x0000
	UserLocalIdLocalMax      UserLocalId = 0x000F
	UserLocalIdStationaryMin UserLocalId = 0x0010
	UserLocalIdStationaryMax UserLocalId = 0x00FF
	UserLocalIdPortableMin   UserLocalId = 0x0100
	UserLocalIdPortableMax   UserLocalId = 0xFFFE
	UserLocalIdInvalid       UserLocalId = 0xFFFF
)

func (UserLocalId) String

func (i UserLocalId) String() string

type UserProfileMsg

type UserProfileMsg struct {
	MessageIndex               MessageIndex
	FriendlyName               string
	Gender                     Gender
	Age                        uint8
	Height                     uint8
	Weight                     uint16
	Language                   Language
	ElevSetting                DisplayMeasure
	WeightSetting              DisplayMeasure
	RestingHeartRate           uint8
	DefaultMaxRunningHeartRate uint8
	DefaultMaxBikingHeartRate  uint8
	DefaultMaxHeartRate        uint8
	HrSetting                  DisplayHeart
	SpeedSetting               DisplayMeasure
	DistSetting                DisplayMeasure
	PowerSetting               DisplayPower
	ActivityClass              ActivityClass
	PositionSetting            DisplayPosition
	TemperatureSetting         DisplayMeasure
	LocalId                    UserLocalId
	GlobalId                   []byte
	HeightSetting              DisplayMeasure
}

UserProfileMsg represents the user_profile FIT message type.

func (*UserProfileMsg) GetHeightScaled

func (x *UserProfileMsg) GetHeightScaled() float64

GetHeightScaled returns Height with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: m

func (*UserProfileMsg) GetWeightScaled

func (x *UserProfileMsg) GetWeightScaled() float64

GetWeightScaled returns Weight with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kg

type VideoClipMsg

type VideoClipMsg struct {
}

VideoClipMsg represents the video_clip FIT message type.

type VideoDescriptionMsg

type VideoDescriptionMsg struct {
	MessageIndex MessageIndex // Long descriptions will be split into multiple parts
	MessageCount uint16       // Total number of description parts
	Text         string
}

VideoDescriptionMsg represents the video_description FIT message type.

type VideoFrameMsg

type VideoFrameMsg struct {
}

VideoFrameMsg represents the video_frame FIT message type.

type VideoMsg

type VideoMsg struct {
}

VideoMsg represents the video FIT message type.

type VideoTitleMsg

type VideoTitleMsg struct {
	MessageIndex MessageIndex // Long titles will be split into multiple parts
	MessageCount uint16       // Total number of title parts
	Text         string
}

VideoTitleMsg represents the video_title FIT message type.

type Weight

type Weight uint16

Weight represents the weight FIT type.

const (
	WeightCalculating Weight = 0xFFFE
	WeightInvalid     Weight = 0xFFFF
)

func (Weight) String

func (i Weight) String() string

type WeightFile

type WeightFile struct {
	UserProfile  *UserProfileMsg
	WeightScales []*WeightScaleMsg
}

WeightFile represents the Weight FIT file type. Records weight scale data.

type WeightScaleMsg

type WeightScaleMsg struct {
	Timestamp         time.Time
	Weight            Weight
	PercentFat        uint16
	PercentHydration  uint16
	VisceralFatMass   uint16
	BoneMass          uint16
	MuscleMass        uint16
	BasalMet          uint16
	PhysiqueRating    uint8
	ActiveMet         uint16 // ~4kJ per kcal, 0.25 allows max 16384 kcal
	MetabolicAge      uint8
	VisceralFatRating uint8
	UserProfileIndex  MessageIndex // Associates this weight scale message to a user.  This corresponds to the index of the user profile message in the weight scale file.
}

WeightScaleMsg represents the weight_scale FIT message type.

func (*WeightScaleMsg) GetActiveMetScaled

func (x *WeightScaleMsg) GetActiveMetScaled() float64

GetActiveMetScaled returns ActiveMet with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kcal/day

func (*WeightScaleMsg) GetBasalMetScaled

func (x *WeightScaleMsg) GetBasalMetScaled() float64

GetBasalMetScaled returns BasalMet with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kcal/day

func (*WeightScaleMsg) GetBoneMassScaled

func (x *WeightScaleMsg) GetBoneMassScaled() float64

GetBoneMassScaled returns BoneMass with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kg

func (*WeightScaleMsg) GetMuscleMassScaled

func (x *WeightScaleMsg) GetMuscleMassScaled() float64

GetMuscleMassScaled returns MuscleMass with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kg

func (*WeightScaleMsg) GetPercentFatScaled

func (x *WeightScaleMsg) GetPercentFatScaled() float64

GetPercentFatScaled returns PercentFat with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*WeightScaleMsg) GetPercentHydrationScaled

func (x *WeightScaleMsg) GetPercentHydrationScaled() float64

GetPercentHydrationScaled returns PercentHydration with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: %

func (*WeightScaleMsg) GetVisceralFatMassScaled

func (x *WeightScaleMsg) GetVisceralFatMassScaled() float64

GetVisceralFatMassScaled returns VisceralFatMass with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kg

func (*WeightScaleMsg) GetWeightScaled

func (x *WeightScaleMsg) GetWeightScaled() float64

GetWeightScaled returns Weight with scale and any offset applied. NaN is returned if the field has an invalid value (i.e. has not been set). Units: kg

type WktStepDuration

type WktStepDuration byte

WktStepDuration represents the wkt_step_duration FIT type.

const (
	WktStepDurationTime                        WktStepDuration = 0
	WktStepDurationDistance                    WktStepDuration = 1
	WktStepDurationHrLessThan                  WktStepDuration = 2
	WktStepDurationHrGreaterThan               WktStepDuration = 3
	WktStepDurationCalories                    WktStepDuration = 4
	WktStepDurationOpen                        WktStepDuration = 5
	WktStepDurationRepeatUntilStepsCmplt       WktStepDuration = 6
	WktStepDurationRepeatUntilTime             WktStepDuration = 7
	WktStepDurationRepeatUntilDistance         WktStepDuration = 8
	WktStepDurationRepeatUntilCalories         WktStepDuration = 9
	WktStepDurationRepeatUntilHrLessThan       WktStepDuration = 10
	WktStepDurationRepeatUntilHrGreaterThan    WktStepDuration = 11
	WktStepDurationRepeatUntilPowerLessThan    WktStepDuration = 12
	WktStepDurationRepeatUntilPowerGreaterThan WktStepDuration = 13
	WktStepDurationPowerLessThan               WktStepDuration = 14
	WktStepDurationPowerGreaterThan            WktStepDuration = 15
	WktStepDurationRepetitionTime              WktStepDuration = 28
	WktStepDurationInvalid                     WktStepDuration = 0xFF
)

func (WktStepDuration) String

func (i WktStepDuration) String() string

type WktStepTarget

type WktStepTarget byte

WktStepTarget represents the wkt_step_target FIT type.

const (
	WktStepTargetSpeed      WktStepTarget = 0
	WktStepTargetHeartRate  WktStepTarget = 1
	WktStepTargetOpen       WktStepTarget = 2
	WktStepTargetCadence    WktStepTarget = 3
	WktStepTargetPower      WktStepTarget = 4
	WktStepTargetGrade      WktStepTarget = 5
	WktStepTargetResistance WktStepTarget = 6
	WktStepTargetInvalid    WktStepTarget = 0xFF
)

func (WktStepTarget) String

func (i WktStepTarget) String() string

type WorkoutCapabilities

type WorkoutCapabilities uint32

WorkoutCapabilities represents the workout_capabilities FIT type.

const (
	WorkoutCapabilitiesInterval         WorkoutCapabilities = 0x00000001
	WorkoutCapabilitiesCustom           WorkoutCapabilities = 0x00000002
	WorkoutCapabilitiesFitnessEquipment WorkoutCapabilities = 0x00000004
	WorkoutCapabilitiesFirstbeat        WorkoutCapabilities = 0x00000008
	WorkoutCapabilitiesNewLeaf          WorkoutCapabilities = 0x00000010
	WorkoutCapabilitiesTcx              WorkoutCapabilities = 0x00000020 // For backwards compatibility.  Watch should add missing id fields then clear flag.
	WorkoutCapabilitiesSpeed            WorkoutCapabilities = 0x00000080 // Speed source required for workout step.
	WorkoutCapabilitiesHeartRate        WorkoutCapabilities = 0x00000100 // Heart rate source required for workout step.
	WorkoutCapabilitiesDistance         WorkoutCapabilities = 0x00000200 // Distance source required for workout step.
	WorkoutCapabilitiesCadence          WorkoutCapabilities = 0x00000400 // Cadence source required for workout step.
	WorkoutCapabilitiesPower            WorkoutCapabilities = 0x00000800 // Power source required for workout step.
	WorkoutCapabilitiesGrade            WorkoutCapabilities = 0x00001000 // Grade source required for workout step.
	WorkoutCapabilitiesResistance       WorkoutCapabilities = 0x00002000 // Resistance source required for workout step.
	WorkoutCapabilitiesProtected        WorkoutCapabilities = 0x00004000
	WorkoutCapabilitiesInvalid          WorkoutCapabilities = 0x00000000
)

func (WorkoutCapabilities) String

func (i WorkoutCapabilities) String() string

type WorkoutFile

type WorkoutFile struct {
	Workout      *WorkoutMsg
	WorkoutSteps []*WorkoutStepMsg
}

WorkoutFile represents the Workout FIT file type. Describes a structured activity that can be designed on a computer and transferred to a display device to guide a user through the activity.

type WorkoutHr

type WorkoutHr uint32

WorkoutHr represents the workout_hr FIT type.

const (
	WorkoutHrBpmOffset WorkoutHr = 100
	WorkoutHrInvalid   WorkoutHr = 0xFFFFFFFF
)

func (WorkoutHr) String

func (i WorkoutHr) String() string

type WorkoutMsg

type WorkoutMsg struct {
	Sport         Sport
	Capabilities  WorkoutCapabilities
	NumValidSteps uint16 // number of valid steps
	WktName       string
}

WorkoutMsg represents the workout FIT message type.

type WorkoutPower

type WorkoutPower uint32

WorkoutPower represents the workout_power FIT type.

const (
	WorkoutPowerWattsOffset WorkoutPower = 1000
	WorkoutPowerInvalid     WorkoutPower = 0xFFFFFFFF
)

func (WorkoutPower) String

func (i WorkoutPower) String() string

type WorkoutStepMsg

type WorkoutStepMsg struct {
	MessageIndex          MessageIndex
	WktStepName           string
	DurationType          WktStepDuration
	DurationValue         uint32
	TargetType            WktStepTarget
	TargetValue           uint32
	CustomTargetValueLow  uint32
	CustomTargetValueHigh uint32
	Intensity             Intensity
}

WorkoutStepMsg represents the workout_step FIT message type.

func (*WorkoutStepMsg) GetCustomTargetValueHigh

func (x *WorkoutStepMsg) GetCustomTargetValueHigh() interface{}

GetCustomTargetValueHigh returns the appropriate CustomTargetValueHigh subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*WorkoutStepMsg) GetCustomTargetValueLow

func (x *WorkoutStepMsg) GetCustomTargetValueLow() interface{}

GetCustomTargetValueLow returns the appropriate CustomTargetValueLow subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*WorkoutStepMsg) GetDurationValue

func (x *WorkoutStepMsg) GetDurationValue() interface{}

GetDurationValue returns the appropriate DurationValue subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

func (*WorkoutStepMsg) GetTargetValue

func (x *WorkoutStepMsg) GetTargetValue() interface{}

GetTargetValue returns the appropriate TargetValue subfield if a matching reference field/value combination is found. If none of the reference field/value combinations are true then the main field is returned.

type ZonesTargetMsg

type ZonesTargetMsg struct {
	MaxHeartRate             uint8
	ThresholdHeartRate       uint8
	FunctionalThresholdPower uint16
	HrCalcType               HrZoneCalc
	PwrCalcType              PwrZoneCalc
}

ZonesTargetMsg represents the zones_target FIT message type.

Directories

Path Synopsis
cmd
stringer
Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface.
Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface.
Package dyncrc16 implements the Dynastream CRC-16 checksum.
Package dyncrc16 implements the Dynastream CRC-16 checksum.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL