This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

Andy Burgess

 __  __  __  __      __ ___   _____________________________________________
|__||__)/ __/  \|\ ||_   |   /
|  ||  \\__/\__/| \||__  |  /...Internet access for all Acorn RISC machines

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]