Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Serial port - "input" vs "read"

by dasgar (Priest)
on Jun 29, 2017 at 19:05 UTC ( [id://1193859]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1193859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-16 15:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found