Add "ser" script for accessing the serial port
authorColin McCabe <colinmcc@lab126.com>
Tue, 15 Dec 2009 23:43:48 +0000 (15:43 -0800)
committerColin McCabe <colinmcc@lab126.com>
Tue, 15 Dec 2009 23:43:48 +0000 (15:43 -0800)
ser [new file with mode: 0755]

diff --git a/ser b/ser
new file mode 100755 (executable)
index 0000000..d5991e8
--- /dev/null
+++ b/ser
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+if [ $# -ne 1 ]; then
+       echo "usage: ${0} <serial-port>"
+       echo "example: ${0} USB0"
+       exit 1
+fi
+PORT="/dev/tty${1}"
+if test -c ${PORT}; then
+       :
+else
+       echo "no such device as ${PORT}"
+       exit 1
+fi
+
+/usr/bin/picocom --baud 115200 --flow n --parity n --databits 8 \
+--send-cmd sb --receive-cmd rb ${PORT}