CaringCaribou / caringcaribou

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

python-can: interface, channel and bitrate configuration as command line arguments #84

Closed breachcircuit closed 9 months ago

breachcircuit commented 1 year ago

This issue proposes to be able to specify the interface, channel, and bitrate of the used connection.

The option to remove the command line argument interface was already discussed in Issue #52 and closed as python-can enables to give those arguments as kwargs. However, we could benefit from specifying those values in the command line if we work with multiple can connections at the same time and don't want to modify the code.

My suggestion would be to not require any arguments by default, but offer the option to the user and if specified, parse it to can_actions.

This would include

This should not interfere with any other usages of the tool but offer greater flexibility to users just working with the command line and multiple can connections.

kasperkarlsson commented 1 year ago

Hello @breachcircuit and thank you for creating this issue!

First off, this sounds like a good idea. It even seems to be well supported by python-can (as documented in https://python-can.readthedocs.io/en/stable/configuration.html#in-code), which is what we use under the hood.

My spontaneous feeling is that this could be implemented quite easily, but it will break backwards compatibility since Caring Caribou historically uses the wrong name (interface when specifyingchannel). Ripping the band-aid off by finally correcting that mistake would not be a bad idea :sweat_smile:

breachcircuit commented 1 year ago

Hello @kasperkarlsson, thank you for getting back to me on such short notice. I would take the time to create a pull request in the next days addressing this enhancement. Looking forward to your feedback!