I am on SDK 20.66.00-0-gc7b345b. As for me there is some inconsistency in FIT SDK while processing developer fields with default values.
1) FIT SDK C++ decoder does not save value for fields with defaults. However it still saves this entry. As a result we have an entry with no value. I am referring to FieldBase::Read() with returns FIT_TRUE even for entries with default values, i.e:
if (memcmp(point, baseTypeInvalids[GetType() & FIT_BASE_TYPE_NUM_MASK], typeSize) != 0)
{
values.insert(values.end(), byteData, byteData + bytesLeft);
break;
}
2) FIT SDK C++ encoder on the other hand does not ignore fields with default value and writes them to file.
It seems to me that SDK should have the same behavior while processing default values. Either ignore them completely or save as is.
Also I do not see any reason to save field, but do not save it's value. So propose to update FieldBase::Read() to return FIT_FALSE when field with default values is encountered. This way we can detect such fields and ignore them during decoding. For example, add a check like to Decode::ReadByte():
if (FIT_TRUE == field.Read(&fieldData;, fldDefn->GetSize()))
{
mesg.AddDeveloperField(field);
}