Giter Club home page Giter Club logo

Comments (6)

pylessard avatar pylessard commented on September 28, 2024 1

yes, the interface is part of the address, which is required to call bind, but not create the socket structure.
To create the socket, you need to know the protocol, e.g : family, message type, protocol ID (CAN, datagram, ISOTP)

from can-isotp.

pylessard avatar pylessard commented on September 28, 2024 1

Example here: https://github.com/linux-can/can-utils/blob/master/isotpsend.c#L254-L286
Line 254 should fail if the module isn't loaded

from can-isotp.

AndySchroder avatar AndySchroder commented on September 28, 2024

Possibly modinfo can_isotp can be used to see if it is installed, but I'm not sure if it can tell me if it is actually able to successfully load.

from can-isotp.

AndySchroder avatar AndySchroder commented on September 28, 2024

Also, when running isotprecv -s 123 -d 321 -l can0 I get

can: controller area network core
NET: Registered PF_CAN protocol family
can: isotp protocol

/var/log/syslog

.

Not sure if there is a way to trigger the registering of the PF_CAN protocol family other than trying to open a socket?

from can-isotp.

pylessard avatar pylessard commented on September 28, 2024

You know, you can create a socket without binding it to an address.
It will fail if the module isn't loaded, succeed without interfering with the bus if it is installed.

Seems like it is what you need. Is there an issue I don't know of?

from can-isotp.

AndySchroder avatar AndySchroder commented on September 28, 2024

I thought there might be a cleaner way, but I think that might work.

Does this approach work even if there are no CAN interfaces present on the machine?

from can-isotp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.