Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

FIT_EVENT and FIT_EVENT_TYPE

Rank

Total Posts: 1

Joined 2013-04-25

PM

Just started producing Activity .FIT files using the C++ SDK and have loaded them successfully into various apps, but I can't work out the EventMesg's to add for pauses or lost signal.
Here was my first guess.
// Write a PAUSE/UNKNOWN equipment state event for pause/lost lost signal
fit::EventMesg startEvt;
FIT_FITNESS_EQUIPMENT_STATE state;
state = (isLostSignal
         ? 
FIT_FITNESS_EQUIPMENT_STATE_UNKNOWN
         
FIT_FITNESS_EQUIPMENT_STATE_PAUSED;
startEvt.SetTimestampstartTime );
startEvt.SetEvent(FIT_EVENT_FITNESS_EQUIPMENT);
startEvt.SetEventType(FIT_EVENT_TYPE_START);
startEvt.SetTimerTrigger(FIT_TIMER_TRIGGER_FITNESS_EQUIPMENT);
startEvt.SetFitnessEquipmentState(state);
encode.Write(startEvt);

// Write an IN_USE equipment state when resume/regain signal
fit::EventMesg stopEvt;
stopEvt.SetTimestampstopTime );
stopEvt.SetEvent(FIT_EVENT_FITNESS_EQUIPMENT);
stopEvt.SetEventType(FIT_EVENT_TYPE_STOP);
stopEvt.SetTimerTrigger(FIT_TIMER_TRIGGER_FITNESS_EQUIPMENT);
stopEvt.SetFitnessEquipmentState(FIT_FITNESS_EQUIPMENT_STATE_IN_USE);
encode.Write(stopEvt); 

What should I be doing?

Also, are there any details of the event state machine? The example Activity.fit with the SDK uses EventMegs with fields like FIT_EVENT_TIMER, EventGroup 0 and 1, EVENT_TYPE_STOP_DISABLE_ALL, etc. but I'm not sure what these are doing and if they are needed. e.g. I've no idea what event groups are for.

Thanks.      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

Afaik, the semantics of events and event groups isn't specified in the FIT format specs. There are just a few remarks in the comments of the spec.

And I - having written quite a lot of .FIT parsing code - have never understood event groups either. I wouldn't know, how any software parsing .FIT files could make use of these.
I as well found slightly differing uses of event state in .FIT files from various Garmin devices. So it seems that even one (main) manufacturer doesn't have and use a concise event state diagram.
My advice would be to take .FIT files from e.g. Garmin devices as a template and mock these as best as you can.

Cheers,
OMB