Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clear the input buffer? #97

Open
Wiggan opened this issue Apr 18, 2023 · 1 comment
Open

How to clear the input buffer? #97

Wiggan opened this issue Apr 18, 2023 · 1 comment

Comments

@Wiggan
Copy link

Wiggan commented Apr 18, 2023

Hi,

In ordinary pyserial I can do:
self.serial_port.reset_input_buffer() self.serial_port.reset_output_buffer()

With pyserial_asyncio I try to do:
self.writer.transport.serial.reset_input_buffer() self.writer.transport.serial.reset_output_buffer()

This feels wrong, and also does not clear the input buffer. I have stray newlines due to the thing I'm talking to being a bit inconsistent.
How am I supposed to reset these buffers with pyserial_asyncio?

Best regards,
Fredrik

@syshriki9
Copy link

I second this ^^^. There is no "public access" to the input buffer. The only way to clear it is via reader._buffer.clear() (obviously this could break in future releases)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants