A point to pay attention to overlapping operation in serial port development

xiaoxiao2021-03-06  20

ReadFile When starting a overlapping operation, the Event object in the Overlapped structure is reset uncountable in a non-signal.

When reading overlapping operations, the number of read bytes specified by ReadFile and the actual number of bytes that are actually accepted should be too large. If the specified number is too large, the "GetoverlappedResult (GHCOMM, & OREAD, & DWBYTEREAD, TRUE); "Waiting for a long time.

The overlapping operation of the READFILE, returns normally in both: timeout and complete the specified read operation.

The calculation returned to the timeout is based on CommTIMEOUTS:

Total_timeout = (Multiplier * Number_OF_BYTES) Constant.

In addition:

There is a little waitcommmevent will not post wm_commnotify message

转载请注明原文地址:https://www.9cbs.com/read-40917.html

New Post(0)