You are here: Forum Home → ANT Developers Forums → ANT+ FIT Forum Has Moved → Thread
foreach (FieldDefinition fieldDef in mesgDef.GetFields())
{
Field field = GetField(fieldDef.Num);
if (field == null)
{
field = Profile.GetField(this.Num, fieldDef.Num);
fields.Add(field);
}
OnMesg: Received Mesg with global ID#23, its name is DeviceInfo
Field0 Index0 ("Timestamp" Field#253) Value: 819276807 (raw value 819276807)
Field1 Index0 ("SerialNumber" Field#3) Value: 3914514626 (raw value 3914514626)
Field2 Index0 ("Manufacturer" Field#2) Value: 1 (raw value 1)
Field3 Index0 ("Product" Field#4) Value: 2157 (raw value 2157)
Field4 Index0 ("SoftwareVersion" Field#5) Value: 3.2 (raw value 320)
Field5 Index0 ("DeviceIndex" Field#0) Value: 0 (raw value 0)
Field6 Index0 ("SourceType" Field#25) Value: 5 (raw value 5)
OnMesg: Received Mesg with global ID#23, its name is DeviceInfo
Field0 Index0 ("Timestamp" Field#253) Value: 819276807 (raw value 819276807)
Field1 Index0 ("SerialNumber" Field#3) Value: 925379282 (raw value 925379282)
Field2 Index0 ("CumOperatingTime" Field#7) Value: 55072 (raw value 55072)
Field3 Index0 ("unknown" Field#15) Value: 7805 (raw value 7805)
Field4 Index0 ("unknown" Field#16) Value: 361 (raw value 361)
Field5 Index0 ("unknown" Field#24) Value: 24652498 (raw value 24652498)
Field6 Index0 ("Manufacturer" Field#2) Value: 13 (raw value 13)
Field7 Index0 ("Product" Field#4) Value: 2 (raw value 2)
Field8 Index0 ("SoftwareVersion" Field#5) Value: 3 (raw value 300)
Field9 Index0 ("DeviceIndex" Field#0) Value: 1 (raw value 1)
Field10 Index0 ("DeviceType" Field#1) Value: 120 (raw value 120)
Field11 Index0 ("unknown" Field#9) Value: 96 (raw value 96)
Field12 Index0 ("AntNetwork" Field#22) Value: 1 (raw value 1)
Field13 Index0 ("SourceType" Field#25) Value: 1 (raw value 1)
foreach (FieldDefinition fieldDef in mesgDef.GetFields())
{
Field field = GetField(fieldDef.Num);
if (field == null)
{
field = Profile.GetField(this.Num, fieldDef.Num);
if (field == null)
{
field = new Field("Unknown", fieldDef.Num, fieldDef.Type, 1.0f, 0.0f, string.Empty, false);
}
fields.Add(field);
}
foreach (FieldDefinition fieldDef in mesgDef.GetFields())
{
Field field = GetField(fieldDef.Num);
if (field == null)
{
field = Profile.GetField(this.Num, fieldDef.Num);
if (field != null)
{
fields.Add(field);
}
else
{
//Field is not defined in the Profile, continue
continue;
}
}
//Code below continues to reference field object
} //end of foreach