Detect OS and use appropriate device and tooling

Signed-off-by: Neville Dalal <git@nevd.org>
pull/452/head
Neville Dalal 6 years ago
parent 28a589be03
commit c98dfda4d5

@ -15,9 +15,23 @@
set -e set -e
DEVICE="${DEVICE:-/dev/ttyACM0}" OS=$(uname -s)
case ${OS} in
Linux)
DEVICE="${DEVICE:-/dev/ttyACM0}"
stty -F "${DEVICE}" 9600 raw -echo stty -F "${DEVICE}" 9600 raw -echo
;;
Darwin)
DEVICE="${DEVICE:-/dev/cu.usbmodemCkbio01E}"
stty -f "${DEVICE}" 9600 raw -echo
;;
*)
echo "Error Unknown OS : ${OS}" >&2
exit 1
;;
esac
exec 3<"${DEVICE}" exec 3<"${DEVICE}"
echo "$@" >"${DEVICE}" echo "$@" >"${DEVICE}"

Loading…
Cancel
Save