| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fosstrak.hal.impl.sim.SimulatorController
public class SimulatorController
The SimulatorController is a HAL controller that enables the implementation of different kinds of RFID reader simulators/emulators. From the HAL point of view the SimulatorController supports the same functionality as hardware controllers. Additionally it provides methods that allow a Simulator (i.e. SimulatorEngine) to (virtually) add and remove RFID tags.
| Field Summary | |
|---|---|
|  java.util.Vector<java.lang.String> | continuousIdentifyErrorsContains the names of all read points whose identify-operations will always fail. | 
|  java.util.Vector<java.lang.String> | continuousKillErrorsContains the names of all read points whose kill-operations will always fail. | 
|  java.util.Vector<java.lang.String> | continuousReadErrorsContains the names of all read points whose read-operations will always fail. | 
|  java.util.Vector<java.lang.String> | continuousWriteErrorsContains the names of all read points whose write-operations will always fail. | 
|  java.util.Vector<java.lang.String> | identifyErrorContains the names of all read points whose next identify-operation will fail. | 
|  java.util.Vector<java.lang.String> | killErrorContains the names of all read points whose next kill-operation will fail. | 
|  java.util.Vector<java.lang.String> | readErrorContains the names of all read points whose next read-operation will fail. | 
|  java.util.Vector<java.lang.String> | writeErrorContains the names of all read points whose next write-operation will fail. | 
| Constructor Summary | |
|---|---|
| SimulatorController(java.lang.String halName,
                    java.lang.String propFile) | |
| Method Summary | |
|---|---|
|  boolean | add(java.lang.String readPointName,
    java.lang.String tagId)To move a certain tag to a certain antenna. | 
|  boolean | add(java.lang.String readPointName,
    Tag tag)To move a certain tag to a certain antenna. | 
|  void | addAsynchronousIdentifyListener(AsynchronousIdentifyListener listener)Adds an asynchronous identify listener. | 
|  boolean | contains(java.lang.String readPointName,
         java.lang.String tagId)To find out whether a certain tag is situated on a certain antenna. | 
|  boolean | contains(java.lang.String readPointName,
         Tag tag)To find out whether a certain tag is situated on a certain antenna. | 
|  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. | 
|  java.util.Set | getTagsFromReadPoint(java.lang.String readPointName)To get a set of all tags situated on a certain antenna. | 
|  Observation[] | identify(java.lang.String[] readPointNames)Identifies the tags in a reader's field. | 
|  void | initialize()Initialize a reader. | 
|  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. | 
| static void | main(java.lang.String[] args)For debugging. | 
|  void | programId(java.lang.String id,
          java.lang.String[] passwords) | 
|  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. | 
|  boolean | remove(java.lang.String readPointName,
       java.lang.String tagId)To remove a certain tag from a certain antenna. | 
|  boolean | remove(java.lang.String readPointName,
       Tag tag)To remove a certain tag from a certain antenna. | 
|  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()andremoveAsynchronousIdentifyListener()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()andsetParameter()methods. | 
|  boolean | supportsProgramId() | 
|  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. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public java.util.Vector<java.lang.String> identifyError
public java.util.Vector<java.lang.String> readError
public java.util.Vector<java.lang.String> writeError
public java.util.Vector<java.lang.String> killError
public java.util.Vector<java.lang.String> continuousIdentifyErrors
public java.util.Vector<java.lang.String> continuousReadErrors
public java.util.Vector<java.lang.String> continuousWriteErrors
public java.util.Vector<java.lang.String> continuousKillErrors
| Constructor Detail | 
|---|
public SimulatorController(java.lang.String halName,
                           java.lang.String propFile)
| Method Detail | 
|---|
public void initialize()
public boolean add(java.lang.String readPointName,
                   Tag tag)
readPointName - The name of the read point to which the tag should be added.tag - The tag object to be added to the antenna / read point.
public boolean add(java.lang.String readPointName,
                   java.lang.String tagId)
readPointName - The name of the read point to which the tag should be added.tagId - The ID of a tag to be added to the antenna / read point. A new (empty) tag object with ID tagId will be generated.
public boolean remove(java.lang.String readPointName,
                      Tag tag)
readPointName - The name of the read point from which the tag should be removed.tag - The tag object to be removed from the antenna / read point.
public boolean remove(java.lang.String readPointName,
                      java.lang.String tagId)
readPointName - The name of the read point from which the tag should be removed.tagId - The ID of a tag to be removed from the antenna / read point.
public boolean contains(java.lang.String readPointName,
                        Tag tag)
readPointName - The name of the read pointtag - The tag.
public boolean contains(java.lang.String readPointName,
                        java.lang.String tagId)
readPointName - The name of the read pointtagId - The ID of a tag.
public java.util.Set getTagsFromReadPoint(java.lang.String readPointName)
readPointName - The name of the read point
public java.lang.String getHALName()
HardwareAbstraction
getHALName in interface HardwareAbstraction
public Observation[] identify(java.lang.String[] readPointNames)
                       throws HardwareException
HardwareAbstractionreadPointNames should contain only one read point.
 
 Tags that have been locked during the identification can be reactivated
 by calling the reset() method.
identify in interface HardwareAbstractionreadPointNames - Array that contains the names of all read points to be scanned
Observation object
HardwareException
public void startAsynchronousIdentify(java.lang.String[] readPointNames,
                                      Trigger trigger)
                               throws HardwareException,
                                      UnsupportedOperationException
HardwareAbstractionreadPointNames
 should contain only one read point.
startAsynchronousIdentify in interface HardwareAbstractionreadPointNames - Assay that contains the names of all read points to be scannedtrigger - The trigger that indicates the type of asynchronous identify
HardwareException
UnsupportedOperationException
public void stopAsynchronousIdentify()
                              throws HardwareException,
                                     UnsupportedOperationException
HardwareAbstraction
stopAsynchronousIdentify in interface HardwareAbstractionHardwareException
UnsupportedOperationException
public boolean isAsynchronousIdentifyRunning()
                                      throws HardwareException,
                                             UnsupportedOperationException
HardwareAbstraction
isAsynchronousIdentifyRunning in interface HardwareAbstractionHardwareException
UnsupportedOperationException
public void addAsynchronousIdentifyListener(AsynchronousIdentifyListener listener)
                                     throws HardwareException,
                                            UnsupportedOperationException
HardwareAbstraction
addAsynchronousIdentifyListener in interface HardwareAbstractionHardwareException
UnsupportedOperationException
public void removeAsynchronousIdentifyListener(AsynchronousIdentifyListener listener)
                                        throws HardwareException,
                                               UnsupportedOperationException
HardwareAbstraction
removeAsynchronousIdentifyListener in interface HardwareAbstractionHardwareException
UnsupportedOperationExceptionpublic boolean supportsAsynchronousIdentify()
HardwareAbstractionstartAsynchronousIdentify(),
 stopAsynchronousIdentify(), isAsynchronousIdentifyRunning(),
 addAsynchronousIdentifyListener() and removeAsynchronousIdentifyListener()
 methods.
supportsAsynchronousIdentify in interface HardwareAbstraction
public UnsignedByteArray readBytes(java.lang.String readPointName,
                                   java.lang.String id,
                                   int memoryBank,
                                   int offset,
                                   int length,
                                   java.lang.String[] passwords)
                            throws HardwareException,
                                   UnsupportedOperationException
HardwareAbstractionidentify.
 
 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.
readBytes in interface HardwareAbstractionreadPointName - 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)
HardwareException
UnsupportedOperationException
public void writeBytes(java.lang.String readPointName,
                       java.lang.String id,
                       int memoryBank,
                       int offset,
                       UnsignedByteArray data,
                       java.lang.String[] passwords)
                throws HardwareException,
                       UnsupportedOperationException
HardwareAbstractionidentify.
writeBytes in interface HardwareAbstractionreadPointName - 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)
HardwareException
UnsupportedOperationException
public void writeId(java.lang.String readPointName,
                    java.lang.String id,
                    java.lang.String[] passwords)
             throws ReadPointNotFoundException,
                    HardwareException,
                    UnsupportedOperationException
HardwareAbstraction
writeId in interface HardwareAbstractionreadPointName - 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
HardwareException
UnsupportedOperationExceptionpublic boolean supportsWriteId()
HardwareAbstractionwriteId() method.
supportsWriteId in interface HardwareAbstractionpublic java.lang.String[] getReadPointNames()
HardwareAbstraction
getReadPointNames in interface HardwareAbstraction
public void setParameter(java.lang.String param,
                         java.lang.String value)
                  throws HardwareException,
                         UnsupportedOperationException
HardwareAbstractiongetAllParameterNames()
 should precede this method in order not to set undefined parameters.
setParameter in interface HardwareAbstractionparam - The parameter namevalue - The parameter value
HardwareException
UnsupportedOperationException
public java.lang.String[] getAllParameterNames()
                                        throws HardwareException,
                                               UnsupportedOperationException
HardwareAbstraction
getAllParameterNames in interface HardwareAbstractionHardwareException
UnsupportedOperationException
public java.lang.String getParameter(java.lang.String param)
                              throws HardwareException,
                                     UnsupportedOperationException
HardwareAbstractiongetAllParameterNames() 
 should precede this method in order not to request undefined parameters.
getParameter in interface HardwareAbstractionparam - The parameter name to be read
HardwareException
UnsupportedOperationExceptionpublic boolean supportsParameters()
HardwareAbstractiongetAllParameterNames(),
 getParameter() and setParameter() methods.
supportsParameters in interface HardwareAbstraction
public void programId(java.lang.String id,
                      java.lang.String[] passwords)
               throws HardwareException,
                      UnsupportedOperationException
HardwareException
UnsupportedOperationException
public void reset()
           throws HardwareException
HardwareAbstraction
reset in interface HardwareAbstractionHardwareException
public void kill(java.lang.String readPointName,
                 java.lang.String id,
                 java.lang.String[] passwords)
          throws HardwareException,
                 UnsupportedOperationException
HardwareAbstraction
kill in interface HardwareAbstractionreadPointName - 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)
HardwareException
UnsupportedOperationExceptionpublic boolean supportsReadBytes()
HardwareAbstractionreadBytes() method.
supportsReadBytes in interface HardwareAbstractionpublic boolean supportsWriteBytes()
HardwareAbstractionwriteBytes() method.
supportsWriteBytes in interface HardwareAbstractionpublic boolean supportsProgramId()
public boolean supportsKill()
HardwareAbstractionkill() method.
supportsKill in interface HardwareAbstractionpublic boolean supportsReset()
HardwareAbstractionreset() method.
supportsReset in interface HardwareAbstraction
public int getReadPointPowerLevel(java.lang.String readPointName,
                                  boolean normalize)
HardwareAbstraction
getReadPointPowerLevel in interface HardwareAbstractionreadPointName - 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)
public boolean supportsGetReadPointPowerLevel()
HardwareAbstractiongetReadPointPowerLevel() method.
supportsGetReadPointPowerLevel in interface HardwareAbstraction
public int getReadPointNoiseLevel(java.lang.String readPointName,
                                  boolean normalize)
HardwareAbstraction
getReadPointNoiseLevel in interface HardwareAbstractionreadPointName - 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)
public boolean supportsGetReadPointNoiseLevel()
HardwareAbstractiongetReadPointNoiseLevel() method.
supportsGetReadPointNoiseLevel in interface HardwareAbstractionpublic void startUpReadPoint(java.lang.String readPointName)
HardwareAbstraction
startUpReadPoint in interface HardwareAbstractionreadPointName - The name of the read pointpublic boolean supportsStartUpReadPoint()
HardwareAbstractionstartUpReadPoint() method.
supportsStartUpReadPoint in interface HardwareAbstractionpublic void shutDownReadPoint(java.lang.String readPointName)
HardwareAbstraction
shutDownReadPoint in interface HardwareAbstractionreadPointName - The name of the read pointpublic boolean supportsShutDownReadPoint()
HardwareAbstractionshutDownReadPoint() method.
supportsShutDownReadPoint in interface HardwareAbstractionpublic boolean isReadPointReady(java.lang.String readPointName)
HardwareAbstraction
isReadPointReady in interface HardwareAbstractionreadPointName - The name of the read point
true it the antenna is ready,
         false otherwisepublic boolean supportsIsReadPointReady()
HardwareAbstractionisReadPointReady() method.
supportsIsReadPointReady in interface HardwareAbstractionpublic static void main(java.lang.String[] args)
args - No arguments| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||