2022-07-30 05:07:11 +00:00
|
|
|
#!/bin/sh
|
2022-11-12 14:00:18 +00:00
|
|
|
#
|
|
|
|
# Secondary UART device name exposed when m1n1 boots is /dev/m1n1-sec on
|
|
|
|
# Linux host and /dev/cu.usbmodemP_03 on macOS host
|
|
|
|
#
|
|
|
|
DEFAULT_SECDEV=/dev/m1n1-sec
|
|
|
|
PLATFORM_NAME=$(uname)
|
|
|
|
|
|
|
|
case "${PLATFORM_NAME}" in
|
|
|
|
Darwin)
|
|
|
|
SECDEV=/dev/cu.usbmodemP_03 ;;
|
|
|
|
*)
|
|
|
|
SECDEV="$DEFAULT_SECDEV" ;;
|
|
|
|
esac
|
|
|
|
|
2022-12-13 18:04:40 +00:00
|
|
|
if [ "$M1N1DEVICE" ] ; then
|
|
|
|
SECDEV="$M1N1DEVICE"
|
|
|
|
echo "warning: overriding device name from M1N1DEVICE environment variable ($DECDEV)!"
|
|
|
|
fi
|
|
|
|
|
2022-11-12 14:00:18 +00:00
|
|
|
# The secondary UART device shows up when m1n1 boots on the tethered machine
|
|
|
|
echo "Waiting for UART device file '$SECDEV' to appear (Ctrl+C to abort)..."
|
2022-07-30 05:07:11 +00:00
|
|
|
|
|
|
|
while true; do
|
2022-11-12 14:00:18 +00:00
|
|
|
while [ ! -e $SECDEV ] ; do sleep 1 ; done
|
|
|
|
picocom --omap crlf --imap lfcrlf -b 500000 $SECDEV
|
2022-07-30 05:07:11 +00:00
|
|
|
sleep 1
|
|
|
|
done
|