in reply to Serial port - "input" vs "read"

In doing a super quick scan of Device::SerialPort, I didn't see documentation on those methods. Since the module is described as "Linux/POSIX emulation of Win32::SerialPort functions", I did a super quick scan of Win32::SerialPort, but again didn't find much. Perhaps my super quick scans were too fast and I overlooked the information.

If you're ok with adding a layer of abstraction, you could check out Control::CLI, which will use Win32::SerialPort or Device::SerialPort for serial port communication. It's read and readwait methods are definitely documented.

I'm not necessarily advocating using Control::CLI over directly using Device::SerialPort. Just tossing out a suggestion on another module that you might find easier to use in your code.

Replies are listed 'Best First'.
Re^2: Serial port - "input" vs "read"
by fsonnichsen (Initiate) on Jul 06, 2017 at 13:02 UTC
    Thanks all for the responses. I have tried the other methods that you mentioned but probably did not play with them enough. At present I get "stale" data returns even thought I have -icanon set via a system call to stty (e.g. I am running in non canonical mode). I would have thought that in this mode the buffer is continuously flushed but it apparently is not even if I wait several seconds before a read. I have to "read down" the buffer to get the most recent data. I will try again with the other methods mentioned. fritz