Adding PEAK CAN-FD support

This commit is contained in:
2023-07-12 05:46:22 -04:00
parent 746ef551a9
commit 1250190ddd
3 changed files with 164 additions and 1 deletions

View File

@ -0,0 +1,18 @@
#!/bin/sh
#
# External Udev program to rename peak_usb CAN interfaces according to the flashed device numbers.
#
# (C) 2023 PEAK-System GmbH by Stephane Grosjean
#
[ -z "$1" ] && exit 1
CAN_ID="/sys/class/net/$1/peak_usb/can_channel_id"
if [ -f $CAN_ID ]; then
devid=`cat $CAN_ID`
# PCAN-USB specific: use "000000FF" instead of "FFFFFFFF" below
if [ "$devid" != "00000000" -a "$devid" != "FFFFFFFF" ]; then
printf "can%d\n" 0x${devid}
exit 0
fi
fi
echo $1