pcan-usb Device number

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
altran
Posts: 14
Joined: Sat 5. Nov 2016, 07:11

pcan-usb Device number

Post by altran » Sun 12. Feb 2017, 21:03

When I plug in a PCAN-USB device and run dmesg, Linux recognizes the device number that is flashed to it and correlates it with a can network device number. Is there any way I can programatically get this info (can0 -> device 8)? It would be useful when I attached multiple PCAN-USB devices.

*Note, I am using the preinstalled Linux kernel drivers for use with SocketCAN.
See the attached image: dmesg says can0 is attached to device 8
Attachments
Screenshot from 2017-02-12 10-22-37.png
Screenshot from 2017-02-12 10-22-37.png (68.51 KiB) Viewed 3353 times

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: pcan-usb Device number

Post by S.Grosjean » Mon 13. Feb 2017, 11:48

Hello,

When running the mainline driver you won't have any possibility to attach a "canX" network interface a specific CAN channel. This is specifically true with hotplug interfaces like USB. canX enumeration depends only on the time the device has been probed.

*BUT* with using our "pcan" driver, you'll have the ability to always assign a specific PCAN-USB CAN channel to the same canX.

Regards,

Stéphane
— Stéphane

Post Reply