[nSLUG] Re: /dev/ttyS0: open from Perl ?? [An answer found]
jeffw at chebucto.ns.ca
Thu Mar 11 01:44:22 AST 2004
On Wed, 2004-03-10 at 23:28, Mike wrote:
> jeff> CPAN is your friend. Look at Device::SerialPort.
> Hah! Okay. Well, as far as I can puzzle out on short notice, the
> part of Device::SerialPort that opens a dialogue with /dev/ttyS0 is
> just a front end for IO::Handle which is a front end for open().
Well, yes. And its all just a front end to NAND gates.
> But I think I have the answer: open( /dev/$THE_SERIAL_PORT... will
> hang waiting for DCD to go high if clocal is off. It's off by default
> on my machine. If I run:
> stty -F /dev/ttyS0 clocal
Device::SerialPort handles that stuff for you at a much higher level.
The example programs it includes I stripped down for my purpose.
More information about the nSLUG