# can_config_template.sh: Template for configuring HIL Tester CAN interfaces
# @copyright: Highly Confidential and Proprietary Information. Copyright (c) Zoox
#
# Date Created: September 26, 2019
# Author: trawat
#
# Author's note: Adjust to your system requirements. The info below defaults for
# emu-smoker2.zooxlabs.com and emu-smoker3.zooxlabs.com

# Configure UI_CAN
ip link set can0 name UI_CAN
ip link set UI_CAN type can bitrate 500000 restart-ms 100
ip link set UI_CAN txqueuelen 4096
# Configure AI_CAN
ip link set can1 name AI_CAN
ip link set AI_CAN type can bitrate 500000 restart-ms 100
ip link set AI_CAN txqueuelen 4096
# Configure EMU_CAN
ip link set can2 name EMU_CAN
ip link set EMU_CAN type can bitrate 1000000 restart-ms 100
ip link set EMU_CAN txqueuelen 4096
# Configure DR1_CAN
ip link set can3 name DR1_CAN
ip link set DR1_CAN type can bitrate 500000 restart-ms 100
ip link set DR1_CAN txqueuelen 4096
# Configure DR2_CAN
ip link set can4 name DR2_CAN
ip link set DR2_CAN type can bitrate 500000 restart-ms 100
ip link set DR2_CAN txqueuelen 4096
# Configure BDY1_CAN
ip link set can5 name BDY1_CAN
ip link set BDY1_CAN type can bitrate 500000 restart-ms 100
ip link set BDY1_CAN txqueuelen 4096
# Bring up all the interfaces
ifconfig UI_CAN up
ifconfig AI_CAN up
ifconfig EMU_CAN up
ifconfig DR1_CAN up
ifconfig DR2_CAN up
ifconfig BDY1_CAN up
