The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RFID::EPC::Tag - An EPC tag.

SYNOPSIS

This class implements an EPC tag based on RFID::Tag. It allows tags to be created based on the fields of the various EPC tag types, and allows tag IDs to be parsed into their EPC components.

Generally, you'll get these objects returend from an EPC RFID reader:

    use RFID::Gumbo::Reader::TCP;
    my $reader = 
      RFID::Gumbo::Reader::TCP->new(PeerAddr => 10.20.30.40,
                                    PeerPort => 4001)
        or die "Couldn't create Blammo reader";
    my @tags = $reader->readtags();
    foreach my $tag (@tags)
    {
        if ($tag->type eq 'epc')
        {
            my $epc_type = $tag->get('epc_type');
            print "I see EPC tag ",$tag->id," of type $epc_type\n";
        }
    }

But you can also create a tag yourself, either with an ID string:

    my $tag = RFID::EPC::Tag->new(id => '357777777666666999999999');

or with the various componenets:

    my $tag =
      RFID::EPC::Tag->new(epc_serial => '999999999',
                          epc_manager => '7777777',
                          epc_class => '666666',
                          epc_type => 'GID-96');
    print "Tag ID is ",$tag->id,"\n";

DESCRIPTION

The parsing and tag creation in this module are based on the specifications in EPCGlobal's EPC Tag Data Standards Version 1.1 Rev.1.24, from April 1st 2004 (although it doesn't appear to be a joke...). See http://www.epcglobalinc.com/ for more information.

Constructor

new

Creates a new EPC tag object with the requested properties.

There are two general ways to create an EPC tag. First, you can pass in the tag ID number as a hex string with the parameter name id. Second, you can pass in various components specific to your Tag Type, including at least epc_type.

    my $tag1 = RFID::EPC::Tag->new(id => '357777777666666999999999');

    my $tag2 =
      RFID::EPC::Tag->new(epc_serial => '999999999',
                          epc_manager => '7777777',
                          epc_class => '666666',
                          epc_type => 'GID-96');

    print "The two tags are ",
          ($tag1->tagcmp($tag2)==0?"the same":"different"),
          "\n";

Methods

The following methods are supported. In addition, methods from RFID::Tag are inherited.

get

Get a property of this tag. In addition to the properties inherited from RFID::Tag, the following fields are supported. Note that whether a particular field is supported depends on the tag type. All fields are represented as hex strings.

epc_type

The EPC type of this tag.

epc_serial

The EPC serial number of this tag.

epc_manager

The EPC manager number of this tag.

epc_class

The EPC class of this tag.

epc_header

The EPC header bits for this tag.

epc_filter

The EPC filter for this tag.

epc_partition

The EPC partition number for this tag. This field determines the size of later fields; see the EPC specification for more information.

epc_item

The EPC item number for this tag.

epc_company

The EPC company number for this tag.

epc_asset_type

The EPC asset type number for this tag.

epc_location

The EPC location number for this tag.

epc_asset

The EPC asset number for this tag.

epc_unknown

For tags of unrecognized type, all of the bytes that could not be parsed.

type

This method returns the general type of this tag (always epc).

Tag Types

The EPC Tag Data Standards document defines many specific types of EPC tags. We do our best to parse these out, and return the appropriate fields. This isn't very well tested, since we don't have access to a large number of different types of EPC tags, but it tries to follow the spec, and should be easy to correct if any errors are found.

The purpose of the fields is beyond the scope of this document; we assume you know what the fields are for, and just want to know what names they are given in this code. Mostly that's because it took EPC 78 pages to describe exactly what the tag types are, and I don't want to repeat that here. Look up the EPC Tag Data Standards document referenced at the top of this documentation for more information.

GIAI-64

64-bit Global Individual Asset Identifier. Fields are epc_header, epc_filter, epc_company, epc_asset.

GIAI-96

96-bit Global Individual Asset Identifier. Fields are epc_header, epc_filter, epc_partition, epc_company, epc_asset.

GID-96

96-bit General Identifier. Fields are epc_header, epc_manager, epc_class, epc_serial.

GRAI-64

64-bit Global Returnable Asset Identifier. Fields are epc_header, epc_filter, epc_company, epc_asset_type, epc_serial.

GRAI-96

96-bit Global Returnable Asset Identifier. Fields are epc_header, epc_filter, epc_partition, epc_company, epc_asset_type, epc_serial.

SGLN-64

64-bit Serialized Global Location Number. Fields are epc_header, epc_filter, epc_company, epc_location, epc_serial.

SGLN-96

96-bit Serialized Global Location Number. Fields are epc_header, epc_filter, epc_partition, epc_company, epc_location, epc_serial.

SGTIN-64

64-bit Serialized Global Trade Identification Number. Fields are epc_header, epc_filter, epc_company, epc_item, epc_serial.

SGTIN-96

96-bit Serialized Global Trade Identification Number. Fields are epc_header, epc_filter, epc_partition, epc_company, epc_item, epc_serial.

SSCC-64

64-bit Serial Shipping Container Code. Fields are epc_header, epc_filter, epc_company, epc_serial.

SSCC-96

96-bit Serial Shipping Container Code. Fields are epc_header, epc_filter, epc_partition, epc_company, epc_serial, epc_unallocated.

UNKNOWNx-64

64-bit tag without any type recognized by this software, but with a header indicating it is 64 bits. Fields are epc_header and epc_unknown.

UNKNOWN-96

96-bit tag without any type recognized by this software, but with a header indicating it is 96 bits. Fields are epc_header and epc_unknown.

UNKNOWN

Tag without any type recognized by this software, and with no indication of its size in the header. Fields are epc_header and epc_unknown.

SEE ALSO

RFID::Tag, RFID::Reader, http://www.eecs.umich.edu/~wherefid/code/rfid-perl/, http://www.epcglobalinc.com/, The manual for your particular RFID reader.

AUTHOR

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.