static void OnMesg(object sender, MesgEventArgs e) { Mesg msg = e.mesg; if (msg.Num == MesgNum.Record) { RecordMesg recordMesg = new RecordMesg(msg); Console.Write("Data,{0},record,", msg.LocalNum); if (recordMesg.GetTimestamp() != null) { Console.Write("timestamp,{0},s,", recordMesg.GetTimestamp().GetTimeStamp()); } if ((recordMesg.GetDistance() != null) && (recordMesg.GetDistance() != (uint)Fit.BaseType[Fit.UInt32].invalidValue)) { Console.Write("distance, {0:0.0}, m,", recordMesg.GetDistance()); } if ((recordMesg.GetSpeed() != null) && (recordMesg.GetSpeed() != (ushort)Fit.BaseType[Fit.UInt16].invalidValue)) { Console.Write("speed,{0:0.000},m/s,", recordMesg.GetSpeed()); } if ((recordMesg.GetCadence() != null) && (recordMesg.GetCadence() != (byte)Fit.BaseType[Fit.UInt8].invalidValue)) { Console.Write("cadence,{0},rpm,", recordMesg.GetCadence()); } if ((recordMesg.GetEnhancedSpeed() != null) && (recordMesg.GetEnhancedSpeed() != (uint)Fit.BaseType[Fit.UInt32].invalidValue)) { Console.Write("enhanced_speed,{0:0.000},m/s,", recordMesg.GetEnhancedSpeed()); } if ((recordMesg.GetHeartRate() != null) && (recordMesg.GetHeartRate() != (byte)Fit.BaseType[Fit.UInt8].invalidValue)) { Console.Write("heart_rate,{0},bpm,", recordMesg.GetHeartRate()); } Console.Write("\n"); } else if (msg.Num == MesgNum.Hr) { HrMesg hrMesg = new HrMesg(msg); Console.Write("Data,{0},hr,", msg.LocalNum); int count; if ((hrMesg.GetTimestamp() != null) && (hrMesg.GetTimestamp().GetTimeStamp() != (uint)Fit.BaseType[Fit.UInt32].invalidValue)) { Console.Write("timestamp,{0},,", hrMesg.GetTimestamp().GetTimeStamp()); } if (hrMesg.GetNumFilteredBpm() > 0) { Console.Write("filtered_bpm,"); count = hrMesg.GetNumFilteredBpm(); for (int i = 0; i < count; i++) { Console.Write("{0}", hrMesg.GetFilteredBpm(i)); if (i < count - 1) { Console.Write("|"); } } Console.Write(",bpm,"); } if (hrMesg.GetNumEventTimestamp12() > 0) { Console.Write("event_timestamp_12,"); count = hrMesg.GetNumEventTimestamp12(); for (int i = 0; i < count; i++) { Console.Write("{0}", hrMesg.GetEventTimestamp12(i)); if (i < count - 1) { Console.Write("|"); } } Console.Write(",,"); } if (hrMesg.GetNumEventTimestamp() > 0) { Console.Write("event_timestamp,"); count = hrMesg.GetNumEventTimestamp(); for (int i = 0; i < count; i++) { Console.Write("{0:G}", hrMesg.GetEventTimestamp(i)); if (i < count - 1) { Console.Write("|"); } } Console.Write(",s,"); } if (hrMesg.GetFractionalTimestamp() != null) { Console.Write("fractional_timestamp,{0:0.######},s,", hrMesg.GetFractionalTimestamp()); } Console.Write("\n"); } }
public WorkoutMesg(Mesg mesg) : base(mesg) { }
public UserProfileMesg(Mesg mesg) : base(mesg) { }
public FileCreatorMesg(Mesg mesg) : base(mesg) { }
public CapabilitiesMesg(Mesg mesg) : base(mesg) { }
public MonitoringInfoMesg(Mesg mesg) : base(mesg) { }
public MetZoneMesg(Mesg mesg) : base(mesg) { }
public HrmProfileMesg(Mesg mesg) : base(mesg) { }
public DeviceSettingsMesg(Mesg mesg) : base(mesg) { }
public ActivityMesg(Mesg mesg) : base(mesg) { }
public BikeProfileMesg(Mesg mesg) : base(mesg) { }
public WorkoutStepMesg(Mesg mesg) : base(mesg) { }