# can_config_template.sh: Template for configuring HIL Tester CAN interfaces. Specifically leaning towards L3.
# @copyright: Highly Confidential and Proprietary Information. Copyright (c) Zoox
#
# Date Created: December 19, 2019
# Author: emiddleton
#
# Author's note: Adjust to your system requirements. The info below defaults for
# llc-feature1@zooxlabs.com

# Configure SC_CAN
ip link set can0 name SC_CAN
ip link set SC_CAN type can bitrate 500000 restart-ms 100
ip link set SC_CAN txqueuelen 4096
# Configure DAS_CAN
ip link set can1 name DAS_CAN
ip link set DAS_CAN type can bitrate 500000 restart-ms 100
ip link set DAS_CAN txqueuelen 4096
# Configure Chassis_CAN
ip link set can2 name Chassis_CAN
ip link set Chassis_CAN type can bitrate 500000 restart-ms 100
ip link set Chassis_CAN txqueuelen 4096
# Configure AI_CAN
ip link set can3 name AI_CAN
ip link set AI_CAN type can bitrate 500000 restart-ms 100
ip link set AI_CAN txqueuelen 4096

# Configure SC_CAN
ip link set can4 name SC_CAN2
ip link set SC_CAN2 type can bitrate 500000 restart-ms 100
ip link set SC_CAN2 txqueuelen 4096
# Configure DAS_CAN
ip link set can5 name DAS_CAN2
ip link set DAS_CAN2 type can bitrate 500000 restart-ms 100
ip link set DAS_CAN2 txqueuelen 4096
# Configure Chassis_CAN
ip link set can6 name Chassis_CAN2
ip link set Chassis_CAN2 type can bitrate 500000 restart-ms 100
ip link set Chassis_CAN2 txqueuelen 4096
# Configure AI_CAN
ip link set can7 name AI_CAN2
ip link set AI_CAN2 type can bitrate 500000 restart-ms 100
ip link set AI_CAN2 txqueuelen 4096

# Bring up all the interfaces
ifconfig SC_CAN up
ifconfig DAS_CAN up
ifconfig Chassis_CAN up
ifconfig AI_CAN up

ifconfig SC_CAN2 up
ifconfig DAS_CAN2 up
ifconfig Chassis_CAN2 up
ifconfig AI_CAN2 up
