Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

EnumCustomProperty value is defined as integer index in dbc file #47

Closed
Brainy0207 opened this issue Sep 25, 2023 · 0 comments
Closed

Comments

@Brainy0207
Copy link

I copied the relevant lines from a sample J1939 file:

BO_ 2364540158 EEC1: 8 Vector__XXX
 SG_ EngineSpeed : 24|16@1+ (0.125,0) [0|8031.875] "rpm" Vector__XXX

BA_DEF_ BO_  "VFrameFormat" ENUM  "StandardCAN","ExtendedCAN","reserved","J1939PG";

BA_DEF_DEF_  "VFrameFormat" "J1939PG";

BA_ "VFrameFormat" BO_ 2364540158 3;

It seems the enum value for the message is specified by an integer index into the enum definition.
The current implementation just assumes a string value and copies the index as value into the property.

I couldn't find any solid information how enum values are supposed to be specified, but this is the way CANdb++ writes the dbc file.
I will try to provide a PR to handle this correctly.

Brainy0207 pushed a commit to Brainy0207/DbcParser that referenced this issue Sep 25, 2023
* EFeru#47 It seems like dbc files reference the enum value by index. Changed the parser logic to pass the quoted strings to handle both cases correctly and added additional tests.
Brainy0207 pushed a commit to Brainy0207/DbcParser that referenced this issue Sep 25, 2023
Brainy0207 pushed a commit to Brainy0207/DbcParser that referenced this issue Sep 25, 2023
Changed the parser logic to pass the quoted strings to handle both cases correctly.
Adhara3 added a commit that referenced this issue Sep 27, 2023
…ailures-management

#47 Custom properties parsing failures management
@Adhara3 Adhara3 closed this as completed Sep 27, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants