Serial Settings

I need to communicate with a serial device through a null-modem cable from my embedded device running FreeBSD version 6.1, the serial device requires the following settings:
9600 baudrate, 8 data bits, 1 stop bit, no parity, XON/XOFF
and the device doesn't send back CRLF so I use the following command in a script:
stty -f /dev/ttyd1 9600 cs8 -cstopb -parenb ixon ixoff raw min 0 time 20
and I can successfully write to the device, but I can't read back. Maybe I need additional or other flags set to stty.

Please help. Here is my script:
Code:
#!/bin/bash
stty -f /dev/ttyd1 9600 cs8 -cstopb -parenb ixon ixoff raw min 0 time 20
echo "! U1 getvar \"appl.name\"\n" > /dev/ttyd1
while 
	read -t 2 var < /dev/ttyd1;
	do continue;
done
echo $var
Thank you in advance for any kind of assistance. Screen and Minicom are not installed in this embedded system.
 
Back
Top