In the newgroups there are many questions about serial communication so I thought:
make it public! It's freeware. The only thing I expect from users is that they drop me a mail.
All modifications on this class are free, but please let me know if it solves a bug
or adds some good features. Also comment your code and don't let me solve your bugs!
Target:
The class is not intended to use as a baseclass for modemcommunication but
more for driving hardware or reading hardware via the serial port.
From the classes included there is only one class important: CSerialPort.
The other classes are only there to illustrate the use of this class.
Usage:
In your software you only need to create an instance of the CSerialPort class
and call InitPort.
// the owner (CWnd) of the port (receives message)
Download these IBM resources today! e-Kit: IBM Rational Systems Development Solution
With systems teams under so much pressure to develop products faster, reduce production costs, and react to changing business needs quickly, communication and collaboration seem to get lost. Now, theres a way to improve product quality and communication.
Webcast: Asset Reuse Strategies for Success--Innovate Don't Duplicate!
Searching for, identifying, updating, using and deploying software assets can be a difficult challenge. eKit: Rational Build Forge Express
Access valuable resources to help you increase staff productivity, compress development cycles and deliver better software, fast. Download: IBM Data Studio v1.1
Effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life. eKit: Rational Asset Manager
Learn how to do more with your reusable assets, learn how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse.
The dwCommEvents flag can be used for communication with the owner of this class.
The flags can be one of the following (or combined with |):
WM_COMM_BREAK_DETECTED A break was detected on input.
WM_COMM_CTS_DETECTED The CTS (clear-to-send) signal changed state.
WM_COMM_DSR_DETECTED The DSR (data-set-ready) signal changed state.
WM_COMM_ERR_DETECTED A line-status error occurred. Line-status errors are CE_FRAME, CE_OVERRUN, and CE_RXPARITY.
WM_COMM_RING_DETECTED A ring indicator was detected.
WM_COMM_RLSD_DETECTED The RLSD (receive-line-signal-detect) signal changed state.
WM_COMM_RXCHAR A character was received and placed in the input buffer.
WM_COMM_RXFLAG_DETECTED The event character was received and placed in the input buffer.
Accept the first parameter all parameters are optional. The standard values are:
Then the tread that watches the port is started and all events on the port are send to
the owner. The receive a character the owner needs a messageentry in the messagemap:
Add www.codeguru.com to your favorites Add www.codeguru.com to your browser search box IE 7 | Firefox 2.0 | Firefox 1.5.xReceive news via our XML/RSS feed