-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Developer fields #44
Developer fields #44
Conversation
320992a
to
fc76a8f
Compare
To address my open questions:
Unless I get any change requests, this is now good to go from my end - draft status revoked. |
Great start on this! I went through an added some comments, for this change I'll need to run it over a separate corpus of test files that I've collected from other FIT file parsing repos. I also merged your linter work as well. |
b4b3586
to
cafe677
Compare
a1ca2ca
to
a4df80a
Compare
All the comments have been addressed from my point of view, please take a look. Also, I have rebased the branch on the current master status (since the linter changes were merged). |
If there is anything further I should do, please let me know. :) |
Thank you for all your work on this and for fielding the in-depth discussion on how best to get this implemented! |
This PR is on top of "Apply linter suggestions for cleaner code".
This is a draft PR, I would like some feedback, but functionally it works for me: My fit files with developer fields are now correctly parsed. This addresses issue #41.
What changed:
HashMap<(u8, u8), Value>
instead ofHashMap<u8, Value>
: The first u8 is the dev_data_idx, or 255 if this i not a developer field (but a "normal" field). If I understand the fit protocol document correctly 255 is not a valid dev_data_idx.HashMap<(u8, u8), DeveloperFieldDescription>
calleddeveloper_fields
. This is owned by the Decoder and when a field definition record is found, a new DeveloperFieldDescription is created from it, and added to the HashMap. The deserializer is passed a read only reference to this map: Inside is the information about theBaseType
that is needed by the deserializer indata_message_fields_impl
Open questions:
BaseType::from(FitBaseType::from(fit_base_type_id as &str).as_u8())
, this could be nicer if BaseType and FitBaseTyper were the same thing..expect
orpanic!
if it doesn't follow this? Or should we handle errors more gracefully?