You are here: Forum Home → ANT Developers Forums → ANT+ FIT Forum Has Moved → Thread
fit::FileIdMesg fileIdMesg;
fileIdMesg.SetType(FIT_FILE_WORKOUT);
fileIdMesg.SetManufacturer(FIT_MANUFACTURER_GARMIN);
encode.Write(fileIdMesg);
fit::FileCreatorMesg fileCreatorMesg;
fileCreatorMesg.SetSoftwareVersion(0);
fileCreatorMesg.SetHardwareVersion(0);
encode.Write(fileCreatorMesg);
fit::WorkoutMesg workoutMesg;
workoutMesg.SetCapabilities(FIT_WORKOUT_CAPABILITIES_TCX);
workoutMesg.SetNumValidSteps(numValidSteps);
workoutMesg.SetSport(FIT_SPORT_CYCLING);
workoutMesg.SetWktName(s2ws(workoutName));
encode.Write(workoutMesg);
for (unsigned int i = 0; i < data.numberOfSteps; i++)
{
fit::WorkoutStepMesg workoutStepMesg;
//...
//<fill workout step mesg>
//...
encode.Write(WorkoutStepMesg );
}
https://github.com/helderlopes/MRC_creatorHello guys, I developed a C++ program that creates MRC and FIT files for Indoor power based cycling workouts. Source Code:
The problem is that, when I put more than one workout FIT file on my Garmin Edge 520 (I tried to put in Workouts folder and in NewFiles folder, the behaviour is the same), my unit just interpret the first workout, and delete the others. Is this a limitation on Garmin Edge unit, or do I need to put more info on FIT workout file? The code that creates the FIT file is located in WriteFIT.cpp file, but basically I insert a file ID message, a file Creator message, a workout message and the workout steps. The code looks like this:
fit::FileIdMesg fileIdMesg;
fileIdMesg.SetType(FIT_FILE_WORKOUT);
fileIdMesg.SetManufacturer(FIT_MANUFACTURER_GARMIN);
encode.Write(fileIdMesg);
fit::FileCreatorMesg fileCreatorMesg;
fileCreatorMesg.SetSoftwareVersion(0);
fileCreatorMesg.SetHardwareVersion(0);
encode.Write(fileCreatorMesg);
fit::WorkoutMesg workoutMesg;
workoutMesg.SetCapabilities(FIT_WORKOUT_CAPABILITIES_TCX);
workoutMesg.SetNumValidSteps(numValidSteps);
workoutMesg.SetSport(FIT_SPORT_CYCLING);
workoutMesg.SetWktName(s2ws(workoutName));
encode.Write(workoutMesg);
for (unsigned int i = 0; i < data.numberOfSteps; i++)
{
fit::WorkoutStepMesg workoutStepMesg;
//...
//<fill workout step mesg>
//...
encode.Write(WorkoutStepMesg );
}
Am I missing something or is this a normal behaviour? It's really annoying because I would like to create my weekday workouts on Sunday and put all of them at once on my garmin edge unit...
Thanks.