Adding PEAK CAN-FD support
This commit is contained in:
18
sbin-scripts/peak_usb_device_namer
Executable file
18
sbin-scripts/peak_usb_device_namer
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user