#!/bin/bash

set -e
set -u

sudo ip link set down can0
# sudo ip link set can0 type can bitrate 2000000
# sudo ip link set can0 type can bitrate 500000 triple-sampling on
# sudo ip link set can0 type can bitrate 500000
# sudo ip link set can0 type can bitrate 250000
# sudo ip link set can0 type can bitrate 125000
# sudo ip link set can0 type can bitrate  62500
# sudo ip link set can0 type can bitrate  31250
# sudo ip link set can0 type can bitrate 125000 triple-sampling off restart-ms 500

sudo ip link set can0 type can bitrate 125000 triple-sampling on restart-ms 500
# sudo ip link set can0 type can bitrate 50000 triple-sampling on restart-ms 500

sudo ip -details link show can0

# sudo ip link set can0 type can bitrate 500000
# sudo ip link set can0 type can bitrate 1000000
# 125000
sudo ip link set up can0

# candump any,0:0,#FFFFFFFF
# candump can0 any,0:0,#FFFFFFFF

echo "[$0] fin."

#---fin------------------------------------------------------------------------
