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
pcan-usb Device number
pcan-usb Device number
- Attachments
-
- Screenshot from 2017-02-12 10-22-37.png (68.51 KiB) Viewed 3353 times
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: pcan-usb Device number
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
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