#!/bin/bash

set -e
set -u

# sudo ip link set down can0
# sudo ip link set can0 type can bitrate 1000000
# sudo ip link set can0 type can bitrate 125000
# sudo ip link set can0 type can bitrate  62500
# do ip link set can0 type can bitrate  31250
# sudo ip link set can0 type can bitrate 500000
# 125000
# sudo ip link set up can0

# candump any,0:0,#FFFFFFFF

cnt=0

while [ 1 ]; do
    # cansend can0 123#DEADBEEF

    # cansend can0 001#FFFFFFFFFFFFFFFF
    # cansend can0 '001#00'
    # cansend can0 1F334455#1122334455667788
    # sleep 8

    cansend can0 "008#DEADBEEF"
    cansend can0 1F334455#1122334455667788
    echo "Sleep... $cnt"
    sleep 1
    let cnt+=1
done

echo "[$0] fin."

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