I'm not sure if this is an issue, but I need help figuring out why all values from radar_current, radar_speeds, etc. fields that I added with fitgen default to max uint8 or uint16 as I define them. The values from other fields are parsed correctly (e.g. HR or distance). I apologize in advance if this is a user error!
Let's focus on radar_current (which is the current count of cars coming up from behind registered by Garmin radar). See the file displayed below. The last entry is 20.

I defined radar_current as uint8. See SDK's Profile.xlxs screenshot:

Once I regenerate a few files with fitgen and I tell go about it with replace github.com/tormoder/fit => /home/jsliacan/Github/fit in go.mod, I run a modified example code from here:
|
for _, record := range activity.Records { |
where I extract the last entry in the
radar_current field in the
record (snippet below). I expected to see
20 but I get
255. However, for
hr field (which I didn't generate with
fitgen) I get the correct value of
114.
var numCars, hr int
for _, record := range activity.Records {
numCars = int(record.RadarCurrent)
hr = int(record.HeartRate)
}
fmt.Println(hr, numCars)
Any help appreciated.
I'm not sure if this is an issue, but I need help figuring out why all values from
radar_current,radar_speeds, etc. fields that I added withfitgendefault to maxuint8oruint16as I define them. The values from other fields are parsed correctly (e.g. HR or distance). I apologize in advance if this is a user error!Let's focus on
radar_current(which is the current count of cars coming up from behind registered by Garmin radar). See the file displayed below. The last entry is20.I defined
radar_currentasuint8. See SDK'sProfile.xlxsscreenshot:Once I regenerate a few files with
fitgenand I tellgoabout it withreplace github.com/tormoder/fit => /home/jsliacan/Github/fitingo.mod, I run a modified example code from here:fit/example_test.go
Line 45 in 14e5de2
radar_currentfield in therecord(snippet below). I expected to see20but I get255. However, forhrfield (which I didn't generate withfitgen) I get the correct value of114.Any help appreciated.