# emu_3.sh: configures CAN interfaces for HIL tester emu-smoker3.zooxlabs.com
# @copyright: Highly Confidential and Proprietary Information. Copyright (c) Zoox
#
# Date Created: September 26, 2019
# Author: trawat
#
# Author's note: for use with emu_smoker3.

# 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 DR_CAN1
ip link set can3 name DR_CAN1
ip link set DR_CAN1 type can bitrate 500000 restart-ms 100
ip link set DR_CAN1 txqueuelen 4096
# Configure DR_CAN2
ip link set can4 name DR_CAN2
ip link set DR_CAN2 type can bitrate 500000 restart-ms 100
ip link set DR_CAN2 txqueuelen 4096
# Configure BDY_CAN1
ip link set can5 name BDY_CAN1
ip link set BDY_CAN1 type can bitrate 500000 restart-ms 100
ip link set BDY_CAN1 txqueuelen 4096
# Bring up all the interfaces
ifconfig UI_CAN up
ifconfig AI_CAN up
ifconfig EMU_CAN up
ifconfig DR_CAN1 up
ifconfig DR_CAN2 up
ifconfig BDY_CAN1 up
