RFID::Matrics::Reader - Abstract base class for a Matrics RFID reader
This abstract base class provides most of the methods required for interfacing Perl with a Matrics RFID reader. To actually create an object, use RFID::Matrics::Reader::Serial or RFID::Matrics::Reader::TCP. It is based on RFID::Reader.
use RFID::Matrics::Reader::Serial;
my $reader =
RFID::Matrics::Reader::Serial->new(Port => $com_port_object,
Node => 4,
Antenna => 1)
or die "Couldn't create reader object\n";
my @err = $reader->set(PowerLevel => 0xff,
Environment => 4) == 0
or die "Couldn't set params: @err\n";
my @tags = $reader->readtags;
foreach my $tag (@tags)
{
my $tag_info = $tag->get('Antenna','ID','Type');
print "I see tag $tag_info{Type}.$tag_info{ID} ".
"at antenna $tag_info{Antenna}.\n";
}
This abstract base class implements the commands for communicating with a Matrics reader. It is written according to the specifications in Matrics' Stationary Reader / Host Protocol (RS-485) Specification, using version 2.8 from October 19th 2003. It was tested with an RDR-001 model reader.
To actually create a reader object, use RFID::Matrics::Reader::Serial or RFID::Matrics::Reader::TCP. Those classes inherit from this one.
This class inherits some methods and settings from RFID::Reader.
Get various properties of the reader or the internal state of the object. The syntax is described in the RFID::Reader get method documentation. See Matrics Properties and Generic Properties for the properties that can be retreived.
Read all of the tags in the reader's field, honoring any settings affecting the reading and filtering of tags. This returns a (possibly empty) list of tags, which will be of type RFID::EPC::Tag or RFID::Tag::Matrics. See the RFID::Reader readtags method documentation for more information.
The default antenna for get operations; see also AntennaSequence. This defaults to 1 if it is not set.
An arrayref of the antennas that should be queried, and in what order. The antenna names for a 4-port Matrics reader are simply 1, 2, 3, and 4. For example:
$reader->set(AntennaSequence => [1,2,3,4]);
The default AntennaSequence is the default Antenna.
Control the amount debugging information sent to STDERR. A higher
value for this property will cause more information to be output.
A boolean value controlling whether duplicate tags should be removed from the list returned by readtags.
How long an antenna should try to read tags during a readtags command, between 0 and 4. 0 will read for a very short time, and is appropriate for environments where tags come and go very quickly, and it's OK if you miss a tag somtimes. 4 will read for longer, and is appropriate where tags stay relatively static and you want the reader to try its best to find all of them.
When this item is retreived, you get the value for the default
antenna. When it's set, it's set for all of the antennas in the
AntennaSequence. To set the level for only one
antenna, use Environment_Antennan, where n is the number
of the antenna you'd like to set.
The Matrics node address associated with this object. It defaults to 4.
The amount of power an antenna should use when doing a read, between 0 and 255. 255 is full-power; the scale of this setting is logarithmic, so 208 is about 50% power, and 0x80 is about 25% power.
When this item is retreived, you get the value for the default
antenna. When it's set, it's set for all of the antennas in the
AntennaSequence. To set the level for only one
antenna, use PowerLevel_Antennan, where n is the number of
the antenna you'd like to set.
The software version running on this reader, as a string. Cannot be set.
The serial number of this reader, as a string. Cannot be set.
the RFID::Matrics::Reader::Serial manpage, the RFID::Matrics::Reader::TCP manpage, the RFID::EPC::Tag manpage, the RFID::Matrics::Tag manpage, http://www.eecs.umich.edu/~wherefid/code/rfid-perl/.
Scott Gifford <gifford@umich.edu>, <sgifford@suspectclass.com>
Copyright (C) 2004 The Regents of the University of Michigan.
See the file LICENSE included with the distribution for license information.