Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Multi Session FIT to Multiple Single Session FITs

Rank

Total Posts: 19

Joined 0

PM

Hi,

I'm trying to convert a multi-session FIT file into multiple single session FIT files.

I'm basing my code on the decode example from the ANT SDK.

I read in an existing FIT file, writing out all messages received by the fit::MesgListener listener via the encode class write function. I also write out all message received via the fit::MesgDefinitionListener listener.

My problem is that when I try and read the file created, decode.CheckIntegrity fails with the error "FIT decode error: Missing FIT message definition for local message number 4".

This relates to the message definition number 22 which isn't defined in fit_profile.hpp (there should be a FIT_MESG_NUM_xxx entry) and more importantly, isn't defined as a message in Profile::mesgs.

I really don't need to know what message 22 contains but need a way of writing it out to a FIT file without the encoder generating a default message definition.

Has anyone seen this problem and/or know of a solution?

Thanks      
Avatar
Rank

Total Posts: 7

Joined 2012-02-22

PM

Hi grantnz,

Your method seems sound. Encode.Write(Mesg) should generate and write a new definition message if necessary before outputting the mesg. You are also using Encode.Write(Mesgdefintion) so there seems to be no good reason for your definition to be missing. Its possible the SDK is doing something strange for the unknown message types.

When you are decoding do you encounter the message definition for local message 4 in the source file?
When you call Encode.Write for Localnumber4/Globalnumber22, examine the mesg and mesgdefinition objects, do they look ok?      
Rank

Total Posts: 19

Joined 0

PM

Thanks for your reply. In the end, I made it work by filtering out the messages that weren't defined in fit_profile.cpp.

I haven't been able to find out what these message relate to but they don't seem to be important as all the data I'm interested in is still in the file created (HR & GPS).

It would be good if the library handled writing messages where a definition was available even if the definition wasn't in tables in fit_profile.cpp.