Project

General

Profile

Statistics
| Branch: | Revision:

root / util / read @ e66d0e5c

History | View | Annotate | Download (394 Bytes)

1 ec0eab37 Tom Mullins
#!/bin/bash
2
3
stty 9600 raw < /dev/ttyUSB0
4
#-echo -echok -icrnl -ixon -icanon -opost -onlcr 
5
6
xxd -r readhex > /dev/ttyUSB0
7
8
sleep 0.1
9
10
response=`head -c 5 /dev/ttyUSB0`
11 e66d0e5c Tom Mullins
ok="\001"
12 ec0eab37 Tom Mullins
13
if [ ${response:0:1} = $ok ]; then
14
  echo -n ${response:1} | xxd
15
else
16
  # if it failed, it hangs waiting for more characters anyway, so this never
17
  # happens unless the serial port is missing :(
18
  echo Failed.
19
fi