You are here: Forum Home → ANT Developers Forums → ANT+ FIT Forum Has Moved → Thread
Decode decodeDemo = new Decode();
MesgBroadcaster mesgBroadcaster = new MesgBroadcaster();
// Connect the Broadcaster to our event (message) source (in this case the Decoder)
decodeDemo.MesgEvent += mesgBroadcaster.OnMesg;
decodeDemo.MesgDefinitionEvent += mesgBroadcaster.OnMesgDefinition;
decodeDemo.DeveloperFieldDescriptionEvent += OnDeveloperFieldDescriptionEvent;
// Subscribe to message events of interest by connecting to the Broadcaster
mesgBroadcaster.MesgEvent += OnMesg;
mesgBroadcaster.MesgDefinitionEvent += OnMesgDefn;
mesgBroadcaster.FileIdMesgEvent += OnFileIDMesg;
mesgBroadcaster.UserProfileMesgEvent += OnUserProfileMesg;
mesgBroadcaster.MonitoringMesgEvent += OnMonitoringMessage;
mesgBroadcaster.DeviceInfoMesgEvent += OnDeviceInfoMessage;
mesgBroadcaster.RecordMesgEvent += OnRecordMessage;
Dim decodeDemo As Dynastream.Fit.Decode = New Dynastream.Fit.Decode
Dim mesgBroadcaster As Dynastream.Fit.MesgBroadcaster = New Dynastream.Fit.MesgBroadcaster()
'Connect the Broadcaster to our event (message) source (in this case the Decoder)
AddHandler Decoder.MesgEvent, AddressOf mesgBroadcaster.OnMesg
AddHandler Decoder.MesgDefinitionEvent, AddressOf mesgBroadcaster.OnMesgDefinition
AddHandler Decoder.DeveloperFieldDescriptionEvent, AddressOf OnDeveloperFieldDescriptionEvent
'Subscribe to message events of interest by connecting to the Broadcaster
AddHandler mesgBroadcaster.MesgEvent, AddressOf OnMesg
AddHandler mesgBroadcaster.MesgDefinitionEvent, AddressOf OnMesgDefn
AddHandler mesgBroadcaster.FileIdMesgEvent, AddressOf OnFileIDMesg
AddHandler mesgBroadcaster.UserProfileMesgEvent, AddressOf OnUserProfileMesg
AddHandler mesgBroadcaster.MonitoringMesgEvent, AddressOf OnMonitoringMessage
AddHandler mesgBroadcaster.DeviceInfoMesgEvent, AddressOf OnDeviceInfoMessage
AddHandler mesgBroadcaster.RecordMesgEvent, AddressOf OnRecordMessage