-package RFID::Biblio::Reader::CPRM02;
+package Biblio::RFID::Reader::CPRM02;
=head1 NAME
-RFID::Biblio::Reader::CPRM02 - support for CPR-M02 RFID reader
+Biblio::RFID::Reader::CPRM02 - support for CPR-M02 RFID reader
=head1 DESCRIPTION
use warnings;
use strict;
-use base 'RFID::Biblio';
-use RFID::Biblio;
+use base 'Biblio::RFID::Reader::Serial';
+use Biblio::RFID;
use Time::HiRes;
use Data::Dump qw(dump);
warn "# data ",as_hex($data);
+ return if length($data) < 17;
+
$info = {
DSFID => substr($data,5-2,1),
UID => substr($data,6-2,8),
my $info = _get_system_info $tag;
- my $max_block = ord($info->{SIZE}) || die "no SIZE in ",dump( $info );
+ return unless $info->{SIZE};
+
+ my $max_block = ord($info->{SIZE});
my $tag_blocks;
$tag = shift if ref $tag;
my $info = _get_system_info $tag;
- return $info->{AFI} || die "no AFI for $tag in ",dump($info);
+ return $info->{AFI} || warn "no AFI for $tag in ",dump($info);
}