caringcaribou icon indicating copy to clipboard operation
caringcaribou copied to clipboard

Fixed missing context arg when creating CAN bus

Open minhyuk opened this issue 1 year ago • 3 comments

When using the configuration of python-can, it was guided to pass interface settings through context, so I made the modification.

https://python-can.readthedocs.io/en/stable/configuration.html

I have verified that it works properly with python-can-remote. Please review and provide feedback.

minhyuk avatar Jul 24 '23 00:07 minhyuk

Dear, Am I something do wrong?

minhyuk avatar Apr 17 '24 03:04 minhyuk

Hello @minhyuk,

I do not see the context keyword for can.Bus in the python-can documentation. Is this interface specific? I would otherwise expect to see it on https://python-can.readthedocs.io/en/stable/bus.html#can.Bus

Where can I read more about this?

kasperkarlsson avatar Apr 17 '24 05:04 kasperkarlsson

Hello @minhyuk,

I do not see the context keyword for can.Bus in the python-can documentation. Is this interface specific? I would otherwise expect to see it on https://python-can.readthedocs.io/en/stable/bus.html#can.Bus

Where can I read more about this?

First of all, Thank you for your feedback.

Actually, if you have CAN configuration file(.ini/.conf), you have to pass context argument via kwargs. here is some code for Bus interface https://github.com/hardbyte/python-can/blob/7dba4490c6c61385dc8cbe917e85492b4777b8f6/can/interface.py#L69

and some below, you can see this code for loading configuration from file https://github.com/hardbyte/python-can/blob/7dba4490c6c61385dc8cbe917e85492b4777b8f6/can/interface.py#L121

this code might helpful, understanding what I want do. If I am wrong, please let me know.

minhyuk avatar Apr 17 '24 14:04 minhyuk