Looks like the issue you're running into is with manufacturer specific fields. There is a bug in the SDK Encode logic when there is a compatible Definition in the file, but the SDK encounters a field that it does not recognise.
The fix is fairly simple, I've attached a diff so you can work around the issue you are seeing until we can get the fix included in the next Release.
diff --git a/Dynastream/Fit/Field.cs b/Dynastream/Fit/Field.cs
index 22515f9..2fad2f3 100644
--- a/Dynastream/Fit/Field.cs
+++ b/Dynastream/Fit/Field.cs
@@ -145,6 +145,11 @@ namespace Dynastream.Fit
this.isAccumulated = accumulated;
this.profileType = profileType;
}
+
+ internal Field(byte num, byte type)
+ : this("unknown", num, type, 1.0d, 0.0d, "", false, Profile.Type.NumTypes)
+ {
+ }
#endregion
#region Methods
diff --git a/Dynastream/Fit/Mesg.cs b/Dynastream/Fit/Mesg.cs
index 1b32f42..0be4526 100644
--- a/Dynastream/Fit/Mesg.cs
+++ b/Dynastream/Fit/Mesg.cs
@@ -392,8 +392,7 @@ namespace Dynastream.Fit
}
else
{
- //Field does not exist in profile, continue to next field
- continue;
+ field = new Field(fieldDef.Num, fieldDef.Type);
}
}
Another option would be to not bridge the Message Definitions, and to let the SDK automate writing the definitions as required.
Thanks!
File Attachments
-
diff.txt
(File Size: 1KB - Downloads: 669)