I'll never understand the mindset behind windows developers that says: "When starting a project to do some simple low-level task, first throw up a uselessly simple GUI application and put a button on it." I mean, half of this article is about how to use the GUI wizard, just to show off about 10 lines of code.
Beyond that, it's reasonably instructive. I'm happy to know that RS-232 isn't forgotten in the .NET world; there is lots of legacy hardware out with important things to say.
Although I was amused by this bit of hubris in the API design:
serialPort1.StopBits= StopBits.One;
I'd be curious to hear why the designer felt that the concept of a "stop bit" was so important or complicated that it deserved its own abstraction for the number one. :)
It looks like the StopBits enumeration is in place for type-safety. It has the values None, One, Two, and OnePointFive. With just those four values, any representation other than an enumeration would be either inefficient or confusing.
For any low-lever hardware engineers, I can highly recommend using Python. The struct module is by far the easiest way to send and interpret exact bits along a wire.
Before you criticize this article as simplistic or unnecessary (arguments about interest to this audience aside), consider that .NET 1.1 didn't have built-in serial port communication. Having spent many hours hacking serial comm in C#, I can say that this would have been a welcome resource, even given its brevity.
[+] [-] ajross|17 years ago|reply
Beyond that, it's reasonably instructive. I'm happy to know that RS-232 isn't forgotten in the .NET world; there is lots of legacy hardware out with important things to say.
Although I was amused by this bit of hubris in the API design:
I'd be curious to hear why the designer felt that the concept of a "stop bit" was so important or complicated that it deserved its own abstraction for the number one. :)[+] [-] jcl|17 years ago|reply
http://msdn.microsoft.com/en-us/library/system.io.ports.stop...
http://en.wikipedia.org/wiki/Asynchronous_start-stop
[+] [-] ivankirigin|17 years ago|reply
[+] [-] revolvingcur|17 years ago|reply
[+] [-] ionela|17 years ago|reply
[+] [-] prospero|17 years ago|reply
A dog is a four-legged animal that goes woof.
A cow is like a dog, but it's larger, and goes moooooo.