Device::SerialPins - per-pin low-level serial port access


NAME

Device::SerialPins - per-pin low-level serial port access

Back to Top


SYNOPSIS

  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;

Back to Top


Constructor

new

  my $sp = Device::SerialPins->new('/dev/ttyS0');

Back to Top


Getter Methods

Note: there is currently no rxd/pin2

pin1 / car / dcd

  my $state = $sp->pin1;

pin3 / txd

  my $state = $sp->pin3;

pin4 / dtr

  my $state = $sp->pin4;

ground pin is #5

pin6 / dsr

  my $state = $sp->pin6;

pin7 / rts

  my $state = $sp->pin7;

pin8 / cts

  my $state = $sp->pin8;

pin9 / rng

  my $state = $sp->pin9;

get

Gets the state of a named or numbered pin.

  $sp->get($pin);

Back to Top


Setter Methods

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

set_pin3 / set_txd

set_pin4 / set_dtr

set_pin7 / set_rts

set

Sets the state of a named or numbered pin.

  $sp->set($pin, $bool);

Back to Top


SEE ALSO

the Device::SerialPort manpage for more typical usage.

http://www.easysw.com/~mike/serial/serial.html

Back to Top


AUTHOR

Eric Wilhelm @ <ewilhelm at cpan dot org>

http://scratchcomputing.com/

Back to Top


BUGS

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.

Back to Top


COPYRIGHT

Copyright (C) 2007 Eric L. Wilhelm, All Rights Reserved.

Back to Top


NO WARRANTY

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.

Back to Top


LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Back to Top

 Device::SerialPins - per-pin low-level serial port access