#!/bin/bash ########################################################################### # # Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file setup_canbus.sh # # @author (last) Peter Lucia # @date (last) 02-Jun-2021 # @author (original) Peter Lucia # @date (original) 01-Apr-2020 # ############################################################################ iface="can0" if [ "$#" -gt 1 ]; then echo "Please provide only one can interface." echo "Usage (defaults to can0): setup_canbus.sh " echo " Use instead: setup_canbus.sh " exit 1 elif [ "$#" -eq 1 ]; then iface="$1" fi sudo ip link set "$iface" up type can bitrate 250000 restart-ms 100 sudo ifconfig can0 txqueuelen 4000