Re: rs232...
- From: Stuart Redmann <DerTopper@xxxxxx>
- Date: Fri, 22 Sep 2006 11:18:39 +0200
Robby wrote:
Hello Scott and everyone else who will read this post.
After many messages that I posted on the news groups about rs232, I have come up with functional code which reads in as many as 25 characters in one operation, meaning that a micro-controller can send 25 bytes to the PC and VC++ has no problem reading this.
[snipped code of sample application]
The above code has been extensively tested, many times and has never failed.[snip]
I have one question though! What is the advantage of using the Wndserial class as opposed to using functions like CreateFile, WriteFile, ReadFile, and CloseHandle.
I think this is properly explained at the codeproject homepage. Maybe I should add that this piece of software is quite sophisticated (as opposed to the wrapper class I used to use), so you don't have to worry about that you don't see through it at once (neither do I).
Would I be better off, or is it because in Windows it would be too complicated!
It depends. If you don't need software handshaking, asynchronous notifications, and suchlike, you can use the plain old Read/WriteFile API.
Else it gets a bit complicated, I'm afraid. Since Read/WriteFile is not specifically designed with communication devices that can have large latency (as RS323 can have, depending on which device you're talking with), it's a but unhandy to use. One could say, that this form of communicating doesn't fit into the event driven model of data processing under Windows.
Regards,
Stuart
.
- References:
- rs232...
- From: Robby
- rs232...
- Prev by Date: Re: Deploying builds, PDB, C7 and debug symbols...
- Next by Date: Re: How to create a console while running MFC
- Previous by thread: rs232...
- Next by thread: Re: rs232...
- Index(es):
Loading