From b81f5505eda534d23efba7988838975271254154 Mon Sep 17 00:00:00 2001 From: Tormod Erevik Lea Date: Sat, 7 Oct 2023 16:41:15 +0200 Subject: [PATCH] file_types: adjust course message to sdk docs --- file_types.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/file_types.go b/file_types.go index 4477de9..cb9576d 100644 --- a/file_types.go +++ b/file_types.go @@ -73,11 +73,16 @@ type WorkoutFile struct { // CourseFile represents the Course FIT file type. // Uses data from an activity to recreate a course. type CourseFile struct { - Course *CourseMsg - Laps []*LapMsg + // Documentation: https://developer.garmin.com/fit/file-types/activity/ + + // Required messages according to docs. + Course *CourseMsg + Lap *LapMsg + Records []*RecordMsg + Events []*EventMsg + + // Optional messages according to docs. CoursePoints []*CoursePointMsg - Events []*EventMsg - Records []*RecordMsg } // SchedulesFile represents the Schedules FIT file type. @@ -275,7 +280,7 @@ func (c *CourseFile) add(msg reflect.Value) { c.Course = &tmp case LapMsg: tmp.expandComponents() - c.Laps = append(c.Laps, &tmp) + c.Lap = &tmp case CoursePointMsg: c.CoursePoints = append(c.CoursePoints, &tmp) case RecordMsg: