开发者

how to clear serial buffer?

开发者 https://www.devze.com 2023-02-19 23:01 出处:网络
I am receiving messages over serial port from a micro-controller. i am using a baud rate of 9600. I have a program w开发者_运维技巧ritten using win32 API that receives the messages. Sometimes it happ

I am receiving messages over serial port from a micro-controller. i am using a baud rate of 9600. I have a program w开发者_运维技巧ritten using win32 API that receives the messages. Sometimes it happens that i am not able to receive the messages and then suddenly a burst comes in when i press Ctrl+C.

How do I clear the serial buffer so that i can avoid this flooding of data?

Thank you


The PurgeComm function does that.

When using serial ports in Windows, the Comm Port API reference is quite useful.

0

精彩评论

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

关注公众号