diff --git a/bin/focus-test b/bin/focus-test index dc8cef81..c235c154 100755 --- a/bin/focus-test +++ b/bin/focus-test @@ -15,9 +15,23 @@ set -e -DEVICE="${DEVICE:-/dev/ttyACM0}" +OS=$(uname -s) + +case ${OS} in + Linux) + DEVICE="${DEVICE:-/dev/ttyACM0}" + 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 -stty -F "${DEVICE}" 9600 raw -echo exec 3<"${DEVICE}" echo "$@" >"${DEVICE}"