🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #23

Re: Getting State of Comm Lines

#23
From: Glenn Wallace
Date: Tue, 27 Oct 1992 23:13
56 lines
2742 bytes
kaiser@iai.kfk.de writes:

>I have a small problem using the comm drivers of Windows 3.1.
>How can I receive the status of the flow control lines, e.g. the
>state of the DSR line?

Pftfft! I'd like to know too!

>I've tried to use GetCommError(), but the Flags field of the COMSTAT
>structure always contains 0. I've also tried to use (different 
>combinations of) the GetCommEvntMask() and SetCommEventMask(), 
>but with no luck. Actually I didn't understand what this functions
>are useable for.

Setting the event mask tells COMM.DRV which events you are interested
in.

Using GetCommError, the state of the 'actual' bits, like DSR, is only
valid if the Delta DSR bit is set.

So, unless you can generate an event, you can't actually read an initial
state of the line. If you had that, you could track changes with each
event, and ... well the state is given to you anyway with each delta.

I've spent some time trying to get the right control flow logic for
serial stuff under windows. I now have a great little static library
that wrappers it very well, and makes 3.0/3.1 transparent, using timers
for 3.0 and events for 3.1.

I can't post the actual code (copyright, sigh) but I might post the
pseudocode as there are some VERY subtle nuances in the doco.

>If anybody of you can figure out what I'm obviously doing wrong,
>please help me!

Join the club. Maybe I'm just plain stupid. I was going to recompile
COMM.DRV to wdeb it and get to the bottom of it.

I put this little 'breakout' box of LEDs on my software's toolbar (TM)
but I just commented all the code our because of this very problem, no
time to look at it.

Also, I think it is DSR or one of the other lines gives me deltas, but
the state is always 0. A COMM.DRV bug for sure, but I haven't looked
yet to see if there is a new new version.

>Thank you very much for your effort, ... and don't worry, be happy ...

Meher Baber said that!

Glenn

Net: g.wallace@trl.oz.au | Well the escape plan is under way... Seattle
RealTime: Glenn Wallace  | is the destination. I have food, maps, clothing,
Work: --- Classified --- | and a compass. The X Committee has approved it,
      (to be announced)  | all I have to do is scale the compound wall.
Technical Details
Message-ID: <1992Oct27.231354.16115@trl.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!titan!titan!wallace
References: <BwsnIK.1EI@iai.kfk.de>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!titan!titan!wallace
From: wallace@titan.trl.OZ.AU (Glenn Wallace)
Subject: Re: Getting State of Comm Lines
Message-ID: <1992Oct27.231354.16115@trl.oz.au>
Sender: root@trl.oz.au (System PRIVILEGED Account)
Organization: Telecom Research Labs, Melbourne, Australia
References: <BwsnIK.1EI@iai.kfk.de>
Date: Tue, 27 Oct 1992 23:13:54 GMT
Lines: 56