Programming with the ALE and ALEPC APIs

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Writing Tags by Using the ALEPC API

The following sections describe the ALEPC API programming components that you use to write tags and include a formal, abstract specification of the ALEPC API. The external interface is defined by the ALEPC interface (See ALEPC: Main Tag Writing Interface with UML Diagrams). This interface makes use of a number of complex data types that are documented in the sections starting at PCSpec. BEA extensions to the interface are described in BEA Gen2 Write Support.

 


Overview of the ALEPC API Implementation

One or more clients make method calls to the ALEPC interface. Each method call is a request, which causes the ALE engine to take some action and return results. Thus, methods of the ALEPC interface are synchronous.

The ALEPC interface also enables clients to subscribe to events that are delivered asynchronously. You implement this capability by invoking methods that take a URI as an argument. Such methods return immediately, but subsequently the ALE engine within the Edge Server can asynchronously deliver information to the consumer denoted by the URI argument.

In the sections that follow, the API is described by using UML class diagram notation, as shown below:

dataMember1 : Type1
dataMember2 : Type2
---
method1(ArgName:ArgType, ArgName:ArgType, ...) : ReturnType
method2(ArgName:ArgType, ArgName:ArgType, ...) : ReturnType

The box as a whole refers to a conceptual class, having the specified data members and methods.

The ALEPC API is realized in several equivalent forms within WebLogic RFID Edge Server:

Each of these concrete forms of the ALEPC API has a slightly different structure and gives slightly different names to the different conceptual classes, data members, and methods defined in the UML within these sections. This variation is unavoidable, owing to syntactic constraints and stylistic norms within these different implementation technologies.

In most cases, the mapping from conceptual UML to the concrete details of any particular binding is very straightforward; where it is not, the specific documentation for each binding will make clear the relationship to the UML. The UML-level descriptions in these sections should be considered normative.

 


ALEPC: Main Tag Writing Interface with UML Diagrams

ALEPC is the main interface that you use to program tags. The term "tag programming" refers to the act of associating an EPC value with some physical entity, such as an RFID tag or a printed label.

The Java implementation package is com.connecterra.alepc.api. Also see "BEA Gen2 Write Support" on page 6-31.

---
getALEID() : String
define(specName:String, spec:PCSpec) : void
redefine(specName:String, spec:PCSpec) : void
suspend(specName:String) : void
unsuspend(specName:String) : void
undefine(specName:String) : void
get(specName:String) : PCSpec
getPCSpecInfo(specName:String) : PCSpecInfo
listPCSpecNames() : List
subscribe(specName:String, uri:URI, controls:PCSubscriptionControls) : void
unsubscribe(specName:String, uri:URI) : void
listSubscribers(specName:String) : List
getPCSubscriptionInfo(specName:String,subscriber:URI) : PCSubscriptionInfo
poll(specName:String, epcVal:URI) : PCWriteReport
poll(specName : String, parametermap : Map<String, String>) : PCWriteReport
immediate(spec:PCSpec, epcVal:URI) : PCWriteReport
immediate(specName : String, parametermap : Map<String, String>) : PCWriteReport
defineEPCCache(cacheName:String, spec:EPCCacheSpec,
replenishment:EPCPatterns) : void
redefineEPCCache(cacheName:String, newSpec:EPCCacheSpec) : void
undefineEPCCache(cacheName:String) : EPCPatterns
getEPCCache(cacheName:String) : EPCCacheSpec
getEPCCacheSpecInfo(cacheName:String, includeCacheContent:boolean) : EPCCacheSpecInfo
listEPCCacheSpecNames() : List
replenishEPCCache(cacheName:String, replenishment:EPCPatterns) : void
depleteEPCCache(cacheName:String) : EPCPatterns
subscribeEPCCache(cacheName:String, uri:URI,
controls:PCSubscriptionControls) : void
unsubscribeEPCCache(cacheName:String, uri:URI) : void
listEPCCacheSubscribers(cacheName:String) : List
getEPCCacheSubscriptionInfo(cacheName:String, subscriber:URI) : PCSubscriptionInfo
listLogicalReaderNames() : List

Table 6-1
Method
Description
getALEID
Return the value provided for savantID in the edge.props file.
define
Define a new programming cycle specification for use with the poll and subscribe methods.
defineEPCCache
Define an EPC cache that can be used by programming cycles to obtain EPC values for programming operations.
depleteEPCCache
Cause the indicated EPC cache to become depleted (empty).
get
Look up and return a previously defined programming cycle specification by name.
getEPCCache
Look up and return a previously defined EPC cache specification by name.
getEPCCacheSpecInfo
Return administrative information about an EPC cache.
getEPCCacheSubscriptionInfo
Return administrative information about an EPC cache subscriber.
getPCSpecInfo
Return administrative information about a programming cycle specification.
getPCSubscriptionInfo
Return administrative information about a programming cycle subscriber.
immediate
Immediately define a programming cycle specification and activate it for one programming cycle, synchronously returning a report. Use the overloaded method to provide a full map of parameters, which provide substitution values with the PCSpec.
listEPCCacheSpecNames
Return a list of the names of all EPC caches currently defined.
listEPCCacheSubscribers
Return a list of URIs that are subscribed to asynchronous reports for the specified EPC cache name.
listLogicalReaderNames
Return a list of all logical reader names that can be used for programming.
listPCSpecNames
Return a list of the names of all programming cycle specifications currently defined.
listSubscribers
Return a list of URIs that are subscribed to asynchronous reports for the specified PCSpec name.
poll
Activate a previously defined programming cycle specification for one programming cycle, synchronously returning a report. Use the overloaded method to provide a full map of parameters, which provide substitution values with the PCSpec.
redefine
Replace the PCSpec for a programming cycle with a new PCSpec.
redefineEPCCache
Replace the EPCCacheSpec having the specified name with a new EPCCacheSpec. All subscriptions and other metadata remain unchanged, and the cache contents are not altered.
replenishEPCCache
Append a set of EPC pattern URIs to the indicated EPC cache.
subscribe
Subscribe to asynchronous report delivery from a programming cycle specification.
subscribeEPCCache
Subscribe to asynchronous report delivery from an EPC cache.
suspend
Suspend the named programming cycle.
undefine
Undefine a programming cycle specification.
undefineEPCCache
Undefine an EPC cache.
unsubscribe
Unsubscribe a specified destination from receiving asynchronous delivery of reports from a specified programming cycle specification.
unsubscribeEPCCache
Unsubscribe a specified destination from receiving asynchronous delivery of reports from a specified EPC cache.
unsuspend
Return a suspended programming cycle to its normal state.
Methods of the ALEPC Interface, in Alphabetical Order

 


PCSpec

A PCSpec is a complex type that describes a programming cycle. A programming cycle is an interval of time during which a single tag is written and verified.

Java implementation package: com.connecterra.alepc.api. See also "BEA Gen2 Write Support" on page 6-31.

The following sections provide information about a PCSpec:

A PCSpec contains:

A PCSpec also contains an optional "application data" string, which is simply copied unmodified into every PCWriteReport instance generated from this PCSpec.

For a narrative description of programming cycles and their use of PCSpec instances, see Programming Cycles.

Table 6-2 PCSpec Fields
Field
Description
logicalReaders
List of logical or composite reader names.
readerParameters
Maps parameter names to parameter values, and can be used to pass information to a reader. For example, a RFID label printer might define a reader parameter that it uses to obtain the text and graphics to be printed on labels. See the RFID Reader Reference for information about the capabilities of specific reader and printer devices.
applicationData
A string that is copied unmodified into every PCWriteReport instance generated from this PCSpec.
cacheName
The name of the EPC cache from which this programming cycle obtains EPC values.
duration
The maximum amount of time to run EPC writing trials before failing a programming cycle.
startTrigger
Trigger that begins a programming cycle.
stopTrigger
Trigger that ends a programming cycle.
trials
Maximum number of EPC writing trials to run before failing a programming cycle.
accessSpecs
List of AccessSpec objects. See AccessSpec.
restrictSingleTag
Boolean that when true will cause a PCSpec to fail before a programming cycle if more than one tag is detected.

PCSpecInfo

Java implementation package: com.connecterra.alepc.api

Describes administrative information for a PCSpec.

activationCount : int
cacheSize: long
lastActivated: long
lastReported: long
subscriberCount: int
isSuspended: boolean
---

Table 6-3
Field
Description
activationCount
The number of times the programming cycle for the PCSpec has been activated since it was defined.
cacheSize
Number of entries that remain in the EPC cache associated with the PCSpec.
lastActivated
The last time the programming cycle for the PCSpec was activated.
lastReported
The last time a write report was generated by the programming cycle for the PCSpec.
subscriberCount
The number of URIs subscribed to a PCSpec.
isSuspended
True if the PCSpec processing is suspended.
PCSpecInfo Fields

PCSubscriptionControls

Java implementation package: com.connecterra.alepc.api

Describes how to handle failures in notification delivery. It is used by PCSubscriptionInfo (see PCSubscriptionInfo) and ALEPC.subscribe(String, URI, PCSubscriptionControls). Also see ALEPC: Main Tag Writing Interface with UML Diagrams).

failureLimitCount : int
failureLimitInterval : long
---

Table 6-4 PCSubscriptionControls Fields
Field
Description
failureLimitCount
The maximum number of failed notification deliveries before a subscription is unsubscribed.
failureLimitInterval
The maximum interval of time a notification delivery can fail before a subscription is unsubscribed.

PCSubscriptionInfo

Java implementation package: com.connecterra.alepc.api

Describes administrative information about a subscription.

consecutiveFailureCount : int
controls : PCSubscriptionControls
lastSuccessTime: long
---

Field
Description
consecutiveFailureCount
The number of failed notifications since the subscription was created, or since the last successful notification.
controls
The notification failure controls for this subscription. See PCSubscriptionControls.
lastSuccessTime
The absolute time in milliseconds of the most recent successful notification.

AccessSpec

An AccessSpec contains an ordered list of OpSpec objects and a name. The list of OpSpecs represent the sequence of operations to be performed on each tag in field. The base OpSpec class is abstract; each subclass of OpSpec refers to a specific command.

The Java implementation package is com.connecterra.alepc.api.See also "BEA Gen2 Write Support" on page 6-31.

The following sections provide information related to an AccessSpec:

Java and XML Implementation Notes:

An <accessSpec> element (repeatable) in a PCSpec describes what commands to issue to each tag in a field, as they are "singulated." An accessSpec has a name in order to match it with an accessReport included in a PCWriteReport.

An accessSpec can contain a <stopOnError> subelement, which contains a Boolean value. If stopOnError is true, for any given tag, any error in an operation will halt processing for that tag. The inventory round then continues to the next tag in the field, and processing starts on that tag with the first operation. If omitted, stopOnError is assumed to be false.

A PCSpec that contains no accessSpec element acts as if it has a single implicit accessSpec element with a single write operation. If the PCSpec contains a cacheName element, the writeOpSpec uses that value for its epcCache. This is the only point at which the top-level cacheName element is used. Otherwise, the write specifies a param value of epc, which will be substituted using the data from the poll or immediate ALEPC API call.

If restrictSingleTag was specified in the PCSpec, explicitly or implicitly (through the lack of accessSpecs), the PCWriteReport contains the epc element which contains the EPC value of the single tag written. This element is omitted in the PCWriteReport of any PCSpec that does not restrict operations to a single tag, whether one more multiple tags were discovered in the field. Additionally, a PCSpec that contains no accessSpec element will use the older form of PCWriteReport, containing no opReport.

OpSpec

Java implementation package: com.connecterra.alepc.api

The base OpSpec class is abstract; each subclass of OpSpec refers to a specific command: LockOpSpec, KillOpSpec, PasswordOpSpec, ReadOpSpec, WriteOpSpec.

Table 6-5
Field
Description
field
URI describing location on tag.
dataSpec
A DataSpec object. See DataSpec.
opSpecs
List of OpSpec objects.
OpSpec Fields

Each <accessSpec> element contains an <operations> subelement, which is the list of opSpecs that describe the commands to issue to each tag ("operations"). These operations are read, write, password, lock, and kill.

There are two URI forms for specifying a memory location on a tag for a read or write operation:

For absolute addressing, the URI needs to include a selection for bank, an offset within the memory bank, and a length of the memory extent, in bits.

urn:connecterra:tagmem:@bankid.length[.offset]

Where bankid is, in Gen2, one of the four values: epc, tid, user, or reserved. Length and offset are integer values in bits, specified as decimal. The default offset value is 0.

When referring to a symbolic name, the URI simply includes the name.

urn:connecterra:tagmem:name

In the current implementation, the only valid value for name is epc.

For a stack light device, the bankid has one value: stacklight. The memory bank is 20-bits wide, and each 4-bit segment corresponds to one light. For example, urn.connecterra:tagmem:@stacklight.4.12 and value urn:epc:raw:64.x9 will turn on the amber light.

The following code fragment demonstrates programmatic stack light control. The update value of 092F0 will turn off the White light (0), turn on the Blue light until next update (9), turn on the Green light for 10 seconds (2), do nothing to the Amber light (F), and turn off the Red light (0):

ALEPC alePCClient = new AxisALEPCClient(<alepcServiceURL>);
ALEPCFactory alePCFactory = AxisALEPCFactory.getInstance();
PCSpec pcSpec = alePCFactory.createPCSpec();
pcSpec.addLogicalReaderName("StackLight");
alePCClient.immediate(
pcSpec, new URI("urn:connecterra:stacklight:update=092F0"));

For more information on stack light control, see Configuring and Controlling Stack Lights in the RFID Reader Reference manual.

A <read field="..."> element is used to read from a segment of tag memory. The field attribute contains the URI to the tag memory location. The resulting opReport contains the status and the read memory value. Data is padded as a 64-, 96-, or 128-bit value before being returned. For example, 48 bits of data would be returned as a padded 64-bit value.

A <write field="..."> element is used to write a segment of tag memory. The field attribute contains the URI to the segment tag memory location to write. The write operation contains one of three elements that can provide the data to be written to the specified memory. These elements, called data elements, are:

A <password> element attempts to transition the tag to secured mode. The password operation contains one of the data elements specified above in the <write> element description - this data is used as the password in the Gen2 "access" operation. It is an error to use an epcCache data element for this element.

A <lock> element contains a mask element and a value element, both of which should contain a raw URI that provides an integer value. These raw URIs should be 10-bits wide when operating with Gen2 tags. For any of the bits in the mask element that are set, the corresponding lock bit on the tag is set to the bit in value at that position.

A 10-bit value is provided for the "mask" and "value" of the lock command. In the mask, the bits that are set map to the bits in the value, to be applied to the state.

In each field, the high bit represents the "lock" value for that field, while the low bit represents the field's "permalock" value.

For the EPC, TID, and User memory fields:

lock
permalock
Description
0
0
Associated memory bank is writable.
0
1
Associated memory bank is writable.
1
0
Associated memory bank can only be written with a password.
1
1
Associated memory bank is permanently read-only.

For the password fields:

Note the differences between the meanings for the bits in the two types of fields.

Lock operations are described in fuller detail in EPC Radio-Frequency Identity Protocols Class-1 Generation-2 UHF RFID Protocol for Communications at 860 MHz-960 MHz, Version 1.0.9.

A <kill> element contains the kill password, which will be used to kill the tag. You specify this password using the same data subelement that the <password> element uses. It is an error to use an epcCache data element for this element.

For XML examples, see Gen2 PCSpec Examples.

DataSpec

Java implementation package: com.connecterra.alepc.api

The base DataSpec class is abstract. Public implementations are: LiteralDataSpec, EPCCacheDataSpec, and ParamDataSpec.

Table 6-6 DataSpec Fields
Field
Description
value
An EPC URI or a raw URI.
EPCCache
Then name of an EPC Cache.
paramName
A parameter which is looked up in the map provided in an ALEPC poll or immediate call; the value associated with the parameter is used.

 


PCWriteReport

Java implementation package: com.connecterra.alepc.api

A PCWriteReport describes the tag writing operation of a programming cycle.

The following sections provide information related to a PCWriteReport:

AccessReport

Java implementation package: com.connecterra.alepc.api

An AccessReport contains the name of the associated accessSpec. Each <accessReport> element contains a list of <tag epc="epc"> elements, one per tag detected in field.

Table 6-8 AccessReport Fields
Field
Description
name
Name of AccessReport object. See AccessReport.
tag
List of TagReport objects. See TagReport.

TagReport

Java implementation package: com.connecterra.alepc.api

A TagReport contains the EPC of the tag, and an ordered list of OpReport objects. There is a one-to-one correspondence between each OpReport in the named AccessReport and each OpSpec in the corresponding AccessSpec, and the ordering is preserved.

Table 6-9 TagReport Fields
Field
Description
EPC
The EPC of the tag. The tag <epc> value is formatted as a tag URI, as specified in the tag format data standard. If the tag is not a recognized type, it is formatted as a raw hex URI.
opReports
List of OpReport objects. See OpReport.

OpReport

Java implementation package: com.connecterra.alepc.api

An OpReport contains a status element that reports the operation was successful or provides failure information. For read and write operations, the opReport also contains memory operation results. These results include a field element that matches the memory bank URI specified in the original opSpec, and a value element that gives the value of the memory as a URI.

In the case of a write, the format of the value URI is exactly as provided as input - the literal write value, the parameter value, or the EPC URI provided by the cache. For a read, the value is formatted as described in the includedMemory

Table 6-10 OpReport Fields
Field
Description
field
See OpSpec.
value
See OpSpec.

PCStatus

Java implementation package: com.connecterra.alepc.api

PCStatus is an enumerated type that identifies the termination status of a programming cycle.

<<Enumerated Type>>
SUCCESSFUL
NONE_IN_FIELD
NOT_WRITTEN
VERIFY_ERROR
LOCKED
MULTIPLE_IN_FIELD
LOCKED
INCOMPATIBLE_TAG_TYPE
READ_ONLY
CACHE_EMPTY
READER_BUSY
READER_ERROR
ENGINE_ERROR

Table 6-11
Value
Description
CACHE_EMPTY
A programming cycle could not be started because the EPC cache was empty.
ENGINE_ERROR
The ALE engine itself has some kind of problem.
INCOMPATIBLE_TAG_TYPE
The tag (or reader) is a of a type that is not compatible with the EPC value that was supplied to be written to the tag (for example, a 96-bit EPC written to a 64-bit tag).
LOCKED
Reserved for future use.
MULTIPLE_IN_FIELD
Multiple tags were in the field of the programming cycle's reader(s).
NONE_IN_FIELD
No tags were in the field of the programming cycle's reader(s).
NOT_WRITTEN
The tag was not written (the verification readback yielded the original tag value).
READ_ONLY
The tag is a read-only type and therefore cannot be programmed.
READER_BUSY
One or more of the programming cycle's readers is already in use by another programming cycle or by an event cycle.
READER_ERROR
One or more of the programming cycle's readers has a problem.
SUCCESSFUL
The programming cycle completed successfully.
VERIFY_ERROR
The tag was mis-programmed (the verification readback yielded a CRC error or value other than the intended one).
PCStatus Values

PCTerminationCondition

Java implementation package: com.connecterra.alepc.api

PCTerminationCondition is an enumerated type that describes the conditions that can cause a programming cycle to terminate with a failure.

<<Enumerated Type>>
DURATION
FAILURE
TRIALS
TRIGGER
UNDEFINE

Table 6-12 PCTerminationCondition Values
Value
Description
DURATION
The programming cycle was terminated because it exceeded the duration value specified in the PCSpec. A tag might still have been written.
FAILURE
The programming cycle was terminated because of a condition (such as multiple tags in field) for which retrying does not make sense.
TRIALS
The programming cycle was terminated because the trials value specified in the PCSpec. was exceeded.
TRIGGER
The programming cycle was terminated because of receipt of a stop trigger. A tag might still have been written.
UNDEFINE
The programming cycle was terminated because the PCSpec was undefined or suspended.

 


EPCCacheSpec

Java implementation package: com.connecterra.alepc.api

An EPCCacheSpec describes a tag cache.

The following sections provide information related to an EPCCacheSpec:

EPCCacheReport

Java implementation package: com.connecterra.alepc.api

An EPCCacheReport indicates that an EPC cache is low.

applicationData : String
cacheContent : EPCPatterns
cacheName : String
cacheSize : long
date : timestamp
savantID : String
threshold : long
---

Table 6-14 EPCCacheReport Fields
Field
Description
applicationData
String that you set in the EPCCacheSpec. See EPCCacheSpec.
cacheContent
Describes the remaining content of the EPC cache. See EPCPatterns.
cacheName
The name of the EPC cache that this report describes.
cacheSize
How many EPC cache entries remain.
date
The time the report was generated.
savantID
Identifier for the Edge Server that generated this report.
threshold
The low-cache reporting threshold defined for the EPCCacheSpec.

EPCCacheSpecInfo

Java implementation package: com.connecterra.alepc.api

Describes administrative information about an EPC cache.

subscriberCount : int
pcSpecs : List
activationCount : int
lastActivated : long
replenishCount : int
lastReplenished : long
lastReported : long
cacheSize : long
cacheContent : EPCPatterns
---

Table 6-15 EPCCacheSpecInfo
Field
Description
activationCount
The number of times an EPC value has been obtained from this EPC cache since it was defined.
cacheContent
The EPCs in this cache. See EPCPatterns.
cacheSize
How many entries remain in the EPC cache.
lastActivated
The last time an EPC value was obtained from this EPC cache.
lastReplenished
The last time this EPC cache was replenished.
lastReported
The last time an EPCCacheReport was generated by this EPC cache.
pcSpecs
Returns the names of the PCSpec instances, if any, that are using this EPC cache.
replenishCount
The number of times this EPC cache has been replenished since it was defined.
subscriberCount
The number of URIs subscribed to this EPC cache.

EPCPatterns

Java implementation package: com.connecterra.alepc.api

A list of EPC pattern URIs.

patterns : List
---

Table 6-16
Field
Description
patterns
EPC pattern URIs. The ordering of EPC patterns is significant. See EPC Patterns and EPC Caches.
EPCPatterns Field

 


XML Representations

The focal points of the ALEPC tag writing interface from an application perspective are the PCSpec, PCWriteReport, EPCCacheSpec, and EPCCacheReport objects. The RFID Edge Server provides a standard means of representing instances of these objects in XML. The XML form of PCWriteReport and EPCCacheReport is used by most of the asynchronous delivery mechanisms, as described in Asynchronous Notification Mechanisms. The XML forms are also very useful to user applications as a means of interchange, and for persistent storage.

The XML forms are defined by the XSD schema. This schema is in the RFID Edge Server installation in the file share/schemas/ALEPC.xsd.

The Java binding for ALE provides XML serializer and deserializer classes for translating between the XML representation and the Java representation of the PCSpec, PCWriteReport, EPCCacheSpec, and EPCCacheReport types. Applications can use these facilities to process reports received via the Edge Server's asynchronous delivery mechanisms, and for other purposes. See Using XML Serializers and Deserializers from Java for more information.

The following sections present examples of PCSpec, PCWriteReport, EPCCacheSpec, and EPCCacheReport as rendered into XML. These examples include additional line breaks and whitespace for the sake of readability. RFID Edge Server permits (but does not require) this whitespace when reading XML; usually RFID Edge Server omits this whitespace when writing XML.

For PCSpec examples that demonstrate Gen2 capabilities, see Gen2 PCSpec Examples.

PCSpec - Example

<?xml version="1.0" encoding="UTF-8"?>
<PCSpec xmlns="http://schemas.connecterra.com/alepc">
<!-- The name of the EPC cache from which this PCSpec obtains EPC
         values for tag programming operations. Optional. -->
    <cacheName>mycache</cacheName>
    <!-- Specifies a string to be included in PCWriteReport instances
          generated by this PCSpec. Optional. -->
    <applicationData>application-specific data here</applicationData>
<logicalReaders>
<!-- determines which logical reader(s) will be used by this
PCSpec. Logical reader names are defined in edge.props. -->
<logicalReader>TagWriteStation</logicalReader>
</logicalReaders>
    <!-- Specifies name/value pairs to be passed down to reader drivers used
by this PCSpec's programming cycles. Optional. -->
<readerParameters>
<readerParameter name="paramName">paramValue</readerParameter>
<readerParameter name="anotherParamName">another parameter
             value</readerParameter>
</readerParameters>
    <!-- Determines when this programming cycle starts and stops. -->
<boundarySpec>
<!-- Trigger that starts a programming cycle. Optional -->
<startTrigger> trigger URI here... </startTrigger>
        <!-- Trigger that stops a programming cycle.  Optional -->
<stopTrigger> trigger URI here... </stopTrigger>
        <!-- Specifies maximum number of tag writing trials.  Optional,
default is unlimited number of trials. -->
<trials>1</trials>
        <!-- Specifies maximum number of milliseconds to spend retrying failed
tag writing operations. Optional, default is no time limit. -->
<duration>1000</duration>
</boundarySpec>
</PCSpec>

PCWriteReport - Example

<?xml version="1.0" encoding="UTF-8"?>
<PCWriteReport date="2004-05-27T18:56:31.179Z"
savantID="test-edge-server"
specName="testspec"
totalMilliseconds="10"
totalTrials="1"
xmlns="http://schemas.connecterra.com/alepc">
    <applicationData>application-specific data here</applicationData>
<wasSuccessful>true</wasSuccessful>
<status>SUCCESSFUL</status>
    <physicalReaders>
<physicalReader>tws1</physicalReader>
</physicalReaders>
<failedLogicalReaders/>
<cacheName>mycache</cacheName>
<cacheSize>11</cacheSize>
<epc>urn:epc:tag:gid-64-i:1.5.1</epc>
<successfulLogicalReader>TagWriteStation</successfulLogicalReader>
</PCWriteReport>

EPCCacheSpec - Example

<?xml version="1.0" encoding="UTF-8"?>
<EPCCacheSpec xmlns="http://schemas.connecterra.com/alepc">
    <!-- Specifies a string to be included in EPCCacheReport instances
generated by this EPCCacheSpec. Optional. -->
<applicationData>cache-specific data here</applicationData>
    <!-- Specifies that when this cache's size drops to (or below) the
given number of EPC values, a EPCCacheReport should be issued. -->
<threshold>2500</threshold>
    <!-- Specifies that EPCCacheReport instances should include the current
contents of the cache. Optional, default is false. -->
<includeCacheContent>true</includeCacheContent>
</EPCCacheSpec>

EPCCacheReport - Example

<?xml version="1.0" encoding="UTF-8"?>
<EPCCacheReport date="2004-05-27T18:59:32.890Z"
savantID="test-edge-server"
xmlns="http://schemas.connecterra.com/alepc">
    <cacheName>mycache</cacheName>
<applicationData>cache-specific data goes here</applicationData>
<cacheSize>10</cacheSize>
<cacheContent>
<pattern>urn:epc:pat:gid-64-i:1.5.[3-12]</pattern>
</cacheContent>
<threshold>2500</threshold>
</EPCCacheReport>

XML Schema for PCSpec, PCWriteReport, EPCCacheSpec, and EPCCacheReport

The share/schemas/ALEPC.xsd file in the RFID Edge Server installation defines an XML representation for PCSpec, PCWriteReport, EPCCacheSpec, and EPCCacheReport instances, using the W3C XML Schema language.

 


Using the ALEPC Tag Writing API from Java

To use the ALEPC tag writing API, you create an instance of the AxisALEPCClient class provided in the com.connecterra.alepc.client package. This class implements the ALEPC interface as described in ALEPC: Main Tag Writing Interface with UML Diagrams and provides all of the methods described there. It also provides an additional method, getALEPCFactory, which returns a factory for creating instances of other types, described below. The AxisALEPCClient interacts with an WebLogic RFID Edge Server over the network using SOAP over HTTP. When you construct an instance of AxisALEPCClient, you provide a service URL for the Edge Server with which you want to interact.

When using the AxisALEPCClient class, you need to create instances of PCSpec, EPCCacheSpec, and other types described in this chapter. The ALEPCFactory interface. in package com.connecterra.alepc.api, provides methods for creating instances of those types. You obtain an instance of the ALEPCFactory interface by calling the getALEPCFactory method provided by the AxisALEPCClient class. When passing arguments to methods of a specific AxisALEPCClient instance, you must always use the factory instance provided by that AxisALEPCClient instance.

Using XML Serializers and Deserializers from Java

The Java binding of the ALE API provides some additional utility classes for writing XML representations of the data types used in the ALE API. With these classes, you can convert a Java object representation of a particular data type into XML ("serialization"), and likewise convert an XML representation of a particular data type back into a Java object ("deserialization"). The XML schemas are located in your RFID Edge Server installation directory at:

/share/schemas/EPCglobal-ale-1_0.xsd
/share/schemas/EPCglobal.xsd
/share/schemas/EPCglobal-ale-1_0-RFTagAware-extensions.xsd
/share/schemas/ALEPC.xsd

To read and write XML for types used in the ALE tag writing API, you use an instance of the PCXMLSerializationFactory provided in the com.connecterra.alepc.encoding package. There is only one static instance of this class, which you obtain using the static method getInstance(), with no argument. Using the PCXMLSerializationFactory instance, you can create instances of PCXMLSerializer and PCXMLDeserializer to serialize and deserialize instances of the following classes: PCSpec, PCWriteReport, PCSpecInfo, PCSubscriptionInfo, PCSubscriptionControls, EPCCacheSpec, EPCCacheReport, and EPCCacheSpecInfo.

 


BEA Gen2 Write Support

The following sections summarize BEA support for Gen2 command access:

Extended API Support

In support of the UHF Generation 2 Air Interface Protocol, BEA provides extensions to the following classes:

Multiple Tags in Field

In Gen2, it becomes meaningful to perform work while multiple tags are in the reader field. For backward-compatibility, a PCSpec that is not identifiably Gen2 (a PCSpec that does not contain one or more AccessSpecs) will require that the field contain only a single tag, while a PCSpec that contains Gen2 elements will allow multiple tags by default.

A new <restrictSingleTag/> element has been added to the PCSpec to restrict a Gen2 PCSpec to return an error if there are multiple tags in field. This element is implicit in a PCSpec that contains no AccessSpecs. This restriction is on a best-effort basis, and does not represent a guarantee. The current release will only work on a single tag in field.

Parameter Substitutions

The ALEPC poll() and immediate() calls add PCSpec parameters, providing values for use within the processing of the Programming Cycle. The poll and immediate calls accept a parameter map: a map from parameter name to parameter value. The old-style ALEPC calls, which only take a single EPC value, will generate a parameter map from the parameter epc to the provided value.

The values in this parameter map can be used in three ways:

The write, password, and kill operations can take a <param> element for the data needed for the operation. The contents of that element are used as the key into the parameter map, and the associated parameter value is used as the data. For example, the PCSpec can specify the epc cache and a user memory value that indicates the manufacturer, and poll() can specify a date code.

Users of the readerParameters of the PCSpec have been modified to check these parameters for a match before searching the readerParameters.

 


Gen2 PCSpec Examples

The following PCSpec examples demonstrate XML encoding of some Gen2 features:

The following examples are complete: readEPCBank.xml, writeTagMemory.xml and PCWriteReport, and stackLight.xml. The remaining examples show only the <accessSpec> portion of the PCSpec. They use the same <logicalReaders> and <boundarySpec> elements as readEPCBank.xml.

readEPCBank.xml

For all tags in field, report the EPC value of that tag.

<PCSpec xmlns="http://schemas.connecterra.com/alepc">
<applicationData>application specific data can go here</applicationData>
<logicalReaders>
<logicalReader>ConnecTerra1</logicalReader>
</logicalReaders>
<boundarySpec>
<trials>1</trials>
<duration>4000</duration>
</boundarySpec>
<accessSpec>
<operations>
<operation>
<read field="urn:connecterra:tagmem:epc"/>
</operation>
</operations>
</accessSpec>
</PCSpec>

readAbsolute.xml

For all tags in field, read the raw EPC bank including the CRC and control bits, and report that value.

   <accessSpec>
<operations>
<operation>
<read field="urn:connecterra:tagmem:@epc.96"/>
</operation>
</operations>
</accessSpec>

readPassword.xml

For all tags in field, use 0x0000AAAA as the (32-bit) access password and report the first 32 bits of the reserved bank, followed by the next 32 bits. In a Gen2 tag these areas of the tag are the kill password, and the access password, respectively.

   <accessSpec>
<operations>
<operation>
<password>
<literal>urn:epc:raw:96.x0000AAAA</literal>
</password>
</operation>
<operation>
<read field="urn:connecterra:tagmem:@reserved.32"/>
</operation>
<operation>
<read field="urn:connecterra:tagmem:@reserved.32.32"/>
</operation>
</operations>
</accessSpec>

writePassword.xml

For all tags in field, use 0x11111111 as the access password and write the EPC value specified there to the EPC bank.

   <accessSpec>
<operations>
<operation>
<password><literal>urn:epc:raw:64.x11111111</literal></password>
</operation>
<operation>
<write field="urn:connecterra:tagmem:epc">
<literal>urn:epc:tag:sgtin-96:1.0037000.123456.1</literal>
</write>
</operation>
</operations>
</accessSpec>

writePasswords.xml

For all tags in field, write 0x00000001 as the kill password and write 0x00000002 as the access password.

   <accessSpec>
<operations>
<operation>
<!-- write x00000001 into the KILL password -->
<write field="urn:connecterra:tagmem:@reserved.32">
<literal>urn:epc:raw:64.1</literal>
</write>
</operation>
<operation>
<!-- write x00000002 into the ACCESS password -->
<write field="urn:connecterra:tagmem:@reserved.32.32">
<literal>urn:epc:raw:64.2</literal>
</write>
</operation>
</operations>
</accessSpec>

writeTagMemory.xml

For all tags in field, write that raw value to the full EPC bank, overwriting the CRC and control bits.

  <accessSpec>
<operations>
<operation>
<write field="urn:connecterra:tagmem:@epc.128">
<literal>urn:epc:raw:128.973572063680812240853843738361866</literal>
</write>
</operation>
</operations>
</accessSpec>

writeTagMemory.xml and PCWriteReport.xml

<PCSpec xmlns="http://schemas.connecterra.com/alepc">
<applicationData>Write Tag Memory</applicationData>
<logicalReaders>
<logicalReader>ConnecTerra1</logicalReader>
</logicalReaders>
<boundarySpec>
<trials>1</trials>
<duration>4000</duration>
</boundarySpec>
<accessSpec>
<operations>
<operation>
<write field="urn:connecterra:tagmem:epc">
<literal>urn:epc:tag:sgtin-96:1.0037000.123456.1</literal>
</write>
</operation>
</operations>
</accessSpec>
</PCSpec>
<PCWriteReport date="2006-04-04T21:45:55.369Z" savantID="Warren"
specName="write" totalMilliseconds="1141" totalTrials="0"
xmlns="http://schemas.connecterra.com/alepc">
<applicationData>Write Tag Memory</applicationData>
<wasSuccessful>true</wasSuccessful>
<status>SUCCESSFUL</status>
<physicalReaders>
<physicalReader>SimReadr</physicalReader>
</physicalReaders>
<failedLogicalReaders/>
<cacheSize>0</cacheSize>
<accessReport>
<tag epc="urn:epc:tag:sgtin-96:1.0037000.123456.1">
<opReport>
<status>SUCCESSFUL</status>
<field>urn:connecterra:tagmem:epc</field>
<value>urn:epc:tag:sgtin-96:1.0037000.123456.1</value>
</opReport>
</tag>
</accessReport>
</PCWriteReport>

kill.xml

For all tags in field, try to kill the tag with the provided (32-bit) kill password (0x22222222):

   <accessSpec>
<operations>
<operation>
<kill>
<literal>urn:epc:raw:64.572662306</literal>
</kill>
</operation>
</operations>
</accessSpec>

lock.xml

For all tags in field, try to perform the specified lock operation with the provided password (0x11111111):

   <accessSpec>
<operations>
<operation>
<password>
<literal>urn:epc:raw:64.286331153</literal>
</password>
</operation>
<operation>
<lock>
<mask>urn:epc:raw:64.3</mask>
<value>urn:epc:raw:64.3</value>
</lock>
</operation>
</operations>
</accessSpec>

stackLight.xml

Write tag memory with stack light information, turning on the Amber stack light indefinitely:

<?xml version="1.0" encoding="UTF-8"?>
<PCSpec xmlns="http://schemas.connecterra.com/alepc">
<applicationData>
Turn on Amber stack light indefinitely
(starting from bit 12, 4 bits)
</applicationData>
<logicalReaders>
<logicalReader>StackLight</logicalReader>
</logicalReaders>
<boundarySpec>
<trials>1</trials>
<duration>4000</duration>
</boundarySpec>
<accessSpec>
<operations>
<operation>
<!-- write EPC memory -->
<write field="urn:connecterra:tagmem:@stacklight.4.12">
<literal>urn:epc:raw:64.x9</literal>
</write>
</operation>
</operations>
</accessSpec>
</PCSpec>

For more information on stack light control, see Configuring and Controlling Stack Lights in the RFID Reader Reference manual.


  Back to Top       Previous  Next