Device::SerialPins - per-pin low-level serial port access
use Device::SerialPins; my $sp = Device::SerialPins->new('/dev/ttyS0'); $sp->set_txd(1); $sp->set_dtr(1); $sp->set_rts(1); # aka $sp->set_pin3(1); $sp->set_pin4(1); $sp->set_pin7(1); warn "car ", $sp->car; warn "dsr ", $sp->dsr; warn "cts ", $sp->cts; warn "rng ", $sp->rng; # aka warn "car ", $sp->pin1; warn "dsr ", $sp->pin6; warn "cts ", $sp->pin8; warn "rng ", $sp->pin9;
my $sp = Device::SerialPins->new('/dev/ttyS0');
Note: there is currently no rxd/pin2
my $state = $sp->pin1;
my $state = $sp->pin3;
my $state = $sp->pin4;
my $state = $sp->pin6;
my $state = $sp->pin7;
my $state = $sp->pin8;
my $state = $sp->pin9;
Gets the state of a named or numbered pin.
$sp->get($pin);
You can only set the three output pins.
The setter methods have the three-letter pin names or the pin# numbered aliases. Also see the general-purpose set() method.
$sp->set_foo(1); # on $sp->set_foo(0); # off
Sets the state of a named or numbered pin.
$sp->set($pin, $bool);
Device::SerialPort for more typical usage.
http://www.easysw.com/~mike/serial/serial.html
Eric Wilhelm @ <ewilhelm at cpan dot org>
http://scratchcomputing.com/
If you found this module on CPAN, please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
If you pulled this development version from my /svn/, please contact me directly.
Copyright (C) 2007 Eric L. Wilhelm, All Rights Reserved.
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Device::SerialPins, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::SerialPins
CPAN shell
perl -MCPAN -e shell install Device::SerialPins
For more information on module installation, please visit the detailed CPAN module installation guide.