Open codembed opened 3 months ago
I considered it but if I recall correctly Windows provides an API to listen for changes to these signals but POSIX (Linux and macOS) does not.
On Linux at least there's the TIOCMIWAIT
operation for ioctl
that accomplishes this.
On Linux at least there's the
TIOCMIWAIT
operation forioctl
that accomplishes this.
If you spawn a thread exclusively for the purpose of waiting for signals. POSIX has frustratingly poor support for asynchronous I/O.
I am wondering if a
SerialPort
'signals' event was ever considered - to complementgetSignals
. To detect changes on RI, DCD and DSR (and CTS), the application needs to continually poll by invokinggetSignals
. I guess one can just poll withgetSignals()
every 100-500ms or so, but it seems to diverge from good asynchronous programming.Was a
SerialPort
'signals' or 'signalschange' event overlooked, or intentionally omitted for simplicity?