Need simple example showing how to apply dcb settings from the application
jerrywrice opened this issue · 6 comments
I'm a relative novice using type conversion operators (such Into) with rust.
Could you add an example source file that applies port settings using the DCB under Windows? To be clear, I understand how the serial DCB fields work with Windows serial ports, but don't know how to accomplish this from a rust application using the serial2 crate.
Thx
Is there anything from Settings
you're missing? Do you want access to the raw DCB
structure?
Hey! Currently there is indeed no way to access the raw DCB
fields or the timeouts. Do note that the timeouts are not in the DCB
struct, they're in the _COMMTIMEOUTS
struct, which requires a separate set of syscalls to manipulate.
I am interested in exposing platform specific configuration parameters, but there are some challenges with that. Would it suffice for your application to just set the read/write timeout (ReadTotalTimeoutConstant
)? Because that is already exposed through set_read_timeout()
.
Note that setting ReadIntervalTimeout
and ReadTotalTimeoutMultiplier
will cause read()
to return no data if the timeout is reached, not even whatever data has been received so far. This is normally a big problem, so you should be careful when using these settings.
Hey! As mentioned, I do want to support access to platform specific features.
It's currently open in #18. Could you have a look to see if it fits your needs?
Your latest merge of pr #18 into main resolves my request. Thx.