|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HardwareAbstraction
The standardized interface defines an abstraction of the underlaying reader hardware. The HardwareAbstraction interface defines
a set of methods that can be implemented by any so called HAL controller class. A class that implements
the interface agrees to implement all the methods defined in the interface, thereby agreeing to certain behavior.
The functionality provided by the interface is kept as generally as possible in order not to exclude certain
readers. The hardware itself has to comply with the following minimal requirements in order to be supported by the framework.
The minimal assumption about the proprietary RFID systems is that the reader allows the identification of tags by a unique serial number.
The tag's unique serial number, i.e. identifier, has to be specified as a String representing a hexadecimal number. The hexadecimal digits
are the ordinary, base-10 digits '0' through '9' plus the letters 'A' through 'F'. In the hexadecimal system, these digits represent
the values 0 through 15, respectively. A hexadecimal integer is a sequence of hexadecimal digits, such as 34A7, FF8, 174204. Depending
on the concrete hardware this String will be converted into a convenient format, for example a byte array.
In the HAL model, the memory is devided into memory banks that can be addressed. In each memory bank the memory can be accessed
in block units, whereas the blocksize has to be specified in a corresponding properties file. Despite the block size, memory is
specified in bytes. Since Java does not support unsigned bytes as basic types the class UnsignedByteArray
is used to represent
array of bytes. In general, a HAL controller instance can offer it's own memory bank model, i.e. the number of memory banks and
the content of certain memory banks such as EPCs, Tag IDs, or Passwords. To avoid confusion the following memory model is suggested
which is given in the EPCglobal Class 1 Generation 2 specification:
memory bank 0: protected
memory bank 1: EPC (Electronic Product Code or other object IDs, read only)
memory bank 2: Tag ID (factory programmed ID, read only)
memory bank 3: user memory (read/write)
In addition, more memory banks could be used for user memory or to retrieve values of sensors mounted on a tag. Even if the underlaying
reader hardware does not support EPCs, the memory bank model could be implemented using the provided memory of the reader hardware.
The HAL controller implementation has to decide which of the IDs should be the master ID of the tag that is returned when
performing an identify
command. In an Observation
the type of ID has to be specified.
HAL controller implementations have to take the memory block size of the underlaying reader hardware into account. When performing a
read operation only the requested number of bytes should be returned to the client even if more bytes have to be read to satisfy the
block size constraints. When writing data to tag memory a preceding read operation might be necessary to avoid overwriting of memory
with empty data used to fit the block size.
Method Summary | |
---|---|
void |
addAsynchronousIdentifyListener(AsynchronousIdentifyListener listener)
Adds an asynchronous identify listener. |
java.lang.String[] |
getAllParameterNames()
Gets the names of the supported parameters. |
java.lang.String |
getHALName()
Returns the HAL name. |
java.lang.String |
getParameter(java.lang.String param)
Gets the value of a given parameter. |
java.lang.String[] |
getReadPointNames()
Gets the names of all available read points. |
int |
getReadPointNoiseLevel(java.lang.String readPointName,
boolean normalize)
Returns the current noise level observed at a certain read point. |
int |
getReadPointPowerLevel(java.lang.String readPointName,
boolean normalize)
Returns the current transmit power level of a certain read point. |
Observation[] |
identify(java.lang.String[] readPointNames)
Identifies the tags in a reader's field. |
boolean |
isAsynchronousIdentifyRunning()
Checks whether asynchronous identify is running. |
boolean |
isReadPointReady(java.lang.String readPointName)
Checks whether a read point is ready (i.e. it has been started up). |
void |
kill(java.lang.String readPointName,
java.lang.String id,
java.lang.String[] passwords)
Kills the specified tag, if in range. |
UnsignedByteArray |
readBytes(java.lang.String readPointName,
java.lang.String id,
int memoryBank,
int offset,
int length,
java.lang.String[] passwords)
Reads data from a specified tag, if in range. |
void |
removeAsynchronousIdentifyListener(AsynchronousIdentifyListener listener)
removes an asynchronous identify listener. |
void |
reset()
Resets the reader. |
void |
setParameter(java.lang.String param,
java.lang.String value)
Sets a given parameter. |
void |
shutDownReadPoint(java.lang.String readPointName)
Shuts down a read point. |
void |
startAsynchronousIdentify(java.lang.String[] readPointNames,
Trigger trigger)
Identifies the tags in a reader's field in a continuous way that operates asynchronously. |
void |
startUpReadPoint(java.lang.String readPointName)
Starts up a read point. |
void |
stopAsynchronousIdentify()
Stops the asynchronous identification for a specific listener. |
boolean |
supportsAsynchronousIdentify()
Checks whether this HAL controller implementation supports the startAsynchronousIdentify() ,
stopAsynchronousIdentify() , isAsynchronousIdentifyRunning() ,
addAsynchronousIdentifyListener() and removeAsynchronousIdentifyListener()
methods. |
boolean |
supportsGetReadPointNoiseLevel()
Checks whether this HAL controller implementation supports the getReadPointNoiseLevel() method. |
boolean |
supportsGetReadPointPowerLevel()
Checks whether this HAL controller implementation supports the getReadPointPowerLevel() method. |
boolean |
supportsIsReadPointReady()
Checks whether this HAL controller implementation supports the isReadPointReady() method. |
boolean |
supportsKill()
Checks whether this HAL controller implementation supports the kill() method. |
boolean |
supportsParameters()
Checks whether the HAL controller implementation supports the getAllParameterNames() ,
getParameter() and setParameter() methods. |
boolean |
supportsReadBytes()
Checks whether this HAL controller implementation supports the readBytes() method. |
boolean |
supportsReset()
Checks whether this HAL controller implementation supports the reset() method. |
boolean |
supportsShutDownReadPoint()
Checks whether this HAL controller implementation supports the shutDownReadPoint() method. |
boolean |
supportsStartUpReadPoint()
Checks whether this HAL controller implementation supports the startUpReadPoint() method. |
boolean |
supportsWriteBytes()
Checks whether this HAL controller implementation supports the writeBytes() method. |
boolean |
supportsWriteId()
Checks whether this HAL controller implementation supports the writeId() method. |
void |
writeBytes(java.lang.String readPointName,
java.lang.String id,
int memoryBank,
int offset,
UnsignedByteArray data,
java.lang.String[] passwords)
Writes data to a specific tag, if in range. |
void |
writeId(java.lang.String readPointName,
java.lang.String id,
java.lang.String[] passwords)
Writes the given ID onto a tag. |
Method Detail |
---|
Observation[] identify(java.lang.String[] readPointNames) throws ReadPointNotFoundException, HardwareException
readPointNames
should contain only one read point.
Tags that have been locked during the identification can be reactivated
by calling the reset()
method.
readPointNames
- Array that contains the names of all read points to be scanned
Observation
object
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
ReadPointNotFoundException
HardwareException
void startAsynchronousIdentify(java.lang.String[] readPointNames, Trigger trigger) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointNames
should contain only one read point.
readPointNames
- Assay that contains the names of all read points to be scannedtrigger
- The trigger that indicates the type of asynchronous identify
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
void stopAsynchronousIdentify() throws HardwareException, UnsupportedOperationException
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
HardwareException
UnsupportedOperationException
boolean isAsynchronousIdentifyRunning() throws HardwareException, UnsupportedOperationException
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
HardwareException
UnsupportedOperationException
void addAsynchronousIdentifyListener(AsynchronousIdentifyListener listener) throws HardwareException, UnsupportedOperationException
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
HardwareException
UnsupportedOperationException
void removeAsynchronousIdentifyListener(AsynchronousIdentifyListener listener) throws HardwareException, UnsupportedOperationException
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
HardwareException
UnsupportedOperationException
boolean supportsAsynchronousIdentify()
startAsynchronousIdentify()
,
stopAsynchronousIdentify()
, isAsynchronousIdentifyRunning()
,
addAsynchronousIdentifyListener()
and removeAsynchronousIdentifyListener()
methods.
UnsignedByteArray readBytes(java.lang.String readPointName, java.lang.String id, int memoryBank, int offset, int length, java.lang.String[] passwords) throws ReadPointNotFoundException, OutOfBoundsException, HardwareException, UnsupportedOperationException
identify
.
The data on a tag's memory
can be read in block units. Therefore the length
parameter, that indicates the number of bytes that have to be read, has
to contain a multiple of the blocksize.
readPointName
- The name of the read point on which the read attempt will be doneid
- ID of the tag from which the data will be readmemoryBank
- The number of the memory bank of the dataoffset
- The offset of the data in byteslength
- The number of bytes to be readpasswords
- An optional list of one or more passwords (or lock code)
ReadPointNotFoundException,
- if the read point can not be found.
OutOfBoundsException,
- if memoryBank, offset or length exceeds the allowed number.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
OutOfBoundsException
HardwareException
UnsupportedOperationException
boolean supportsReadBytes()
readBytes()
method.
void writeBytes(java.lang.String readPointName, java.lang.String id, int memoryBank, int offset, UnsignedByteArray data, java.lang.String[] passwords) throws ReadPointNotFoundException, OutOfBoundsException, HardwareException, UnsupportedOperationException
identify
.
readPointName
- The name of the read point on which the write attempt will be doneid
- ID of the tag to which the data will be writtenmemoryBank
- The number of the memory bank of the dataoffset
- The offset of the data in bytesdata
- The byte data to be written to the tagpasswords
- An optional list of one or more passwords (or lock code)
ReadPointNotFoundException,
- if the read point can not be found.
OutOfBoundsException,
- if memoryBank, offset or length exceeds the allowed number.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
OutOfBoundsException
HardwareException
UnsupportedOperationException
boolean supportsWriteBytes()
writeBytes()
method.
void kill(java.lang.String readPointName, java.lang.String id, java.lang.String[] passwords) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointName
- the name of the read point on which the kill attempt will be doneid
- id of the tag that will be killedpasswords
- an optional list of one or more passwords (or lock code)
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
boolean supportsKill()
kill()
method.
void writeId(java.lang.String readPointName, java.lang.String id, java.lang.String[] passwords) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointName
- The name of the read point on which the write attempt will be doneid
- the new ID for the tagpasswords
- an optional list of one or more passwords (or lock code)
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
boolean supportsWriteId()
writeId()
method.
java.lang.String getHALName()
java.lang.String[] getReadPointNames()
java.lang.String[] getAllParameterNames() throws HardwareException, UnsupportedOperationException
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
HardwareException
UnsupportedOperationException
java.lang.String getParameter(java.lang.String param) throws HardwareException, UnsupportedOperationException
getAllParameterNames()
should precede this method in order not to request undefined parameters.
param
- The parameter name to be read
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
HardwareException
UnsupportedOperationException
void setParameter(java.lang.String param, java.lang.String value) throws HardwareException, UnsupportedOperationException
getAllParameterNames()
should precede this method in order not to set undefined parameters.
param
- The parameter namevalue
- The parameter value
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
HardwareException
UnsupportedOperationException
boolean supportsParameters()
getAllParameterNames()
,
getParameter()
and setParameter()
methods.
void reset() throws HardwareException
HardwareException,
- if the operation can not be performed.
HardwareException
boolean supportsReset()
reset()
method.
int getReadPointPowerLevel(java.lang.String readPointName, boolean normalize) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointName
- The name of the read pointnormalize
- Specifies whether the power level should be returned in a normalized form (i.e. in a range from 0 to 255)
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
boolean supportsGetReadPointPowerLevel()
getReadPointPowerLevel()
method.
int getReadPointNoiseLevel(java.lang.String readPointName, boolean normalize) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointName
- The name of the read pointnormalize
- Specifies whether the noise level should be returned in a
normalized form (i.e. in a range from 0 to 255)
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
boolean supportsGetReadPointNoiseLevel()
getReadPointNoiseLevel()
method.
void startUpReadPoint(java.lang.String readPointName) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointName
- The name of the read point
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
boolean supportsStartUpReadPoint()
startUpReadPoint()
method.
void shutDownReadPoint(java.lang.String readPointName) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointName
- The name of the read point
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
boolean supportsShutDownReadPoint()
shutDownReadPoint()
method.
boolean isReadPointReady(java.lang.String readPointName) throws ReadPointNotFoundException, HardwareException, UnsupportedOperationException
readPointName
- The name of the read point
true
it the antenna is ready,
false
otherwise
ReadPointNotFoundException,
- if the read point can not be found.
HardwareException,
- if the operation can not be performed.
UnsupportedOperationException,
- if the operation is not supported by the controller implementation.
ReadPointNotFoundException
HardwareException
UnsupportedOperationException
boolean supportsIsReadPointReady()
isReadPointReady()
method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |