This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Serial port hangs unless I run Hyperterminal?
- From: andyburgess <AndyBurgess at argonet dot co dot uk>
- To: cygwin at cygwin dot com
- Date: Mon, 23 Jan 2006 13:28:24 +0000 (GMT)
- Subject: Serial port hangs unless I run Hyperterminal?
Cygwin1.dll - version 1005.18.0.0 (Build date 2005-07-02 20:30)
Hi there,
I've been using the superb Cygwin environment for a few months now and am
very impressed with it!
I'm getting an issue when I run my GNU C program. It's hanging on the
write/read operation to a GSM modem attached to my COM1 *when* the PC has
initially been switched on from cold. However the crazy thing is if I run
Hyperterminal after boot-up, fire a couole of commands to the modem and close
Hyperterminal down, my program subsequently runs perfectly! In the program,
I've avoided setting anything on the modem (no tcsetattr) - except the O_RDWR
and O_NOCTTY on opening the port.
Can anyone tell me why it hangs? I saw that this was a problem
previously,(read()) but I assume it's been fixed now - as it works later! My
Hyperterminal settings are baud 19200, 8 data bits, no parity and hardware
flow control. I've noticed the following:
Prior to running Hyperterminal, my DOS port settings are:
MODE COM1: BAUD=1200 PARITY=n DATA=7 STOP=1 to=off xon=off odsr=off octs=off
dtr=on rts=on idsr=off
After hyperterminal they are:
MODE COM1: BAUD=19200 PARITY=n DATA=8 STOP=1 to=on xon=off odsr=off octs=on
dtr=on rts=hs idsr=off
I've tried setting the settings in a DOS batch program outside of
Hyperterminal, but it's no good. My program won't respond, unless I've run
Hyperterminal! What is the software setting that Hyperterminal uses that my C
program needs?
Also I've been having trouble with the tcsetattr and tcgetattr functions in C
(my program's not using them currently). Each time I call them - I get a
returned -1 - error status.
Cheers
Andy Burgess
--
__ __ __ __ __ ___ _____________________________________________
|__||__)/ __/ \|\ ||_ | /
| || \\__/\__/| \||__ | /...Internet access for all Acorn RISC machines
___________________________/ andyburgess@argonet.co.uk
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/