开发者

Input and output buffer on the serial port

开发者 https://www.devze.com 2023-04-13 09:14 出处:网络
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, wh

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

精彩评论

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

关注公众号