-
Notifications
You must be signed in to change notification settings - Fork 43
Main API Reference
The main decoding interface is listed below. See godoc for a complete list of FIT types and messages.
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.
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(r io.Reader) (*Fit, error)
Decode reads a FIT file from r and returns it as a *Fit.
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 (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 (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 (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 (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 (f *Fit) FileType() File
FileType returns the FIT file type.
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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 Header struct {
Size byte
ProtocolVersion byte
ProfileVersion uint16
DataSize uint32
DataType [4]byte
CRC uint16
}
Header represents a FIT file header.
func DecodeHeader(r io.Reader) (*Header, error)
DecodeHeader returns the FIT file header without decoding the entire FIT file.
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.
func (h *Header) CheckIntegrity() error
CheckIntegrity verifies the FIT header CRC.
func (h *Header) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (h Header) String() string
Generated by godoc2md