Skip to content

Socketcand UNIX Socket Support #2018

@MichaByte

Description

@MichaByte

Is your feature request related to a problem? Please describe.

I am working with CAN bus in Docker containers. I personally find it more reliable to pass a UNIX socket path from the host to a container than it is to use host.containers.internal or whatever they call it these days. Socketcand natively supports binding to a UNIX socket, but there is no API to connect to it via python-can.

Describe the solution you'd like

An additional argument to SocketCanDaemonBus that allows specifying a socket path. When passed, it should allow for the host and port to be empty, and should change socket.AF_INET to socket.AF_UNIX on this line. The socket path should be passed to socket.connect() without the port.

Describe alternatives you've considered

I have tried long and hard to get communication working via standard TCP/IP but it just seems to hate me. This seems like the next best option, and I think it should be supported since it's a core feature of Socketcand :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions