summaryrefslogtreecommitdiff
path: root/stacks/tncs/tnc2c-rf-tx-test.sh
blob: fc23eff7cb083e2003eb74c4e252ae1192cb5caa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Send N AX.25 UI frames via KISS (HyBBX must be stopped).
# Usage: ./tnc2c-rf-tx-test.sh [count] [message-prefix] [src] [dst]
# Example (root): pkill hybbx; ./tnc2c-rf-tx-test.sh 3 "TX test" CB-0 QST

set -euo pipefail

COUNT="${1:-3}"
PREFIX="${2:-TX test}"
SRC="${3:-CB-0}"
DST="${4:-QST}"
GAP="${TNC2C_TX_GAP:-8}"
ROOT="$(cd "$(dirname "$0")" && pwd)"

if pgrep -x hybbx >/dev/null 2>&1; then
    echo "ERROR: hybbx is running - as root: pkill hybbx" >&2
    exit 1
fi

echo "RF TX: ${COUNT}x ${SRC} -> ${DST}, ${GAP}s gap (SQ closed, CD off)"
for i in $(seq 1 "$COUNT"); do
    echo "=== SEND ${i}/${COUNT} $(date +%H:%M:%S) ==="
    "$ROOT/tnc2c-send-test.sh" "${PREFIX} ${i}/${COUNT}" "$SRC" "$DST"
    if [[ "$i" -lt "$COUNT" ]]; then
        sleep "$GAP"
    fi
done
echo "Done - check PTT LED / modem tone on radio."
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com