composer/projects/gk7205v300_ultimate_oko2/general/overlay/usr/bin/pw

23 lines
314 B
Bash
Executable File

#!/bin/sh
AT="AT+BTV"
SLEEP=0;
TTY=/dev/ttyUSB0
RESULT="";
while [[ -z "$RESULT" ]]
do
RESULT=$(cat $TTY & echo -ne "$AT\n" > $TTY; sleep $SLEEP; killall cat)
if [[ "$RESULT" == *"ommand"* ]]; then
RESULT="";
sleep 1;
fi
if [[ -z "$RESULT" ]]; then
sleep 0.1;
fi
done
r=${RESULT:4}
#echo $r;
r=${r::-2}
echo $r;