#!/bin/sh

# picocom.sh: Start picocom and remind the user how to exit.
# Copyright (C) 2021, Remington Furman

# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty, provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.

DEVICE=${1:-/dev/ttyUSB0}
BAUD=${2:-115200}

TITLE ()
{
    echo "\033]0;${1}\007"
}

# Set window title
echo -ne "$(TITLE "picocom $DEVICE -- C-a C-x to exit")"

/usr/bin/picocom -b "$BAUD" "$DEVICE"
