Project

General

Profile

RE: SocketCAN configuration » config_can.sh

Jonathan Cormier, 01/20/2016 03:24 PM

 
#! /bin/sh

can_name=$1
bitrate=$2

if [ $# != 2 ]; then
echo "Usage config_can.sh can_name desired_bitrate"
else
# Make sure the can interface is down
ifconfig $can_name down

# Setup the can interface
ip link set $can_name type can bitrate $bitrate triple-sampling on

# Bring the can interfae back up
ifconfig $can_name up
fi

(1-1/2)