]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Add modifiers for sampling-point and sjw to can_if start/stop script. master
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 30 Sep 2011 11:40:21 +0000 (11:40 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 30 Sep 2011 11:40:21 +0000 (11:40 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1277 030b6a49-0b11-0410-94ab-b0dab22257f2

etc/can_if

index 1dbd67edc14cb3196f20c4d28950da0e12c09829..ca64a5ed368eaddb9006992375e55ad8798aab80 100755 (executable)
@@ -31,6 +31,12 @@ test -x /sbin/modprobe || exit 0
 # The syntax for the CAN devices is: devname[@bitrate][,restart-ms]
 # example CAN_IF="can0 can1@500000 can2@500000,200 can3,500"
 CAN_IF=""
+
+# To modify the sampling-point and SJW settings for the in-kernel bittiming
+# calculation. "0" => set default values (CAN CIA sampling-point / sjw=1)
+SAMPOINT="0" # example for 84% : SAMPOINT=".840"
+SJW="0"      # example for max. sjw : SJW="4"
+
 VCAN_IF="vcan0 vcan1 vcan2 vcan3"
 PROBE="vcan"
 
@@ -54,7 +60,7 @@ case "$1" in
                        if [ -n "$HASBTR" ]; then
                                BITRATE=${IF#*@}
                                BITRATE=${BITRATE%,*}
-                               /sbin/ip link set $DEVICE type can bitrate $BITRATE
+                               /sbin/ip link set $DEVICE type can bitrate $BITRATE sample-point $SAMPOINT sjw $SJW
                        fi
                        HASMS=`echo $IF | grep ","` 
                        if [ -n "$HASMS" ]; then