Repository navigation
Conversation
PGN::dlc_ and SPN::length_ are uint16_t. Scale and offset stay double from the DBC decimal text. Enum keys are uint64_t, parsed with strtoull, and a value that does not fit fails the file. make_mask shifts 1ull. Length 0 and length above 64 are refused. read_bits casts the big-endian byte to uint64_t before the shift. The PGN table keeps every multiplex alternative. Two plain signals at the same start bit fail the compile. The packed union still keeps the first signal at a start bit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PGN::dlc_andSPN::length_areuint16_t. Scale and offset aredoubletaken from the DBC decimal text, so a factor such as1e-7is no longer rounded throughfloat.uint64_t.VAL_values are parsed withstrtoull. An empty value, a leading-, trailing junk, or a value past 2^64−1 fails the file. The generated C enum value isuint64_tas well.make_maskshifts1ull. Length 0 and length above 64 return 0.read_bitsandwrite_bitsrefuse those lengths and cast the big-endian byte touint64_tbefore shifting.Closes #8.
This branch is based on
issue-4(PR #10). The diff here is only the type fix.Test plan
j1939.dbcround-trip against the C databaseall_testsand coverage (needs Linux;linux/can.his not available on this Mac)