]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - tests/00-rtt.sh
rtt-history is a separate test (with plot cmd only)
[can-benchmark.git] / tests / 00-rtt.sh
diff --git a/tests/00-rtt.sh b/tests/00-rtt.sh
new file mode 100755 (executable)
index 0000000..f79a06c
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+. _lib.sh
+
+t() {
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+    vca_canping -m 1 -R FF:$RTPRIO -v -e $DRIVER-times -g $DRIVER -t 1 -d $CAN0 -w 0 -n 10 -c $COUNT
+    kill $PID_S
+}
+
+
+
+p() { cat <<EOF
+set title "Round-trip time"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\
+              "lincan-1000.dat" with lp title "Lincan"
+EOF
+}
+
+PLOT_CMD[1]='
+set title "Round-trip time history"
+set logscale y
+set grid
+set xlabel "Ping number"
+set ylabel "Round-trip time [{/Symbol m}s]"
+plot "socketcan-times-1000.dat" with lines, "lincan-times-1000.dat" with lines
+'