Ejemplo n.º 1
0
        public void Add(DeveloperDataIdMessage mesg)
        {
            byte?index = mesg.GetDeveloperDataIndex();

            if (index == null)
            {
                return;
            }

            m_developerDataIdMessages[index.Value] = mesg;

            // Remove all fields currently associated with this developer
            var keysToRemove =
                m_fieldDescriptionMessages.Keys
                .Where(
                    x =>
                    x.DeveloperDataIndex ==
                    index)
                .ToList();

            foreach (var key in keysToRemove)
            {
                m_fieldDescriptionMessages.Remove(key);
            }
        }
Ejemplo n.º 2
0
 internal DeveloperFieldDescription(
     DeveloperDataIdMessage developerDataId,
     FieldDescriptionMessage fieldDescription)
 {
     m_developerDataId  = developerDataId;
     m_fieldDescription = fieldDescription;
 }
Ejemplo n.º 3
0
 private void HandleMetaData(Message newMessage)
 {
     if (newMessage.MessageNumber == MessageNum.DeveloperDataId)
     {
         var mesg = new DeveloperDataIdMessage(newMessage);
         m_lookup.Add(mesg);
     }
     else if (newMessage.MessageNumber == MessageNum.FieldDescription)
     {
         var mesg = new FieldDescriptionMessage(newMessage);
         DeveloperFieldDescription desc = m_lookup.Add(mesg);
         if (desc != null)
         {
             OnDeveloperFieldDescriptionEvent(
                 new DeveloperFieldDescriptionEventArgs(desc));
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="desc"></param>
        /// <param name="devId"></param>
        /// <param name="size"></param>
        /// <exception cref="InvalidOperationException">
        ///     If description parameter is invalid
        /// </exception>
        public DeveloperFieldDefinition(FieldDescriptionMessage desc, DeveloperDataIdMessage devId, byte size)
        {
            byte?fieldDefinitionNumber = desc.GetFieldDefinitionNumber();
            byte?developerDataIndex    = desc.GetDeveloperDataIndex();

            if ((developerDataIndex != null) &&
                (fieldDefinitionNumber != null))
            {
                m_descriptionMessage = desc;
                m_developerIdMessage = devId;
                Size               = size;
                FieldNum           = (byte)fieldDefinitionNumber;
                DeveloperDataIndex = (byte)developerDataIndex;
            }
            else
            {
                throw new FitException("Description Message must have a valid developer data index and field definition number");
            }
        }
Ejemplo n.º 5
0
 public DeveloperField(FieldDescriptionMessage description, DeveloperDataIdMessage developerDataIdMessage)
 {
     m_definition = new DeveloperFieldDefinition(description, developerDataIdMessage, 0);
 }
Ejemplo n.º 6
0
        public void OnMessage(object sender, MessageEventArgs e)
        {
            // Notify any subscribers of either our general mesg event or specific profile mesg event
            if (MessageEvent != null)
            {
                MessageEvent(sender, e);
            }

            switch (e.Message.MessageNumber)
            {
            case (ushort)MessageNum.FileId:
                if (FileIdMessageEvent != null)
                {
                    FileIdMessage    fileIdMessage = new FileIdMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = fileIdMessage;
                    FileIdMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.FileCreator:
                if (FileCreatorMessageEvent != null)
                {
                    FileCreatorMessage fileCreatorMessage = new FileCreatorMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = fileCreatorMessage;
                    FileCreatorMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.TimestampCorrelation:
                if (TimestampCorrelationMessageEvent != null)
                {
                    TimestampCorrelationMessage timestampCorrelationMessage = new TimestampCorrelationMessage(e.Message);
                    MessageEventArgs            mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = timestampCorrelationMessage;
                    TimestampCorrelationMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Software:
                if (SoftwareMessageEvent != null)
                {
                    SoftwareMessage  softwareMessage = new SoftwareMessage(e.Message);
                    MessageEventArgs mesgEventArgs   = new MessageEventArgs();
                    mesgEventArgs.Message = softwareMessage;
                    SoftwareMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SlaveDevice:
                if (SlaveDeviceMessageEvent != null)
                {
                    SlaveDeviceMessage slaveDeviceMessage = new SlaveDeviceMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = slaveDeviceMessage;
                    SlaveDeviceMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Capabilities:
                if (CapabilitiesMessageEvent != null)
                {
                    CapabilitiesMessage capabilitiesMessage = new CapabilitiesMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = capabilitiesMessage;
                    CapabilitiesMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.FileCapabilities:
                if (FileCapabilitiesMessageEvent != null)
                {
                    FileCapabilitiesMessage fileCapabilitiesMessage = new FileCapabilitiesMessage(e.Message);
                    MessageEventArgs        mesgEventArgs           = new MessageEventArgs();
                    mesgEventArgs.Message = fileCapabilitiesMessage;
                    FileCapabilitiesMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.MessageCapabilities:
                if (MessageCapabilitiesMessageEvent != null)
                {
                    MessageCapabilitiesMessage mesgCapabilitiesMessage = new MessageCapabilitiesMessage(e.Message);
                    MessageEventArgs           mesgEventArgs           = new MessageEventArgs();
                    mesgEventArgs.Message = mesgCapabilitiesMessage;
                    MessageCapabilitiesMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.FieldCapabilities:
                if (FieldCapabilitiesMessageEvent != null)
                {
                    FieldCapabilitiesMessage fieldCapabilitiesMessage = new FieldCapabilitiesMessage(e.Message);
                    MessageEventArgs         mesgEventArgs            = new MessageEventArgs();
                    mesgEventArgs.Message = fieldCapabilitiesMessage;
                    FieldCapabilitiesMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.DeviceSettings:
                if (DeviceSettingsMessageEvent != null)
                {
                    DeviceSettingsMessage deviceSettingsMessage = new DeviceSettingsMessage(e.Message);
                    MessageEventArgs      mesgEventArgs         = new MessageEventArgs();
                    mesgEventArgs.Message = deviceSettingsMessage;
                    DeviceSettingsMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.UserProfile:
                if (UserProfileMessageEvent != null)
                {
                    UserProfileMessage userProfileMessage = new UserProfileMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = userProfileMessage;
                    UserProfileMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.HrmProfile:
                if (HrmProfileMessageEvent != null)
                {
                    HrmProfileMessage hrmProfileMessage = new HrmProfileMessage(e.Message);
                    MessageEventArgs  mesgEventArgs     = new MessageEventArgs();
                    mesgEventArgs.Message = hrmProfileMessage;
                    HrmProfileMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SdmProfile:
                if (SdmProfileMessageEvent != null)
                {
                    SdmProfileMessage sdmProfileMessage = new SdmProfileMessage(e.Message);
                    MessageEventArgs  mesgEventArgs     = new MessageEventArgs();
                    mesgEventArgs.Message = sdmProfileMessage;
                    SdmProfileMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.BikeProfile:
                if (BikeProfileMessageEvent != null)
                {
                    BikeProfileMessage bikeProfileMessage = new BikeProfileMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = bikeProfileMessage;
                    BikeProfileMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Connectivity:
                if (ConnectivityMessageEvent != null)
                {
                    ConnectivityMessage connectivityMessage = new ConnectivityMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = connectivityMessage;
                    ConnectivityMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.WatchfaceSettings:
                if (WatchfaceSettingsMessageEvent != null)
                {
                    WatchfaceSettingsMessage watchfaceSettingsMessage = new WatchfaceSettingsMessage(e.Message);
                    MessageEventArgs         mesgEventArgs            = new MessageEventArgs();
                    mesgEventArgs.Message = watchfaceSettingsMessage;
                    WatchfaceSettingsMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.OhrSettings:
                if (OhrSettingsMessageEvent != null)
                {
                    OhrSettingsMessage ohrSettingsMessage = new OhrSettingsMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = ohrSettingsMessage;
                    OhrSettingsMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.ZonesTarget:
                if (ZonesTargetMessageEvent != null)
                {
                    ZonesTargetMessage zonesTargetMessage = new ZonesTargetMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = zonesTargetMessage;
                    ZonesTargetMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Sport:
                if (SportMessageEvent != null)
                {
                    SportMessage     sportMessage  = new SportMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = sportMessage;
                    SportMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.HrZone:
                if (HrZoneMessageEvent != null)
                {
                    HrZoneMessage    hrZoneMessage = new HrZoneMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = hrZoneMessage;
                    HrZoneMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SpeedZone:
                if (SpeedZoneMessageEvent != null)
                {
                    SpeedZoneMessage speedZoneMessage = new SpeedZoneMessage(e.Message);
                    MessageEventArgs mesgEventArgs    = new MessageEventArgs();
                    mesgEventArgs.Message = speedZoneMessage;
                    SpeedZoneMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.CadenceZone:
                if (CadenceZoneMessageEvent != null)
                {
                    CadenceZoneMessage cadenceZoneMessage = new CadenceZoneMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = cadenceZoneMessage;
                    CadenceZoneMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.PowerZone:
                if (PowerZoneMessageEvent != null)
                {
                    PowerZoneMessage powerZoneMessage = new PowerZoneMessage(e.Message);
                    MessageEventArgs mesgEventArgs    = new MessageEventArgs();
                    mesgEventArgs.Message = powerZoneMessage;
                    PowerZoneMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.MetZone:
                if (MetZoneMessageEvent != null)
                {
                    MetZoneMessage   metZoneMessage = new MetZoneMessage(e.Message);
                    MessageEventArgs mesgEventArgs  = new MessageEventArgs();
                    mesgEventArgs.Message = metZoneMessage;
                    MetZoneMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.DiveSettings:
                if (DiveSettingsMessageEvent != null)
                {
                    DiveSettingsMessage diveSettingsMessage = new DiveSettingsMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = diveSettingsMessage;
                    DiveSettingsMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.DiveAlarm:
                if (DiveAlarmMessageEvent != null)
                {
                    DiveAlarmMessage diveAlarmMessage = new DiveAlarmMessage(e.Message);
                    MessageEventArgs mesgEventArgs    = new MessageEventArgs();
                    mesgEventArgs.Message = diveAlarmMessage;
                    DiveAlarmMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.DiveGas:
                if (DiveGasMessageEvent != null)
                {
                    DiveGasMessage   diveGasMessage = new DiveGasMessage(e.Message);
                    MessageEventArgs mesgEventArgs  = new MessageEventArgs();
                    mesgEventArgs.Message = diveGasMessage;
                    DiveGasMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Goal:
                if (GoalMessageEvent != null)
                {
                    GoalMessage      goalMessage   = new GoalMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = goalMessage;
                    GoalMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Activity:
                if (ActivityMessageEvent != null)
                {
                    ActivityMessage  activityMessage = new ActivityMessage(e.Message);
                    MessageEventArgs mesgEventArgs   = new MessageEventArgs();
                    mesgEventArgs.Message = activityMessage;
                    ActivityMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Session:
                if (SessionMessageEvent != null)
                {
                    SessionMessage   sessionMessage = new SessionMessage(e.Message);
                    MessageEventArgs mesgEventArgs  = new MessageEventArgs();
                    mesgEventArgs.Message = sessionMessage;
                    SessionMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Lap:
                if (LapMessageEvent != null)
                {
                    LapMessage       lapMessage    = new LapMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = lapMessage;
                    LapMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Length:
                if (LengthMessageEvent != null)
                {
                    LengthMessage    lengthMessage = new LengthMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = lengthMessage;
                    LengthMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Record:
                if (RecordMessageEvent != null)
                {
                    Record           recordMessage = new Record(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = recordMessage;
                    RecordMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Event:
                if (EventMessageEvent != null)
                {
                    EventMessage     eventMessage  = new EventMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = eventMessage;
                    EventMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.DeviceInfo:
                if (DeviceInfoMessageEvent != null)
                {
                    DeviceInfoMessage deviceInfoMessage = new DeviceInfoMessage(e.Message);
                    MessageEventArgs  mesgEventArgs     = new MessageEventArgs();
                    mesgEventArgs.Message = deviceInfoMessage;
                    DeviceInfoMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.TrainingFile:
                if (TrainingFileMessageEvent != null)
                {
                    TrainingFileMessage trainingFileMessage = new TrainingFileMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = trainingFileMessage;
                    TrainingFileMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Hrv:
                if (HrvMessageEvent != null)
                {
                    HrvMessage       hrvMessage    = new HrvMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = hrvMessage;
                    HrvMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.WeatherConditions:
                if (WeatherConditionsMessageEvent != null)
                {
                    WeatherConditionsMessage weatherConditionsMessage = new WeatherConditionsMessage(e.Message);
                    MessageEventArgs         mesgEventArgs            = new MessageEventArgs();
                    mesgEventArgs.Message = weatherConditionsMessage;
                    WeatherConditionsMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.WeatherAlert:
                if (WeatherAlertMessageEvent != null)
                {
                    WeatherAlertMessage weatherAlertMessage = new WeatherAlertMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = weatherAlertMessage;
                    WeatherAlertMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.GpsMetadata:
                if (GpsMetadataMessageEvent != null)
                {
                    GpsMetadataMessage gpsMetadataMessage = new GpsMetadataMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = gpsMetadataMessage;
                    GpsMetadataMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.CameraEvent:
                if (CameraEventMessageEvent != null)
                {
                    CameraEventMessage cameraEventMessage = new CameraEventMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = cameraEventMessage;
                    CameraEventMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.GyroscopeData:
                if (GyroscopeDataMessageEvent != null)
                {
                    GyroscopeDataMessage gyroscopeDataMessage = new GyroscopeDataMessage(e.Message);
                    MessageEventArgs     mesgEventArgs        = new MessageEventArgs();
                    mesgEventArgs.Message = gyroscopeDataMessage;
                    GyroscopeDataMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.AccelerometerData:
                if (AccelerometerDataMessageEvent != null)
                {
                    AccelerometerDataMessage accelerometerDataMessage = new AccelerometerDataMessage(e.Message);
                    MessageEventArgs         mesgEventArgs            = new MessageEventArgs();
                    mesgEventArgs.Message = accelerometerDataMessage;
                    AccelerometerDataMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.MagnetometerData:
                if (MagnetometerDataMessageEvent != null)
                {
                    MagnetometerDataMessage magnetometerDataMessage = new MagnetometerDataMessage(e.Message);
                    MessageEventArgs        mesgEventArgs           = new MessageEventArgs();
                    mesgEventArgs.Message = magnetometerDataMessage;
                    MagnetometerDataMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.BarometerData:
                if (BarometerDataMessageEvent != null)
                {
                    BarometerDataMessage barometerDataMessage = new BarometerDataMessage(e.Message);
                    MessageEventArgs     mesgEventArgs        = new MessageEventArgs();
                    mesgEventArgs.Message = barometerDataMessage;
                    BarometerDataMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.ThreeDSensorCalibration:
                if (ThreeDSensorCalibrationMessageEvent != null)
                {
                    ThreeDSensorCalibrationMessage threeDSensorCalibrationMessage = new ThreeDSensorCalibrationMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = threeDSensorCalibrationMessage;
                    ThreeDSensorCalibrationMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.OneDSensorCalibration:
                if (OneDSensorCalibrationMessageEvent != null)
                {
                    OneDSensorCalibrationMessage oneDSensorCalibrationMessage = new OneDSensorCalibrationMessage(e.Message);
                    MessageEventArgs             mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = oneDSensorCalibrationMessage;
                    OneDSensorCalibrationMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.VideoFrame:
                if (VideoFrameMessageEvent != null)
                {
                    VideoFrameMessage videoFrameMessage = new VideoFrameMessage(e.Message);
                    MessageEventArgs  mesgEventArgs     = new MessageEventArgs();
                    mesgEventArgs.Message = videoFrameMessage;
                    VideoFrameMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.ObdiiData:
                if (ObdiiDataMessageEvent != null)
                {
                    ObdiiDataMessage obdiiDataMessage = new ObdiiDataMessage(e.Message);
                    MessageEventArgs mesgEventArgs    = new MessageEventArgs();
                    mesgEventArgs.Message = obdiiDataMessage;
                    ObdiiDataMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.NmeaSentence:
                if (NmeaSentenceMessageEvent != null)
                {
                    NmeaSentenceMessage nmeaSentenceMessage = new NmeaSentenceMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = nmeaSentenceMessage;
                    NmeaSentenceMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.AviationAttitude:
                if (AviationAttitudeMessageEvent != null)
                {
                    AviationAttitudeMessage aviationAttitudeMessage = new AviationAttitudeMessage(e.Message);
                    MessageEventArgs        mesgEventArgs           = new MessageEventArgs();
                    mesgEventArgs.Message = aviationAttitudeMessage;
                    AviationAttitudeMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Video:
                if (VideoMessageEvent != null)
                {
                    VideoMessage     videoMessage  = new VideoMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = videoMessage;
                    VideoMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.VideoTitle:
                if (VideoTitleMessageEvent != null)
                {
                    VideoTitleMessage videoTitleMessage = new VideoTitleMessage(e.Message);
                    MessageEventArgs  mesgEventArgs     = new MessageEventArgs();
                    mesgEventArgs.Message = videoTitleMessage;
                    VideoTitleMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.VideoDescription:
                if (VideoDescriptionMessageEvent != null)
                {
                    VideoDescriptionMessage videoDescriptionMessage = new VideoDescriptionMessage(e.Message);
                    MessageEventArgs        mesgEventArgs           = new MessageEventArgs();
                    mesgEventArgs.Message = videoDescriptionMessage;
                    VideoDescriptionMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.VideoClip:
                if (VideoClipMessageEvent != null)
                {
                    VideoClipMessage videoClipMessage = new VideoClipMessage(e.Message);
                    MessageEventArgs mesgEventArgs    = new MessageEventArgs();
                    mesgEventArgs.Message = videoClipMessage;
                    VideoClipMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Course:
                if (CourseMessageEvent != null)
                {
                    CourseMessage    courseMessage = new CourseMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = courseMessage;
                    CourseMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.CoursePoint:
                if (CoursePointMessageEvent != null)
                {
                    CoursePointMessage coursePointMessage = new CoursePointMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = coursePointMessage;
                    CoursePointMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SegmentId:
                if (SegmentIdMessageEvent != null)
                {
                    SegmentIdMessage segmentIdMessage = new SegmentIdMessage(e.Message);
                    MessageEventArgs mesgEventArgs    = new MessageEventArgs();
                    mesgEventArgs.Message = segmentIdMessage;
                    SegmentIdMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SegmentLeaderboardEntry:
                if (SegmentLeaderboardEntryMessageEvent != null)
                {
                    SegmentLeaderboardEntryMessage segmentLeaderboardEntryMessage = new SegmentLeaderboardEntryMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = segmentLeaderboardEntryMessage;
                    SegmentLeaderboardEntryMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SegmentPoint:
                if (SegmentPointMessageEvent != null)
                {
                    SegmentPointMessage segmentPointMessage = new SegmentPointMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = segmentPointMessage;
                    SegmentPointMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SegmentLap:
                if (SegmentLapMessageEvent != null)
                {
                    SegmentLapMessage segmentLapMessage = new SegmentLapMessage(e.Message);
                    MessageEventArgs  mesgEventArgs     = new MessageEventArgs();
                    mesgEventArgs.Message = segmentLapMessage;
                    SegmentLapMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.SegmentFile:
                if (SegmentFileMessageEvent != null)
                {
                    SegmentFileMessage segmentFileMessage = new SegmentFileMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = segmentFileMessage;
                    SegmentFileMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Workout:
                if (WorkoutMessageEvent != null)
                {
                    WorkoutMessage   workoutMessage = new WorkoutMessage(e.Message);
                    MessageEventArgs mesgEventArgs  = new MessageEventArgs();
                    mesgEventArgs.Message = workoutMessage;
                    WorkoutMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.WorkoutSession:
                if (WorkoutSessionMessageEvent != null)
                {
                    WorkoutSessionMessage workoutSessionMessage = new WorkoutSessionMessage(e.Message);
                    MessageEventArgs      mesgEventArgs         = new MessageEventArgs();
                    mesgEventArgs.Message = workoutSessionMessage;
                    WorkoutSessionMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.WorkoutStep:
                if (WorkoutStepMessageEvent != null)
                {
                    WorkoutStepMessage workoutStepMessage = new WorkoutStepMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = workoutStepMessage;
                    WorkoutStepMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.ExerciseTitle:
                if (ExerciseTitleMessageEvent != null)
                {
                    ExerciseTitleMessage exerciseTitleMessage = new ExerciseTitleMessage(e.Message);
                    MessageEventArgs     mesgEventArgs        = new MessageEventArgs();
                    mesgEventArgs.Message = exerciseTitleMessage;
                    ExerciseTitleMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Schedule:
                if (ScheduleMessageEvent != null)
                {
                    ScheduleMessage  scheduleMessage = new ScheduleMessage(e.Message);
                    MessageEventArgs mesgEventArgs   = new MessageEventArgs();
                    mesgEventArgs.Message = scheduleMessage;
                    ScheduleMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Totals:
                if (TotalsMessageEvent != null)
                {
                    TotalsMessage    totalsMessage = new TotalsMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = totalsMessage;
                    TotalsMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.WeightScale:
                if (WeightScaleMessageEvent != null)
                {
                    WeightScaleMessage weightScaleMessage = new WeightScaleMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = weightScaleMessage;
                    WeightScaleMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.BloodPressure:
                if (BloodPressureMessageEvent != null)
                {
                    BloodPressureMessage bloodPressureMessage = new BloodPressureMessage(e.Message);
                    MessageEventArgs     mesgEventArgs        = new MessageEventArgs();
                    mesgEventArgs.Message = bloodPressureMessage;
                    BloodPressureMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.MonitoringInfo:
                if (MonitoringInfoMessageEvent != null)
                {
                    MonitoringInfoMessage monitoringInfoMessage = new MonitoringInfoMessage(e.Message);
                    MessageEventArgs      mesgEventArgs         = new MessageEventArgs();
                    mesgEventArgs.Message = monitoringInfoMessage;
                    MonitoringInfoMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Monitoring:
                if (MonitoringMessageEvent != null)
                {
                    MonitoringMessage monitoringMessage = new MonitoringMessage(e.Message);
                    MessageEventArgs  mesgEventArgs     = new MessageEventArgs();
                    mesgEventArgs.Message = monitoringMessage;
                    MonitoringMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Hr:
                if (HrMessageEvent != null)
                {
                    HrMessage        hrMessage     = new HrMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = hrMessage;
                    HrMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.StressLevel:
                if (StressLevelMessageEvent != null)
                {
                    StressLevelMessage stressLevelMessage = new StressLevelMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = stressLevelMessage;
                    StressLevelMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.MemoGlob:
                if (MemoGlobMessageEvent != null)
                {
                    MemoGlobMessage  memoGlobMessage = new MemoGlobMessage(e.Message);
                    MessageEventArgs mesgEventArgs   = new MessageEventArgs();
                    mesgEventArgs.Message = memoGlobMessage;
                    MemoGlobMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.AntChannelId:
                if (AntChannelIdMessageEvent != null)
                {
                    AntChannelIdMessage antChannelIdMessage = new AntChannelIdMessage(e.Message);
                    MessageEventArgs    mesgEventArgs       = new MessageEventArgs();
                    mesgEventArgs.Message = antChannelIdMessage;
                    AntChannelIdMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.AntRx:
                if (AntRxMessageEvent != null)
                {
                    AntRxMessage     antRxMessage  = new AntRxMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = antRxMessage;
                    AntRxMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.AntTx:
                if (AntTxMessageEvent != null)
                {
                    AntTxMessage     antTxMessage  = new AntTxMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = antTxMessage;
                    AntTxMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.ExdScreenConfiguration:
                if (ExdScreenConfigurationMessageEvent != null)
                {
                    ExdScreenConfigurationMessage exdScreenConfigurationMessage = new ExdScreenConfigurationMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = exdScreenConfigurationMessage;
                    ExdScreenConfigurationMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.ExdDataFieldConfiguration:
                if (ExdDataFieldConfigurationMessageEvent != null)
                {
                    ExdDataFieldConfigurationMessage exdDataFieldConfigurationMessage = new ExdDataFieldConfigurationMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = exdDataFieldConfigurationMessage;
                    ExdDataFieldConfigurationMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.ExdDataConceptConfiguration:
                if (ExdDataConceptConfigurationMessageEvent != null)
                {
                    ExdDataConceptConfigurationMessage exdDataConceptConfigurationMessage = new ExdDataConceptConfigurationMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = exdDataConceptConfigurationMessage;
                    ExdDataConceptConfigurationMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.FieldDescription:
                if (FieldDescriptionMessageEvent != null)
                {
                    FieldDescriptionMessage fieldDescriptionMessage = new FieldDescriptionMessage(e.Message);
                    MessageEventArgs        mesgEventArgs           = new MessageEventArgs();
                    mesgEventArgs.Message = fieldDescriptionMessage;
                    FieldDescriptionMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.DeveloperDataId:
                if (DeveloperDataIdMessageEvent != null)
                {
                    DeveloperDataIdMessage developerDataIdMessage = new DeveloperDataIdMessage(e.Message);
                    MessageEventArgs       mesgEventArgs          = new MessageEventArgs();
                    mesgEventArgs.Message = developerDataIdMessage;
                    DeveloperDataIdMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.DiveSummary:
                if (DiveSummaryMessageEvent != null)
                {
                    DiveSummaryMessage diveSummaryMessage = new DiveSummaryMessage(e.Message);
                    MessageEventArgs   mesgEventArgs      = new MessageEventArgs();
                    mesgEventArgs.Message = diveSummaryMessage;
                    DiveSummaryMessageEvent(sender, mesgEventArgs);
                }
                break;

            case (ushort)MessageNum.Pad:
                if (PadMessageEvent != null)
                {
                    PadMessage       padMessage    = new PadMessage(e.Message);
                    MessageEventArgs mesgEventArgs = new MessageEventArgs();
                    mesgEventArgs.Message = padMessage;
                    PadMessageEvent(sender, mesgEventArgs);
                }
                break;
            }
        }