Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

stop vs. stop_all event

Rank

Total Posts: 10

Joined 2010-11-24

PM

Question on how to interpret stop vs. stop_all event in Activity FIT files.

Here's my best guess:

- stop_all event: indicates user performed a manual stop (pressed start/stop button)
- stop event: indicates auto pause has occurred
- start event: indicates either user performed a manual start (pressed start/stop button) after previously performing a manual stop OR auto resume has occurred after auto pause previously occurred

Is this correct?      
RankRankRank

Total Posts: 91

Joined 2012-10-12

PM

Hi Mitac,
The stop_all event is a compression technique for stopping a number of related events all at once (i.e. events started with the same value for event_group) without needing to send a stop event individually. This event could be generated when the user presses the stop button on their timer.

You would need to look at the other fields in the event mesg to know more about the event that occurred. When event='timer' the data field is interpreted as 'timer_trigger', this is how you can tell if the timer event was manual or auto.      
Rank

Total Posts: 10

Joined 2010-11-24

PM

Thanks @ShaneP.

So value of timer_trigger defines manual (0) or auto (1). But is there a best practice on value of event_type (stop or stop_all) for documenting a manual stop vs. an auto pause? For example, should you use event = stop_all and timer_trigger = 0 when user performs a manual stop and event = stop and timer_trigger = 1 when an auto pause (user stops moving) is triggered? Or should you use event = stop_all for auto pause as well?

We are actually not simply reading and interpreting FIT files, we are writing FIT files, so asking what event_type to use for manual stop vs auto pause, whether the same, different, or "it depends".

Thanks!      
RankRankRank

Total Posts: 91

Joined 2012-10-12

PM

Event_type 'stop_all' is used in conjunction with the event_group field to stop a number of events all at once. This allows for a reduced file size vs writing many individual stop events that might be needed (eg. need to stop the timer AND stop some alerts etc when X occurs). So timer,stop will work the same as timer,stop_all unless you have a number of other event groups setup.      
Rank

Total Posts: 9

Joined 0

PM

Is there somewhere list with description of meaning (hopefully examples) of enum constants of event_type?

The only reference i found in SDK is profile.xls where are listed enum names with constant values, but no explanation when we should use what..

For example I have super simple ride activity, with no laps (just 1 actually), 1 session and it goes like this:
- I start riding (I guess EVENT_TYPE is START),
- ride for a while,
- pause for a drink/food (pause is what type of event??),
- continue riding (is this START again?? ),
- after some time red traffic light catch me (pause again somehow? which constant?)
- ride again for 15 minutes
- i am tired and done with riding for now (STOP, STOP_APP, STOP_DISABLE, STOP_DISABLE_ALL ?? which one should i use, why and what is the meaning of the other constants)

Thanks in advance if there is somebody how understand this and can explain it.      
Rank

Total Posts: 25

Joined 2016-08-16

PM

I would appreciate an answer to this question also. We would like to have the ability to start, pause, resume, stop, start, pause, resume, pause, resume, stop.

It would appear that the only way to do this is to increment the event group identifier before a start, and use that same event group identifier until after the stop.      
RankRankRank

Total Posts: 68

Joined 0

PM

The EVENT_TYPE is associated with the EVENT that is logged alongside it. The comments for the EVENT in the Profile.xlsx included in the SDK can be used to indicate the meanings and usages for each EVENT_TYPE.

As an example.
The comment for time_duration_alert event indicates:
Start if enabled mid activity (not required at start of activity). Stop when duration is reached. stop_disable if disabled.


To answer your question about starting and pausing:

timer events indicate state changes of the timer, START indicates the timer has started. STOP/STOP_ALL indicates that the timer is stopped.      
Rank

Total Posts: 25

Joined 2016-08-16

PM

Perhaps my question is not clear. In your opinion, for the following sequence of interactions with the software that we are developing what would be the best set of messages types to be written to the ACTIVITY FIT file:

1. User starts the activity
2. User pauses the activity
3. User resumes the activity
4. User stops the activity

     
RankRankRank

Total Posts: 68

Joined 0

PM

1. Event Message, event = timer, event_type = start
2. Event Message, event = timer, event_type = stop/stop_all
3. Event Message, event = timer, event_type = start
4. Event Message, event = timer, event_type = stop/stop_all

Of course, there are expectations for Record Lap and Session Messages that are defined in Section 9 of the D00001309 FIT File Types Description Rev 2.1.pdf document included in the SDK.
     
Rank

Total Posts: 25

Joined 2016-08-16

PM

Must the session and lap messages be included in an activity file? It's not clear from the document if they are required or are allowed.      
RankRankRank

Total Posts: 68

Joined 0

PM

An activity must contain at least one session and one lap.      
Rank

Total Posts: 25

Joined 2016-08-16

PM

Thanks, looking at a Garmin generated FIT file, the lap and session messages can be at the end of the FIT file:

record messages...
Data2eventtimestamp829412318stimer_trigger0, , event0, , event_type4, , event_group0

Data
9laptimestamp829412560sstart_time829411586, , start_position_lat587660484semicirclesstart_position_long, -1468701135semicirclesend_position_lat587896823semicirclesend_position_long, -1468872395semicirclestotal_elapsed_time732.71stotal_timer_time732.71stotal_distance3774.92munknown587896823, , unknown, -1468667340, , unknown587660484, , unknown, -1468872395, , message_index1, , total_calories103kcalavg_speed5.152m/smax_speed10.357m/stotal_ascent12mtotal_descent55mevent9, , event_type1, , lap_trigger7, , sport2, , sub_sport0, , enhanced_avg_speed5.152m/senhanced_max_speed10.357m/s

Definition
11sessiontimestamp1, , start_time1, , start_position_lat1, , start_position_long1, , total_elapsed_time1, , total_timer_time1, , total_distance1, , total_cycles1, , nec_lat1, , nec_long1, , swc_lat1, , swc_long1, , avg_stroke_count1, , total_work1, , time_in_hr_zone7, , time_in_power_zone8, , unknown1, , unknown16, , time_standing1, , avg_left_power_phase4, , avg_left_power_phase_peak4, , avg_right_power_phase4, , avg_right_power_phase_peak4, , avg_power_position2, , max_power_position2, , message_index1, , total_calories1, , avg_speed1, , max_speed1, , avg_power1, , max_power1, , total_ascent1, , total_descent1, , first_lap_index1, , num_laps1, , unknown1, , normalized_power1, , training_stress_score1, , intensity_factor1, , left_right_balance1, , avg_stroke_distance1, , pool_length1, , threshold_power1, , num_active_lengths1, , unknown1, , unknown1, , avg_vertical_oscillation1, , avg_stance_time_percent1, , avg_stance_time1, , unknown1, , unknown1, , stand_count1, , avg_vertical_ratio1, , avg_stance_time_balance1, , avg_step_length1, , event1, , event_type1, , sport1, , sub_sport1, , avg_heart_rate1, , max_heart_rate1, , avg_cadence1, , max_cadence1, , total_training_effect1, , event_group1, , trigger1, , swim_stroke1, , pool_length_unit1, , unknown1, , avg_fractional_cadence1, , max_fractional_cadence1, , total_fractional_cycles1, , avg_left_torque_effectiveness1, , avg_right_torque_effectiveness1, , avg_left_pedal_smoothness1, , avg_right_pedal_smoothness1, , avg_combined_pedal_smoothness1, , unknown1, , avg_left_pco1, , avg_right_pco1, , avg_cadence_position2, , max_cadence_position2

Data11sessiontimestamp829412560sstart_time829410801, , start_position_lat587405054semicirclesstart_position_long, -1468264772semicirclestotal_elapsed_time1516.779stotal_timer_time1516.779stotal_distance8774.92mnec_lat587896823semicirclesnec_long, -1468264180semicirclesswc_lat587405054semicirclesswc_long, -1468872395semicirclesunknownBike, , message_index0, , total_calories246kcalavg_speed5.785m/smax_speed10.357m/stotal_ascent29mtotal_descent113mfirst_lap_index0, , num_laps2, , event9, , event_type1, , sport2, , sub_sport0, , trigger0, , unknown0, , enhanced_avg_speed5.785m/senhanced_max_speed10.357m/s

Definition
12activitytimestamp1, , total_timer_time1, , local_timestamp1, , num_sessions1, , type1, , event1, , event_type1, , event_group1

Data
12activitytimestamp829412560, , total_timer_time1516.779slocal_timestamp829387360, , num_sessions1, , type0, , event26, , event_type