diff options
| author | info@mode42.com <info@mode42.com> | 2026-08-07 18:25:13 +0000 |
|---|---|---|
| committer | info@mode42.com <info@mode42.com> | 2026-08-07 18:25:13 +0000 |
| commit | 04d965d67a7264a1c7c211494aebda1953df7603 (patch) | |
| tree | 0ebd700a6e219f84a26a656f4bee8778bc75da7b /stacks/tncs/tnc2c-host-reset.sh | |
Initial push
Diffstat (limited to 'stacks/tncs/tnc2c-host-reset.sh')
| -rwxr-xr-x | stacks/tncs/tnc2c-host-reset.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/stacks/tncs/tnc2c-host-reset.sh b/stacks/tncs/tnc2c-host-reset.sh new file mode 100755 index 0000000..d0d1499 --- /dev/null +++ b/stacks/tncs/tnc2c-host-reset.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# TNC2C host-mode recovery — DTR+RTS high, software ladder (no power cycle usually). +# +# Usage: +# ./tnc2c-host-reset.sh +# ./tnc2c-host-reset.sh --kiss # recover + enter KISS +# ./tnc2c-host-reset.sh --power-hint # if recovery fails: cycle power + boot-wait +# ./tnc2c-host-reset.sh --no-kiss # skip KISS return frame in ladder + +set -euo pipefail +ROOT="$(cd "$(dirname "$0")" && pwd)" +# shellcheck source=load-serial-env.sh +source "${ROOT}/load-serial-env.sh" +load_serial_env tnc2c "${ROOT}" || true +apply_tnc2c_env +if [[ -n "${SERIAL_ENV_FILE:-}" ]]; then + echo "Using serial env: ${SERIAL_ENV_FILE}" >&2 +else + echo "WARN: no tnc2c-serial.env found — using ${TNC_DEV} ${TNC_BAUD} ${TNC_LINE}" >&2 +fi +exec python3 "${ROOT}/tnc2c-host-reset.py" "${TNC_DEV}" --baud "${TNC_BAUD}" --line "${TNC_LINE}" "$@" |
