You are here: Forum Home → ANT Developers Forums → ANT+ FIT Forum Has Moved → Thread
// 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.SetTimestamp( startTime );
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.SetTimestamp( stopTime );
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);