CaringCaribou / caringcaribou

A friendly car security exploration tool for the CAN bus
GNU General Public License v3.0
751 stars 197 forks source link

Fixed missing context arg when creating CAN bus #94

Open minhyuk opened 1 year ago

minhyuk commented 1 year ago

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 commented 7 months ago

Dear, Am I something do wrong?

kasperkarlsson commented 7 months ago

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?

minhyuk commented 7 months ago

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.