use strict; use warnings; package Device::W800; BEGIN {
$Device::W800::VERSION = '1.110800'; } # ABSTRACT: Module to
support W800 RF receiver use 5.006; use constant DEBUG =>
$ENV{DEVICE_W800_DEBUG}; use Carp qw/croak/; use base
'Device::RFXCOM::RX'; use Device::RFXCOM::Response; sub new { my
($pkg, %p) = @_; my @plugins; # TODO: Make 32-bit support a
class method on the decoder so # this process (to restrict the
plugins to a useful set) is # encapsulated better. foreach my
$decoder (qw/RFXSensor X10 X10Security/) { my $module =
'Device::RFXCOM::Decoder::'.$decoder; my $file =
'Device/RFXCOM/Decoder/'.$decoder.'.pm'; require $file; import
$module; push @plugins, $module->new(); }
$pkg->SUPER::new(device => '/dev/w800', plugins => \@plugins,
%p); } sub _write { croak "Writes not supported for W800: @_\n";
} sub _write_now { # do nothing } sub _init { my $self = shift;
$self->{init} = 1; } sub read_one { my ($self, $rbuf) = @_;
return unless ($$rbuf); print STDERR "rbuf=", (unpack "H*",
$$rbuf), "\n" if DEBUG;