Sec has asked for the wisdom of the Perl Monks concerning the following question:
I have some old perl code that talks to a serial interface. It was using IO::Stty to set some modes. Unfortunately after some upgrades, this code now stopped working:
this is the result:open(Client,"+>/dev/ttyUSB0") || die "open: $!"; use IO::Stty; IO::Stty::stty(\*Client,"-crtscts"); IO::Stty::stty(\*Client,"19200"); IO::Stty::stty(\*Client,"-echo"); IO::Stty::stty(\*Client,"-icrnl");
Some googling turned up rt://97576 which suggests that IO:Stty has been abandoned.IO::Stty::stty passed invalid parameter 'crtscts' Can't use string ("POSIX::B19200") as a subroutine ref while "strict r +efs" in use at /usr/share/perl5/IO/Stty.pm line 567.
Does anyone have a suggestion on how to to id properly? My fallback solution is to just system() stty...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to set tty settings from perl
by haukex (Archbishop) on Dec 08, 2019 at 21:39 UTC | |
by Sec (Monk) on Dec 10, 2019 at 22:48 UTC | |
by haukex (Archbishop) on Dec 11, 2019 at 18:05 UTC | |
by Sec (Monk) on Dec 18, 2019 at 00:04 UTC |