Device::ParallelPort::drv::dummy_bit - Dummy driver. Pretend to work.


Device-ParallelPort documentation Contained in the Device-ParallelPort distribution.

Index


Code Index:

NAME

Top

Device::ParallelPort::drv::dummy_bit - Dummy driver. Pretend to work.

DESCRIPTION

Top

This is a dummy driver. Purely built to test the primary driver.

CAPABILITIES

Top

None what so ever. Basically just store bits in an array !

COPYRIGHT

Top

AUTHOR

Top

Scott Penrose scottp@dd.com.au, http://linux.dd.com.au/

SEE ALSO

Top

Device::ParallelPort


Device-ParallelPort documentation Contained in the Device-ParallelPort distribution.

package Device::ParallelPort::drv::dummy_bit;
use strict;
use Carp;

use base qw/Device::ParallelPort::drv/;

sub init {
        my ($this, @params) = @_;
        $this->{BITS} = [];
}

sub INFO {
        return {
                'os' => 'any',
                'type' => 'bit',
        };
}

sub set_bit {
        my ($this, $bit, $val) = @_;
        $this->{BITS}[$bit] = $val ? 1 : 0;
}

sub get_bit {
        my ($this, $bit) = @_;
        return $this->{BITS}[$bit] ? 1 : 0;
}

1;