cantools.database.can.bus.py only used for .kcd parsing (need .dbc support)
See original GitHub issueHi,
Currently the database created from a .dbc file is always created sith an empty buses list. See https://github.com/eerimoq/cantools/blob/4bde521fb35787776092d6ec31dc1356e4b3c35a/cantools/database/can/formats/dbc.py#L1352-L1356
However, information about the bus can be found in the DBC. For instance in the one I’m using:
Bus name:
BA_DEF_ "DBName" STRING ;
BA_DEF_DEF_ "DBName" "";
BA_ "DBName" "Infotainment_AmplifierCAN";
Bus baudrate:
BA_DEF_ "Bauderate" INT 0 1000000;
BA_DEF_DEF_ "Bauderate" 125000;
BA_ "Bauderate" 125000;
Is it possible to add at least a Bus()
in the list with the following info?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
CAN BUS tools — cantools 34.3.0 documentation
CAN BUS tools in Python 3. DBC, KCD, SYM, ARXML 4 and CDD file parsing. CAN message encoding and decoding. Simple and extended...
Read more >cantools Documentation - Read the Docs
CAN BUS tools in Python 3. • DBC, KCD, SYM, ARXML 4 and CDD file parsing. • CAN message encoding and decoding.
Read more >cantools - PyPI
CAN BUS tools in Python 3. DBC, KCD, SYM, ARXML 3&4 and CDD file parsing. CAN message encoding and decoding. Simple and extended...
Read more >cantools/test_database.py at master - GitHub
"""Encode and decode a message without scaling the signal values. """ db = cantools.
Read more >How to use the cantools.database function in cantools - Snyk
To help you get started, we've selected a few cantools.database examples, based on popular ways it is used in public projects.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot. No matter of the default value, I did it only to be consistent with KCD parser.
I added tests and refactored a bit.
There was a comment that the default baudrate was copied from kcd.py. I changed the default baudrate to None, or unavailable. Let me know if it should be 500000 instead and I’ll change it back.