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

Allow configuring cc[VMIN] and cc[VTIME] #11

Open
Nabav opened this issue Jan 10, 2024 · 1 comment
Open

Allow configuring cc[VMIN] and cc[VTIME] #11

Nabav opened this issue Jan 10, 2024 · 1 comment

Comments

@Nabav
Copy link

Nabav commented Jan 10, 2024

Currently, there are fixed configurations.

            settings.cc[VMIN] = 1;
            settings.cc[VSTOP] = 0x13; // XOFF
            settings.cc[VSTART] = 0x11; // XON
            settings.cc[VTIME] = 0;

In one application, this resulted to blocking read, since there were no time out and one byte was expected. So I have changed to

            settings.cc[VMIN] = 0;
            settings.cc[VSTOP] = 0x13; // XOFF
            settings.cc[VSTART] = 0x11; // XON
            settings.cc[VTIME] = 1;

and catched the error.EndOfStream after serial.reader().readByte().

This brings me to the point to request the ability to tweak these settings, if it is not yet there.

@ikskuh
Copy link
Collaborator

ikskuh commented Jan 13, 2024

You can use this:
https://github.com/ziglang/zig/blob/master/lib/std/io.zig#L403C8-L407
for nonblocking i/o

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