serial icon indicating copy to clipboard operation
serial copied to clipboard

Allow configuring `cc[VMIN]` and `cc[VTIME]`

Open Nabav opened this issue 2 years ago • 1 comments

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.

Nabav avatar Jan 10 '24 15:01 Nabav

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

ikskuh avatar Jan 13 '24 09:01 ikskuh