| Device-ParallelPort documentation | Contained in the Device-ParallelPort distribution. |
Device::ParallelPort::drv::dummy_byte - Dummy driver. Pretend to work.
This is purely used for testing the system and not really useful.
None what so ever. Basically just store bytes in an array !
Copyright (c) 2002,2004 Scott Penrose. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Scott Penrose scottp@dd.com.au, http://linux.dd.com.au/
| Device-ParallelPort documentation | Contained in the Device-ParallelPort distribution. |
package Device::ParallelPort::drv::dummy_byte; use strict; use Carp;
use base qw/Device::ParallelPort::drv/; sub init { my ($this, @params) = @_; $this->{BYTES} = []; } sub INFO { return { 'os' => 'any', 'type' => 'byte', }; } sub set_byte { my ($this, $byte, $val) = @_; $this->{BYTES}[$byte] = $val; } sub get_byte { my ($this, $byte) = @_; if (!defined($this->{BYTES}[$byte])) { $this->{BYTES}[$byte] = chr(0); } return $this->{BYTES}[$byte]; } 1;