#!/usr/bin/env bash
#
# A script to attach supplied USB with sllin.
#
# @copyright Highly Confidential and Proprietary Zoox Information. Copyright (c) Zoox
#
# Author: skapre
# Date Created: May 26, 2020
#
# Assumption: sllin_attach and can-utils have been compiled and sllin module has been inserted into kernel space.


LOG="$HOME/sllin_logs/build_sllin.txt"
CAN_REPO_NAME="$HOME/zoox/driving/can-utils"

cd ${CAN_REPO_NAME}
echo "  attach_sllin: Binding Interface ${1}">>$LOG
sudo ./sllin_attach -w "${1}" -n "${1:5}"
