Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting the state of a serial ports CTS pin

Posted on 2004-04-03
2
659 Views
Last Modified: 2013-12-03
Hi,
After using WaitCommEvent to get a EV_CTS event, how can I retrieve the 'actual' state of the cts input pin?

Thanks
dsch
0
Comment
Question by:dsch
2 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 250 total points
ID: 10749904
The GetCommModemStatus function retrieves modem control-register values.


BOOL GetCommModemStatus(
  HANDLE hFile,
  LPDWORD lpModemStat
);

Parameters
hFile

[in] Handle to the communications device. The CreateFile function returns this handle.
lpModemStat

[out] Pointer to a variable that specifies the current state of the modem control-register values. This parameter can be one or more of the following values. Value Meaning
MS_CTS_ON The CTS (clear-to-send) signal is on.
MS_DSR_ON The DSR (data-set-ready) signal is on.
MS_RING_ON The ring indicator signal is on.
MS_RLSD_ON The RLSD (receive-line-signal-detect) signal is on.

0
 
LVL 1

Author Comment

by:dsch
ID: 10751055
Cheers,
Got that working straight away, Thanks for your help.
Kind Regards
David S
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question