Skip Menu |

This queue is for tickets about the RFID-Alien CPAN distribution.

Report information
The Basics
Id: 73434
Status: new
Priority: 0/
Queue: RFID-Alien

People
Owner: Nobody in particular
Requestors: perry.sebastian [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Enhancements to RFID::Alien
Date: Thu, 22 Dec 2011 10:39:37 -0500
To: bug-RFID-Alien [...] rt.cpan.org
From: Perry Sebastian <perry.sebastian [...] gmail.com>
add: 3 fields for the "disc", "last", "count" keyed parameters because they are needed for timed activities. These values back with the identifiers of "discDTG", "lastDTG", and "ReadCount" (lc on the parameter list). patch to RFID::Tag.pm (I had some difficulty finding the right Tag.pm...so I hope this one is correct) sub _init { my $self = shift; my(%p) = @_; foreach my $param (keys %p) { if (grep { lc $param eq $_ } qw(id antenna discdtg lastdtg readcount)) { $self->{lc $param} = $p{$param} unless defined($self->{lc $param}); } } $self; } patch to RFID::Alien::Reader.pm sub readtags { my $self = shift; my(%p)=@_; my $numreads = ''; if ($p{Numreads}) { $numreads = ' '.$p{Numreads}; delete $p{Numreads}; } $self->pushoptions(%p) if (keys %p); my $taglist = $self->_command('get TagList'.$numreads); my @tags; foreach my $tagline (split /\x0d\x0a/, $taglist) { next unless $tagline =~ /^Tag:/i; my %tp = (); foreach my $prop (split /,\s*/, $tagline) { if ($prop =~ /^(.*?):(.*)/) { if (lc $1 eq 'tag') { ($tp{id}=uc $2) =~ s/[^0-9A-f]//g; } elsif (lc $1 eq 'ant') { $tp{antenna} = $2; } elsif (lc $1 eq 'disc') { $tp{discdtg} = $2; } elsif (lc $1 eq 'last') { $tp{lastdtg} = $2; } elsif (lc $1 eq 'count') { $tp{readcount} = $2; } else { $tp{lc $1}=$2; } } } my $tag = TagPlus->new(%tp); # hack $tag->{count} = $tp{count}; push(@tags,$tag); } $self->popoptions() if (keys %p); return @tags; } add: 5 subroutines to set specific reader behavior patch to RFID::Alien::Reader.pm sub settagtype { my $self = shift; my(@p)=@_; ## input parameters: <[time zone delta],[debug carping]> my $suc; if ($p[0]) { my $set = $p[0]; $suc = $self->_command('TagType='.$set); if($p[1]) { print "Set tagtype to type [$set]\n";} } else { $suc = $self->_command('TagType=16'); if($p[1]) { print "Set tagtype to default type [$set]\n";} } return $suc; } sub settacqg2cycles { my $self = shift; my(@p)=@_; ## input parameters: <[number of cycles],[debug carping]> my $suc; if ($p[0]) { my $set = $p[0]; $suc = $self->_command('AcqG2Cycles='.$set); if($p[1]) { print "Set acqg2 cycles to [$set] cycles per inventory\n";} } else { $suc = $self->_command('AcqG2Cycles=1'); if($p[1]) { print "Set counter to default aquistion cycles [1]\n"; } } return $suc; } sub settacqg2count { my $self = shift; my(@p)=@_; ## input parameters: <[number of counts],[debug carping]> my $suc; if ($p[0]) { my $set = $p[0]; $suc = $self->_command('AcqG2Count='.$set); if($p[1]) { print "Set acqg2 counter to count [$set]\n"; } } else { $suc = $self->_command('AcqG2Count=3'); if($p[1]) { print "Set counter to default count [3]\n"; } } return $suc; } sub settimezone { my $self = shift; my(@p)=@_; ## input parameters: <[time zone delta],[debug carping]> my $suc; if ($p[0]) { my $set = $p[0]; $suc = $self->_command('TimeZone='.$set); if($p[1]) { print "Set reader time zone [$set]\n"; } } else { $suc = $self->_command('TimeZone=-5'); if($p[1]) { print "Set reader time zone to default Eastern [-5]\n"; } } return $suc; } sub setlocaltime { my $self = shift; my(@p)=@_; ## input parameters: <(local time),[debug carping]> my $suc; if ($p[0]) { my $set = $p[0]; $suc = $self->_command('Time='.$set); if($p[1]) { print "Set reader time [$set]\n"; } } else { if($p[1]) { print "No time sent to reader! \n"; } return 0; } return $suc; } Thanks! Regards, Perry Sebastian