In my garmin connect iq app I do create a user session like following:
mSession = ActivityRecording.createSession({
:sport=>ActivityRecording.SPORT_TRAINING,
:subSport=>ActivityRecording.SUB_SPORT_STRENGTH_TRAINING,
:name=>"Workout"
});
mSession.start();
// TODO: add a set with some data + add total workout statistic
// e.g. one set of benchpresses with 10 reps of 100kg within 40seconds
mSession.stop();
mSession.save();
I can't find any way to fill the default data of this session I only find things like createField
which creates user fields.
So my question is how do I fill out the default fields of a strength training session? Namely following:
- time under tension
- pause time
And additionally how do I add default list entries? Namely:
- an exercise with sets and a weight and reps?
Currently, when I save my session I don't have any data but avarage heart rate, calories and time inside my workout.
What I tried so far - sadly it did not work, garmin connect app still shows empty total stats:
I tried something like following to fill out the workout statistics:
I found the number for the nativeNum field here (https://github.com/dgaff/fitsdk) because I did not find any Profile.xls(x) inside the current fitsdk download and this file seems to be the source for the numbers.
fTotalTime = createFieldWithUnit("Total Time", 1, FitContributor.DATA_TYPE_UINT32, 7, "s"); fNettoTime = createFieldWithUnit("Netto Time", 2, FitContributor.DATA_TYPE_UINT32, 8, "s"); fNumLaps = createField("Laps", 3, FitContributor.DATA_TYPE_UINT16, 26); fTotalTime.setData(100); fNettoTime.setData(25); fNumLaps.setData(3);
Function code:
hidden function createField(label, id, type, nativeNum) {
return mSession.createField(
label,
id,
type,
{
:mesgType => FitContributor.MESG_TYPE_RECORD,
:nativeNum=> nativeNum
}
);
}
hidden function createFieldWithUnit(label, id, type, nativeNum, unit) {
return mSession.createField(
label,
id,
type,
{
:mesgType => FitContributor.MESG_TYPE_RECORD,
:nativeNum=> nativeNum,
:units => unit
}
);
}