| 1 | package Device::ParallelPort::drv::dummy_bit; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | =head1 NAME | ||||||||||
| 6 | |||||||||||
| 7 | Device::ParallelPort::drv::dummy_bit - Dummy driver. Pretend to work. | ||||||||||
| 8 | |||||||||||
| 9 | =head1 DESCRIPTION | ||||||||||
| 10 | |||||||||||
| 11 | This is a dummy driver. Purely built to test the primary driver. | ||||||||||
| 12 | |||||||||||
| 13 | =head1 CAPABILITIES | ||||||||||
| 14 | |||||||||||
| 15 | None what so ever. Basically just store bits in an array ! | ||||||||||
| 16 | |||||||||||
| 17 | =head1 COPYRIGHT | ||||||||||
| 18 | |||||||||||
| 19 | Copyright (c) 2002,2004 Scott Penrose. All rights reserved. | ||||||||||
| 20 | This program is free software; you can redistribute it and/or modify | ||||||||||
| 21 | it under the same terms as Perl itself. | ||||||||||
| 22 | |||||||||||
| 23 | =head1 AUTHOR | ||||||||||
| 24 | |||||||||||
| 25 | Scott Penrose L<scottp@dd.com.au>, L<http://linux.dd.com.au/> | ||||||||||
| 26 | |||||||||||
| 27 | =head1 SEE ALSO | ||||||||||
| 28 | |||||||||||
| 29 | L<Device::ParallelPort> | ||||||||||
| 30 | |||||||||||
| 31 | =cut | ||||||||||
| 32 | |||||||||||
| 33 | 1 | ▶ | use base qw/Device::ParallelPort::drv/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 34 | |||||||||||
| 35 | 1 | ▶ | sub init { | ||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 36 | 1 | my ($this, @params) = @_; | |||||||||
| 37 | 1 | $this->{BITS} = []; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 7 | ▶ | sub INFO { | ||||||||
|
Subroutine
INFO: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 41 | return { | ||||||||||
| 42 | 7 | 'os' => 'any', | |||||||||
| 43 | 'type' => 'bit', | ||||||||||
| 44 | }; | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 11 | ▶ | sub set_bit { | ||||||||
|
Subroutine
set_bit: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 48 | 11 | my ($this, $bit, $val) = @_; | |||||||||
| 49 | 11 | ▶ | $this->{BITS}[$bit] = $val ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 54 | ▶ | sub get_bit { | ||||||||
|
Subroutine
get_bit: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 53 | 54 | my ($this, $bit) = @_; | |||||||||
| 54 | 54 | ▶ | return $this->{BITS}[$bit] ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | 1 | 1; | |||||||||
| 58 | |||||||||||