Description: The biggest flaw in the program:
Windows interface of the hardware drivers abstract and standardization, a serial port is not exceptional also, most of the equipment can be stored through the API file operation control, such as: CreateFile and ReadFile, WriteFile, actually very simple. There's a SerialPort class on the net that's pretty good, and I'll just use it and make a small change to meet my requirements. Original class can only send and receive a Byte at a time, I changed to 512 Byte according to need, need to focus on, when to send and receive multibyte data, more the need to guarantee the correctness and completeness of the data, because a serial port protocol standard is defined at the physical layer and data link layer, for example, if a Byte sent 512, 512 Byte received is not necessarily correct, so you want to check to ensure correctness, or may not be a will complete received 512 Byte, but several times after collect all the data, then will we define related structure to ensure the data transceiver integrity. These details are related to the serial driver implementation, and the reader can view the relevant documents if they are interested. In this application completely without protection processing on the problem, given a small amount of sending and receiving data (512 Byte), and only own experiment, so write is not rigorous, the data transceiver ideal for one-time send and receive correctly, I hope you can take note.
File list (Check if you may need any files):