开发者

Input and output buffer on the serial port

I wrote a 开发者_C百科small program that writes on serial port. I use SerialPort class (.NET Framework). When I write to serial port, immediately PortRecieved event was raised. Why program do that, when we know that serial port have input and output buffer. Write method writes to output buffer, read method reads from input buffer.


You'll need to check out the DataReceivedThreshold property. It defines how many bytes will accumulate in the buffer before firing the DataReceived event, and defaults to 1.

See also this Dev Center thread, which notes there may be some unexpected behavior with DataReceivedThreshold in some cases.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜