# bmu_feature_1.sh: configures CAN interfaces for HIL tester bmu-feature1.zooxlabs.com
# @copyright: Highly Confidential and Proprietary Information. Copyright (c) Zoox
#
# Date Created: November 7, 2019
# Author: dparikh
#
# Author's note: defaults for bmu-smoker2.zooxlabs.com and bmu-feature1.zooxlabs.com

# Configure EMU_BDY_CAN2
ip link set can0 name EMU_BDY_CAN2
ip link set EMU_BDY_CAN2 type can bitrate 500000 restart-ms 100
ip link set EMU_BDY_CAN2 txqueuelen 4096
# Configure EMU_DR_CAN3
ip link set can1 name EMU_DR_CAN3
ip link set EMU_DR_CAN3 type can bitrate 500000 restart-ms 100
ip link set EMU_DR_CAN3 txqueuelen 4096
# Configure EMU_DR_CAN4
ip link set can2 name EMU_DR_CAN4
ip link set EMU_DR_CAN4 type can bitrate 500000 restart-ms 100
ip link set EMU_DR_CAN4 txqueuelen 4096
# Configure BDY_CAN2
ip link set can3 name BDY_CAN2
ip link set BDY_CAN2 type can bitrate 500000 restart-ms 100
ip link set BDY_CAN2 txqueuelen 4096
# Configure DR_CAN3
ip link set can4 name DR_CAN3
ip link set DR_CAN3 type can bitrate 500000 restart-ms 100
ip link set DR_CAN3 txqueuelen 4096
# Configure DR_CAN4
ip link set can5 name DR_CAN4
ip link set DR_CAN4 type can bitrate 500000 restart-ms 100
ip link set DR_CAN4 txqueuelen 4096
# Configure DR_CAN2
ip link set can6 name DR_CAN2
ip link set DR_CAN2 type can bitrate 500000 restart-ms 100
ip link set DR_CAN2 txqueuelen 4096
# Configure DR_CAN4B
ip link set can7 name DR_CAN4B
ip link set DR_CAN4B type can bitrate 500000 restart-ms 100
ip link set DR_CAN4B txqueuelen 4096
# Bring up all the interfaces
ifconfig EMU_BDY_CAN2 up
ifconfig EMU_DR_CAN3 up
ifconfig EMU_DR_CAN4 up
ifconfig BDY_CAN2 up
ifconfig DR_CAN3 up
ifconfig DR_CAN4 up
ifconfig DR_CAN2 up
ifconfig DR_CAN4B up
