reading from serial device
perlminator
created: 2004-06-14 11:01:43
Hi,
i'm reading from the serial device this way:
$TTY = "/dev/ttyS0";

$STTY ="ignbrk -icrnl -ixon -opost -onlcr -isig -icanon -iexten parenb -parodd cs8 -echo -echoe"
        ." -echok -echoctl -echoke min 0 time 5 1200";

`stty $STTY <$TTY`;

open(IN,"$TTY") || die "\ncan not open Interface for reading $!\n";
open(OUT,">$TTY") || die "\ncan not open Interface for writeing $!\n";

$oldfh = select(OUT);
$| = 1;
select($oldfh);
$| = 1;
it is working quiet well,
the only problem is, that when there is no data
on the Port, my code has a timout of about 0.5sec.

How can i change this timeout to 0 sec?

bye perlminator
Re: reading from serial device
created: 2004-06-14 13:50:47

Replace time 5 with time 0, I guess.

This is just a guess. See stty(1) or go to a dedicated serial programming forum or mailing list.

Re^2: reading from serial device
created: 2004-06-15 02:47:44
Thanx calin
that was a big help
is working now

bye
Re: reading from serial device
created: 2004-06-15 03:22:51

You may want to look at Device::SerialPort. It offers a more refined interface than talking to the raw device.

After Compline,
Zaxo

perlmonks.org content © perlmonks.org and calin, perlminator, Zaxo

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03