Skip to content

Commit

Permalink
file_types: adjust course message to sdk docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tormoder committed Oct 7, 2023
1 parent 86c82d1 commit b81f550
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions file_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b81f550

Please sign in to comment.