com.alien.enterpriseRFID.reader
Class AlienClassOEMReader

java.lang.Object
  extended bycom.alien.enterpriseRFID.reader.AbstractReader
      extended bycom.alien.enterpriseRFID.reader.AlienClass1Reader
          extended bycom.alien.enterpriseRFID.reader.AlienClassOEMReader
All Implemented Interfaces:
java.lang.Runnable

public class AlienClassOEMReader
extends AlienClass1Reader
implements java.lang.Runnable

This class allows the host to interact with Alien readers which use the Alien Binary Reader Protocol, otherwise known as the DLE (Data Link Escape) protocol.

Typically the Reader object will be obtained from a DiscoveryItem object, which is acquired through one of the reader discovery mechanisms, such as SerialDiscoveryListenerService. However if the location (serial port name) is known, a Reader object can be instantiated directly without the need of any discovery classes.

Once a valid reader object is instantiated, the user would first open a connection to it, then use any of the simple methods that implement the full command set described by the Reader Interface Guide. Without having the benefit of an ASCII-based interface controller on the reader, much of the autonomous mode functionality found on Alien's full-sized readers must be emulated (partially) by this class. Basically, this class supports autonomous operation only in that it can read tags constantly on it's own, maintaining its own TagList.

This class inherits from AlienClass1Reader, which supports readers with much more functionality than the OEM readers provide. As such, the sendString() and receiveString() methods are overridden so that commands designed to work only with ASCII-based readers are not sent to OEM readers.

See AlienDLEObject and AlienClassOEMReader for information on how the DLE protocol is used to communicate with Alien readers.

Version:
1.5 Dec 2007
Author:
Chris Parkinson, David Krull

Field Summary
 int lastCommandByteCount
           
 byte[] lastCommandBytes
           
 int lastResponseByteCount
           
 byte[] lastResponseBytes
           
 AlienDLEObject rc
           
 
Fields inherited from class com.alien.enterpriseRFID.reader.AlienClass1Reader
ALL_MASK, CLASS0, CLASS1GEN1_64BITS, CLASS1GEN1_96BITS, CLASS1GEN1_ALL, CLASS1GEN1_LEPTON, CLASS1GEN1_OMEGA, CLASS1GEN1_QUARK, CLASS1GEN2, CUSTOM_FORMAT, DATA_INC_ALWAYS, DATA_INC_FAIL, DATA_INC_OFF, DATA_INC_SUCCESS, DATA_INC_WRITE, DATE_FORMATTER, FUNCTION_PROGRAMMER, FUNCTION_READER, G2TARGET_A, G2TARGET_AB, G2TARGET_B, GLOBAL_SCROLL, INVENTORY, LOCKTYPE_LOCK, LOCKTYPE_PERMALOCK, LOCKTYPE_PERMAUNLOCK, LOG_OFF, LOG_ON, OFF, ON, PROG_CLASS0, PROG_CLASS1GEN1, PROG_CLASS1GEN2, RFMOD_DRM, RFMOD_HS, RFMOD_STD, TERSE_FORMAT, TEXT_FORMAT, XML_FORMAT
 
Fields inherited from class com.alien.enterpriseRFID.reader.AbstractReader
DEBUG_BYTES, DEBUG_OFF, DEBUG_TEXT, DEFAULT_TIMEOUT, TIMEOUTMODE_CHARACTER, TIMEOUTMODE_COMMAND
 
Constructor Summary
AlienClassOEMReader()
          Constructs a new AlienClassOEMReader object, initializing an internal TagTable, and setting AutoMode off.
AlienClassOEMReader(java.lang.String address)
          Constructs a new AlienClassOEMReader object, specifying the address.
 
Method Summary
 void autoModeReset()
          Reset all autonomous mode values to their default states, including turning autonomous mode off.
 void clearTagList()
          Clears all the tags from the internal TagList.
 Tag[] doInventory()
          Performs an Inventory.
 void eraseTag()
          Erases the data in the tag's ID space, using default loop-control parameters.
 void eraseTag(int numVerifies, int numErases)
          Erases the data in the tag's ID space.
 int getAcquireC1Count()
          Returns the number of reads to perform in each C1 acquire cycle.
 int getAcquireC1Cycles()
          Returns the number of complete acquire cycles to perform with each C1 read operation.
 int getAcquireC1EnterWakeCount()
          Returns the number of wakes to perform at the start of each C1 acquire cycle.
 int getAcquireC1ExitWakeCount()
          Returns the number of wakes to perform at the end of each C1 acquire cycle.
 int getAcquireC1SleepCount()
          Returns the number of sleeps to perform after each C1 acquire cycle.
 int getAcquireCount()
          Returns the number of reads to perform in each Class1 Gen1 acquire cycle.
 int getAcquireCycles()
          Returns the number of complete acquire cycles to perform with each Class1 Gen1 read operation.
 int getAcquireEnterWakeCount()
          Returns the number of wakes to perform at the start of each Class1 Gen1 acquire cycle.
 int getAcquireExitWakeCount()
          Returns the number of wakes to perform at the end of all the Class1 Gen1 acquire cycles.
 int getAcquireG2Count()
          Returns the number of reads to perform in each G2 acquire cycle.
 int getAcquireG2Cycles()
          Returns the number of complete acquire cycles to perform with each G2 read operation.
 int getAcquireG2Q()
          Returns the starting Q value for each G2 acquire cycle.
 java.lang.String getAcquireMode()
          Returns the method that the reader uses to scan for tags.
 int getAcquireSleepCount()
          Returns the number of sleeps to perform after each Class1 Gen1 acquire cycle.
 int getActiveAntenna()
          Returns the number of the active antenna.
 java.lang.String getAntennaSequence()
          Returns the Antenna Sequence, as a comma-separated String of hex values.
 int getAntennaStatus()
          Returns the Antenna Status.
 int getAutoMode()
          Returns the ON/OFF status of Autonomous mode.
 int getAvailableBaudRates()
          Returns a bitmap denoting the available baud rates for this reader.
 int getBaudRate()
          Returns the reader's serial communication baud rate.
 int getBidirectionalDDR()
          Returns a bitmap defining the direction of the Bi-Directional I/O ports.
 int getBidirectionalIOPorts()
          Returns a bitmap specifying which of the I/O ports have been configured to be Bidirectional inputs/outputs.
 int getExternalInput()
          Returns the decimal representation of the state of the external inputs.
 int getGeneralPurposeInputs()
          Returns a bitmap specifying which of the I/O ports have been configured to be General Purpose Inputs.
 int getGeneralPurposeOutputs()
          Returns a bitmap specifying which of the I/O ports have been configured to be General Purpose Outputs.
 int getHardwareReaderType()
          Returns this reader's Reader Type.
 int getHopInterval()
          Returns the length of time the reader dwells at each frequency before hopping to the next one.
 int getHopStepSize()
          Returns the frequency spacing of this reader's hop table.
 int getIOPortValue()
          Returns the current state of the input/output port pins.
 int getLocalizationCode()
          Returns this reader's Localization Code.
 java.lang.String getMask()
          Returns the current tag mask.
 int getMaxAntenna()
          Returns the maximum antenna number that may be addressed by this reader.
 int getMaxFrequency()
          Returns the maximum RF frequency that this reader may be set to.
 int getMaxHopTableIndex()
          Returns the maximum allowable Hop Channel that is used in the hopping table.
 int getMaxRFChannel()
          Returns the maximum RF channel used in this reader.
 int getMaxRFPower()
          Returns the maximum RF power available with this reader hardware.
 int getMinFrequency()
          Returns the minimum RF frequency that this reader may be set to.
 int getOperatingVoltage()
          Returns the measured voltage level into the OEM Module, given in hundredths of a volt.
 int getPersistTime()
          Returns the time, in seconds, that tags on the internal TagList will persist without having been read, before being purged from the list.
 int getPLLType()
          Returns the type of PLL installed in this reader.
 int getProgAntenna()
          Returns the number of the programming antenna.
 int getProgramEnableMode()
          Returns a bitmap specifying which program functions are enabled for this reader.
 int getRadioType()
          Returns the type of RF radio in this reader.
 java.lang.String getReaderName()
          Returns the reader name.
 int getReaderNumber()
          Returns the ReaderNumber stored in this reader.
 java.lang.String getReaderSerialNumber()
           
 java.lang.String getReaderType()
          Returns the reader type.
 java.lang.String getReaderVersion()
          Returns the firmware version of this reader, including the ReaderLocale and ReaderType values.
 int getRFAttenuation()
          Returns the RF power attenuation value from non-volatile memory.
 int getRFChannel()
          Returns the RF channel currently being used by this reader.
 int getRFOnOff()
          Returns the current state of the RF power while the reader is idle.
 int getSupportedTagTypes()
          Returns the bitmap indicating which Alien RFID tag types the reader should look for.
 Tag getTag()
          Acquires one Tag, once.
 Tag getTag(int multiplier)
          Acquires one Tag, using a multiplier.
 java.lang.String getTagID()
          Acquires tags, and returns the TagID of the first tag on the TagList.
 Tag[] getTagList()
          Returns an array of tags known to the reader, once.
 Tag[] getTagList(int multiplier)
          Fetches and returns the tag list, using a multiplier count.
 java.lang.String getTimer()
          Returns the Timer text for the most recent acquire.
 void issueReaderCommand(AlienDLEObject rc)
          Issues a reader command.
 void killTag(int numVerifies, int numKills, java.lang.String tagIDAndPassCode)
          Kills a tag by erasing the data in a locked tag's ID space.
 void killTag(java.lang.String tagIDAndPassCode)
          Kills a tag by erasing the data in a locked tag's ID space, using default loop-control parameters.
 void lockTag(int tagIDLength, int lockCode)
          Locks a Tag, using default loop-control parameters.
 void lockTag(int numVerifies, int numLocks, int tagIDLength, int lockCode)
          Locks a Tag.
 void lockTag(java.lang.String passCode)
          Locks a Tag, using default loop-control parameters and tagID length.
 java.lang.String manageReserved(java.lang.String reservedCommand)
          Enables one of the "Manage Reserved" DLE-based command sequences to be sent to the reader.
 java.lang.String manageReservedCLI()
          Enables one of the "Manage Reserved" DLE-based command sequences to be sent to the reader.
 void programTag(int numVerifies, int numErases, int numPrograms, java.lang.String tagID)
          Writes data to the tag ID space.
 void programTag(java.lang.String tagID)
          Writes data to the tag ID space, using default loop-control parameters.
 java.lang.String rcCLI()
          Enables raw DLE-based command sequences to be sent to the reader.
 java.lang.String readerCommandCLI()
          Enables raw DLE-based command sequences to be sent to the reader.
 void reboot()
          Causes the reader module to reboot.
 byte[] receiveBytes()
          Receives and entire response message from the reader.
 java.lang.String receiveString(boolean blockForInput)
          Returns the response string prepared by the sendString() method, as it if came from a reader sporting an ASCII-based interface.
 int resetBaudRate()
          Attempts to set the serial communication baud rate of this reader to 115,200.
 void run()
          Run the automode function for this reader.
 void sendBytes(byte[] bytes)
          Sends an arbitrary sequence of bytes to the reader.
 void sendString(java.lang.String command)
          Intercepts a command string intended for the OEM reader, and attempts to handle the command using methods from this class.
 void setAcquireC1Count(int acquireC1Count)
          Specifies the number of reads to perform in each C1 acquire cycle.
 void setAcquireC1Cycles(int acquireC1Cycles)
          Specifies the number of complete acquire cycles to perform with each C1 read operation.
 void setAcquireC1EnterWakeCount(int acquireC1EnterWakeCount)
          Specifies the number of wakes to perform at the start of each C1 acquire cycle.
 void setAcquireC1ExitWakeCount(int acquireC1ExitWakeCount)
          Specifies the number of wakes to perform at the end each C1 acquire cycle.
 void setAcquireC1SleepCount(int acquireC1SleepCount)
          Specifies the number of sleeps to perform during each C1 acquire cycle.
 void setAcquireCount(int acquireC1Count)
          Specifies the number of reads to perform in each Class1 Gen1 acquire cycle.
 void setAcquireCycles(int acquireC1Cycles)
          Specifies the number of complete acquire cycles to perform with each Class1 Gen1 read operation.
 void setAcquireEnterWakeCount(int acquireC1EnterWakeCount)
          Specifies the number of wakes to perform at the start of each Class1 Gen1 acquire cycle.
 void setAcquireExitWakeCount(int acquireC1ExitWakeCount)
          Specifies the number of wakes to perform at the end all the Class1 Gen1 acquire cycles.
 void setAcquireG2Count(int acquireG2Count)
          Specifies the number of reads to perform in each G2 acquire cycle.
 void setAcquireG2Cycles(int acquireG2Cycles)
          Specifies the number of complete acquire cycles to perform with each G2 read operation.
 void setAcquireG2Q(int acquireG2Q)
          Specifies the starting Q value for each G2 acquire cycle.
 void setAcquireMode(java.lang.String acquireMode)
          Specifies the method the reader uses to scan for tags.
 void setAcquireSleepCount(int acquireC1SleepCount)
          Specifies the number of sleeps to perform during each Class1 Gen1 acquire cycle.
 void setActiveAntenna(int antennaNumber)
          Sets the active antenna to the specified value.
 void setAntennaSequence(int[] antennaSequenceBytes)
          Sets the sequence of antenna ports, using an array of ints, that is used by the reader when responding to an Inventory command.
 void setAntennaSequence(java.lang.String sequenceString)
          Sets the sequence of antenna ports, using a comma-separated String of integer values, that is used by the reader when responding to an Inventory command.
 void setAutoMode(int autoMode)
          Sets the ON/OFF status of Autonomous mode.
 void setBaudRate(int baudRate)
          Sets the reader's serial communication baud rate to the value specified.
 void setBidirectionalDDR(int bitmap)
          Sets the input/output direction of Bi-Directional I/O ports.
 void setDebugLevel(int level)
          Sets the current Debug Level.
 void setExternalOutput(int value)
          Changes the state of the reader's external output pins.
 void setG2Mask(int bitLength, int bitPointer, java.lang.String tagMaskBytes)
           
 void setG2TagMask(java.lang.String tagID)
          Sets the reader's Class1/Gen2 tag mask to match the specified EPC.
 void setIOPortValue(int portValue)
          Sets or clears specified output port pins.
 void setMask(int bitLength, int bitPointer, java.lang.String tagMaskBytes)
          Set the Tag Mask, using a length, pointer, and string of hex bytes as parameters.
 void setMask(java.lang.String maskString)
          Sets the Tag Mask, as a String.
 void setPersistTime(int persistTime)
          Sets the time, in seconds, that tags on the internal TagList will persist without having been read, before being purged from the list.
 void setProgAntenna(int antennaNumber)
          Sets the programming antenna to the specified value.
 void setReaderNumber(int readerNumber)
          Changes the ReaderNumber parameter of this reader.
 void setRFAttenuation(int attenuationValue)
          Sets the RF power attenuation to the value associated with argument provided.
 void setRFOnOff(int powerOnOff)
          Turns the RF carrier on or off while idle (not reading tags).
 void setSupportedTagTypes(int tagType)
          Sets the bitmap indicating which Alien RFID tag types the reader should look for.
 void setTagMask(java.lang.String tagID)
          Sets the reader's tag mask to match the specified Tag ID.
 void sleepTag()
          Causes a tag in the field to enter the sleep state.
 java.lang.String toString()
          Returns a String representation of this reader object (it's ReaderType).
 java.lang.String verifyTag()
          Interrogates the state of a tag that may or may not be readable by the Acquire commands.
 void wakeTag()
          Requests all tags in the field wake up.
 
Methods inherited from class com.alien.enterpriseRFID.reader.AlienClass1Reader
autoModeTriggerNow, clearIOList, g2Erase, g2Read, g2Wake, g2Wake, g2Write, getAcqC1Mask, getAcqG2AccessPwd, getAcqG2Mask, getAcqG2MaskAction, getAcqG2MaskAntenna, getAcqG2SL, getAcqMask, getAcquireC0Count, getAcquireC0Cycles, getAcquireG2Ops, getAcquireG2Ops, getAcquireG2OpsMode, getAcquireG2Selects, getAcquireG2Session, getAcquireG2TagData, getAcquireG2Target, getAcquireSleep, getAcquireTime, getAcquireWakeCount, getAutoAction, getAutoErrorOutput, getAutoFalseOutput, getAutoFalsePause, getAutoModeStatus, getAutoProgError, getAutoStartPause, getAutoStartTrigger, getAutoStopPause, getAutoStopTimer, getAutoStopTrigger, getAutoTrueOutput, getAutoTruePause, getAutoWaitOutput, getAutoWorkOutput, getCommandPort, getCustomTagList, getCustomTagList, getDHCP, getDNS, getExternalOutput, getGateway, getHeartbeatAddress, getHeartbeatCount, getHeartbeatPort, getHeartbeatTime, getHostname, getInfo, getInitExternalOutput, getInvertExternalInput, getInvertExternalOutput, getIOList, getIOListCustomFormat, getIOListDump, getIOListFormat, getIOStreamAddress, getIOStreamCustomFormat, getIOStreamFormat, getIOStreamKeepAliveTime, getIOStreamMode, getIOType, getIPAddress, getLBT, getLBTLimit, getLBTValue, getMACAddress, getMailFrom, getMailServer, getMyData, getNetmask, getNetworkTimeout, getNetworkUpgrade, getNotifyAddress, getNotifyFormat, getNotifyHeader, getNotifyInclude, getNotifyKeepAliveTime, getNotifyMode, getNotifyQueueLimit, getNotifyRetryCount, getNotifyRetryPause, getNotifyTime, getNotifyTrigger, getPassword, getProgAlienImageMap, getProgAlienImageNSI, getProgAttempts, getProgBlockAlign, getProgBlockSize, getProgC1KillPwd, getProgDataUnit, getProgEPCData, getProgEPCDataInc, getProgEPCDataIncCount, getProgEraseAttempts, getProgG2AccessPwd, getProgG2KillPwd, getProgG2LockType, getProgG2NSI, getProgIncrementOnFail, getProgProtocol, getProgramID, getProgramPassCode, getProgReadAttempts, getProgSingulate, getProgUserData, getProgUserDataInc, getProgUserDataIncCount, getReaderBaudRate, getReaderFunction, getReaderPassword, getReaderUsername, getRFAttenuation, getRFAttenuations, getRFAttenuations, getRFLevel, getRFLevel, getRFLevels, getRFLevels, getRFModulation, getRSSIFilter, getSpeedFilter, getStreamHeader, getTagAuth, getTagID, getTagInfo, getTagListAntennaCombine, getTagListCustomFormat, getTagListFormat, getTagListMillis, getTagStreamAddress, getTagStreamCountFilter, getTagStreamCountFilterMinimum, getTagStreamCustomFormat, getTagStreamFormat, getTagStreamKeepAliveTime, getTagStreamMode, getTagType, getTime, getTimeServer, getTimeZone, getUpgradeAddress, getUpgradeIPAddress, getUpgradePort, getUptime, getUsername, getWWWPort, heartbeatNow, hideAlienUserBlocks, lockAccessPwd, lockAccessPwd, lockEPC, lockEPC, lockKillPwd, lockKillPwd, lockUser, lockUser, lockUserBlocks, macroDel, macroDelAll, macroList, macroRun, macroStartRec, macroStopRec, macroView, notifyNow, ping, ping, programAccessPwd, programAccessPwd, programAlienImage, programAndLockEPC, programAndLockEPC, programAndLockUser, programAndLockUser, programEPC, programEPC, programKillPwd, programKillPwd, programUser, programUser, reboot, resetAutoMode, saveSettings, setAcqC1Mask, setAcqC1Mask, setAcqG2AccessPwd, setAcqG2Mask, setAcqG2Mask, setAcqG2MaskAction, setAcqG2MaskAntenna, setAcqG2SL, setAcqMask, setAcqMask, setAcquireC0Count, setAcquireC0Cycles, setAcquireG2Ops, setAcquireG2Ops, setAcquireG2Ops, setAcquireG2OpsMode, setAcquireG2Selects, setAcquireG2Session, setAcquireG2TagData, setAcquireG2TagData, setAcquireG2Target, setAcquireSleep, setAcquireTime, setAcquireWakeCount, setAutoAction, setAutoErrorOutput, setAutoFalseOutput, setAutoFalsePause, setAutoProgError, setAutoStartPause, setAutoStartTrigger, setAutoStartTrigger, setAutoStopPause, setAutoStopTimer, setAutoStopTrigger, setAutoStopTrigger, setAutoTrueOutput, setAutoTruePause, setAutoWaitOutput, setAutoWorkOutput, setC1MaskBits, setC1TagMask, setCommandPort, setDefaultIOListFormat, setDefaultTagListFormat, setDHCP, setDNS, setFactorySettings, setFactorySettings, setG2MaskBits, setGateway, setHeartbeatAddress, setHeartbeatCount, setHeartbeatPort, setHeartbeatTime, setHostname, setInitExternalOutput, setInvertExternalInput, setInvertExternalOutput, setIOListCustomFormat, setIOListFormat, setIOStreamAddress, setIOStreamAddress, setIOStreamCustomFormat, setIOStreamFormat, setIOStreamKeepAliveTime, setIOStreamMode, setIOType, setIPAddress, setLBT, setLBTLimit, setLogLevel, setMailFrom, setMailServer, setMaskBits, setMyData, setNetmask, setNetworkTimeout, setNetworkUpgrade, setNotifyAddress, setNotifyAddress, setNotifyFormat, setNotifyHeader, setNotifyInclude, setNotifyKeepAliveTime, setNotifyMode, setNotifyQueueLimit, setNotifyRetryCount, setNotifyRetryPause, setNotifyTime, setNotifyTrigger, setPassword, setProgAlienImageMap, setProgAlienImageNSI, setProgAttempts, setProgBlockAlign, setProgBlockSize, setProgC1KillPwd, setProgDataUnit, setProgEPCData, setProgEPCDataInc, setProgEPCDataIncCount, setProgEraseAttempts, setProgG2AccessPwd, setProgG2KillPwd, setProgG2LockType, setProgG2NSI, setProgIncrementOnFail, setProgProtocol, setProgramID, setProgramPassCode, setProgReadAttempts, setProgSingulate, setProgUserData, setProgUserDataInc, setProgUserDataIncCount, setReaderBaudRate, setReaderFunction, setReaderName, setReaderPassword, setReaderUsername, setRFAttenuation, setRFAttenuations, setRFLevel, setRFLevel, setRFLevels, setRFModulation, setRSSIFilter, setRSSIFilter, setSpeedFilter, setSpeedFilter, setStreamHeader, setTagAuth, setTagListAntennaCombine, setTagListCustomFormat, setTagListFormat, setTagListMillis, setTagStreamAddress, setTagStreamAddress, setTagStreamCountFilter, setTagStreamCountFilter, setTagStreamCustomFormat, setTagStreamFormat, setTagStreamKeepAliveTime, setTagStreamMode, setTagType, setTime, setTime, setTime, setTimeServer, setTimeZone, setUpgradeAddress, setUpgradeIPAddress, setUpgradePort, setUsername, setWWWPort, sleep, sleepTag, unlockAccessPwd, unlockAccessPwd, unlockEPC, unlockEPC, unlockKillPwd, unlockKillPwd, unlockUser, unlockUser, upgradeNow, upgradeNow, upgradeNowList, upgradeNowList, waitForReboot, wake, wakeTag
 
Methods inherited from class com.alien.enterpriseRFID.reader.AbstractReader
bringIntoRange, clearInputBuffer, close, doReaderCommand, getAddress, getDebugLevel, getInputStream, getOutputStream, getReaderReply, getReaderReplyKeyword, getReaderReplyValueInt, getReaderReplyValueString, getTimeOutMilliseconds, getTimeOutMode, isOpen, isValidateOpen, open, receiveLine, setAddress, setConnection, setConnection, setInputStream, setNetworkConnection, setOutputStream, setSerialBaudRate, setSerialConnection, setTimeOutMilliseconds, setTimeOutMode, setValidateOpen, test
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rc

public AlienDLEObject rc

lastResponseBytes

public byte[] lastResponseBytes

lastCommandBytes

public byte[] lastCommandBytes

lastResponseByteCount

public int lastResponseByteCount

lastCommandByteCount

public int lastCommandByteCount
Constructor Detail

AlienClassOEMReader

public AlienClassOEMReader(java.lang.String address)
Constructs a new AlienClassOEMReader object, specifying the address.

Parameters:
address - the serial port address where the reader is connected

AlienClassOEMReader

public AlienClassOEMReader()
Constructs a new AlienClassOEMReader object, initializing an internal TagTable, and setting AutoMode off.

Method Detail

setDebugLevel

public void setDebugLevel(int level)
Description copied from class: AbstractReader
Sets the current Debug Level.

Setting the Debug Level to DEBUG_TEXT causes the text of every reader command/response to be echoed to stdout. For example, calling getReaderName() with Debug Level set to DEBUG_TEXT displays the following:

      Write: Get ReaderName
      Read: ReaderName = Alien RFID Reader
 
Setting the Debug Level to DEBUG_BYTES causes the raw hex data of every reader command/response to be echoed to stdout. For example, the same getReaderName() call with Debug Level set to DEBUG_BYTES displays the following:
      Write: 01 47 65 74 20 52 65 61 64 65 72 4E 61 6D 65 0D 0A
      Read: 52 65 61 64 65 72 4E 61
      Read: 6D 65 20 3D 20 41 6C 69
      Read: 65 6E 20 52 46 49 44 20
      Read: 52 65 61 64 65 72 0D 0A
      Read: 00
 
This Debug Level shows the additional bytes sent to and received from the reader that are used to prefix and terminate commands and responses.

Setting the Debug Level to DEBUG_OFF turns off these diagnostic messages, which is the default state.

Overrides:
setDebugLevel in class AbstractReader
Parameters:
level - the new Debug Level setting

issueReaderCommand

public void issueReaderCommand(AlienDLEObject rc)
                        throws AlienReaderConnectionException,
                               AlienReaderTimeoutException,
                               AlienReaderCommandErrorException
Issues a reader command. The Reader Command is an instance of AlienDLEObject, which contains command/response buffers, manages and validates encoding and decoding of DLE messages, and verifies response data from the reader.

This method is responsible for actually sending the command bytes and receiving the response bytes from the reader. As response bytes are received from the reader, they are passed one-at-a-time to the Reader Command object, which ensures the correct start-of-message (SOM), end-of-message (EOM), and other DLE delimiters are received properly.

All commands are atomic (that is, one command elicits a single DLE message response from the reader), except for the Inventory command. The reader responds to the Inventory command with separate STARTINV and ENDINV messages, as well as separate TAGINV messages for each tag it reads.

Any responses from the reader which indicate an error cause this class to generate an exception, which must be handled by the object which made the original call.

Parameters:
rc - the AlienDLEObject containing the command
Throws:
AlienReaderConnectionException - if communication fails
AlienReaderTimeoutException - if the communication times out
AlienReaderCommandErrorException - if the reader returns an error response to the command

setPersistTime

public void setPersistTime(int persistTime)
Sets the time, in seconds, that tags on the internal TagList will persist without having been read, before being purged from the list.

Overrides:
setPersistTime in class AlienClass1Reader
Parameters:
persistTime - the time (secs) to wait before purging unseen tags
See Also:
AlienClass1Reader.getPersistTime()

getPersistTime

public int getPersistTime()
Returns the time, in seconds, that tags on the internal TagList will persist without having been read, before being purged from the list.

Overrides:
getPersistTime in class AlienClass1Reader
Returns:
the time (secs) to wait before purging unseen tags
See Also:
AlienClass1Reader.setPersistTime(int)

clearTagList

public void clearTagList()
Clears all the tags from the internal TagList.

Overrides:
clearTagList in class AlienClass1Reader
See Also:
AlienClass1Reader.getTagList(int), AlienClass1Reader.getTagList(int), AlienClass1Reader.getTag(int), AlienClass1Reader.getTag(int)

getTagList

public Tag[] getTagList()
                 throws AlienReaderException
Returns an array of tags known to the reader, once.

Overrides:
getTagList in class AlienClass1Reader
Returns:
an array of Tags, or null if no tags
Throws:
AlienReaderException - if reader communication fails
See Also:
getTagList(int)

getTagList

public Tag[] getTagList(int multiplier)
                 throws AlienReaderException
Fetches and returns the tag list, using a multiplier count. If AutoMode is ON, the TagList compiled so far is simply returned, then cleared. If AutoMode is OFF, the current compiled TagList is cleared, the reader acquires tags (using the supplied acquire multiplier, and the new TagList is returned.

Overrides:
getTagList in class AlienClass1Reader
Parameters:
multiplier - the number of times to acquire tags
Returns:
an array of Tags, or null if no tags
Throws:
AlienReaderException - if reader communication fails
See Also:
AlienClass1Reader.getTagList(int), AlienClass1Reader.getTag(int), AlienClass1Reader.getTag(int), AlienClass1Reader.clearTagList()

getTag

public Tag getTag()
           throws AlienReaderException
Acquires one Tag, once. Returns the first Tag on the TagList, performing an acquire first, if necessary.

Overrides:
getTag in class AlienClass1Reader
Returns:
the first Tag on the TagList
Throws:
AlienReaderException - if reader communication fails
See Also:
getTag(int), getTagList(), getTagList(int)

getTag

public Tag getTag(int multiplier)
           throws AlienReaderException
Acquires one Tag, using a multiplier. Returns the first Tag on the TagList, performing an acquire first (multiple times), if necessary.

Overrides:
getTag in class AlienClass1Reader
Parameters:
multiplier - the number of times to acquire tags
Returns:
the first Tag on the TagList
Throws:
AlienReaderException - if reader communication fails
See Also:
getTag(), getTagList(), getTagList(int)

getTagID

public java.lang.String getTagID()
                          throws AlienReaderException
Acquires tags, and returns the TagID of the first tag on the TagList.

Overrides:
getTagID in class AlienClass1Reader
Returns:
the TagID of the tag in the field
Throws:
AlienReaderException - if reader communication fails
See Also:
getTag()

getAutoMode

public int getAutoMode()
Returns the ON/OFF status of Autonomous mode.

Overrides:
getAutoMode in class AlienClass1Reader
Returns:
the ON/OFF status of AutoMode
See Also:
setAutoMode(int), AlienClass1Reader.resetAutoMode()

setAutoMode

public void setAutoMode(int autoMode)
Sets the ON/OFF status of Autonomous mode.

In the interests of future compatibility, you should use AlienClass1Reader.ON and AlienClass1Reader.OFF constants to set and test this parameter.

Overrides:
setAutoMode in class AlienClass1Reader
Parameters:
autoMode - the new ON/OFF status of AutoMode
See Also:
getAutoMode(), AlienClass1Reader.resetAutoMode()

autoModeReset

public void autoModeReset()
Reset all autonomous mode values to their default states, including turning autonomous mode off.

Overrides:
autoModeReset in class AlienClass1Reader
See Also:
getAutoMode(), setAutoMode(int)

getAcquireMode

public java.lang.String getAcquireMode()
Returns the method that the reader uses to scan for tags. May be "Inventory" or "Global Scroll".

Overrides:
getAcquireMode in class AlienClass1Reader
Returns:
the method this reader uses to read tags
See Also:
setAcquireMode(String)

setAcquireMode

public void setAcquireMode(java.lang.String acquireMode)
Specifies the method the reader uses to scan for tags. Whenever the reader is called upon to read a tag, it does so using the current AcquireMode. Currently the allowable modes are as follows: The default setting is Inventory. For the sake of future compatibility, it is suggested you use AlienClass1Reader.INVENTORY and AlienClass1Reader.GLOBAL_SCROLL to specify and test for this parameter.

Inventory
The Inventory acquire mode performs a full anti-collision search on tags in the reader's field of view. This method will locate and distinguish multiple tags in front of the reader at the same time.

Global Scroll
The Global Scroll acquire mode instructs the reader to read a single tag repeatedly. This is a very fast tag reading method which is most effective when only one tag at a time is expected to be within reader range, as in conveyor belt applications. Under such circumstances, the performance for single tag reading is considerably faster than repeatedly doing a full tag search using the Inventory mode.

NOTE: If multiple tags are in range of the reader when Global Scroll is used, the reader will either select one of the tags (usually the "strongest" or "loudest") to read and report it, or will read none of the tags.

Overrides:
setAcquireMode in class AlienClass1Reader
Parameters:
acquireMode - the method this reader uses to read tags
See Also:
getAcquireMode()

getAcquireG2Cycles

public int getAcquireG2Cycles()
Returns the number of complete acquire cycles to perform with each G2 read operation.

Overrides:
getAcquireG2Cycles in class AlienClass1Reader
Returns:
the number of complete acquire cycles to perform with each G2 read operation
See Also:
setAcquireG2Cycles(int)

setAcquireG2Cycles

public void setAcquireG2Cycles(int acquireG2Cycles)
Specifies the number of complete acquire cycles to perform with each G2 read operation.

Overrides:
setAcquireG2Cycles in class AlienClass1Reader
Parameters:
acquireG2Cycles - the number of complete acquire cycles to perform with each G2 read operation
See Also:
getAcquireG2Cycles()

getAcquireG2Count

public int getAcquireG2Count()
Returns the number of reads to perform in each G2 acquire cycle.

Overrides:
getAcquireG2Count in class AlienClass1Reader
Returns:
the number of reads to perform in each G2 acquire cycle
See Also:
setAcquireG2Count(int)

setAcquireG2Count

public void setAcquireG2Count(int acquireG2Count)
Specifies the number of reads to perform in each G2 acquire cycle.

Overrides:
setAcquireG2Count in class AlienClass1Reader
Parameters:
acquireG2Count - the number of reads to perform in each G2 acquire cycle
See Also:
getAcquireG2Count()

getAcquireG2Q

public int getAcquireG2Q()
Returns the starting Q value for each G2 acquire cycle.

Overrides:
getAcquireG2Q in class AlienClass1Reader
Returns:
the starting Q value for each G2 acquire cycle
See Also:
setAcquireG2Q(int)

setAcquireG2Q

public void setAcquireG2Q(int acquireG2Q)
Specifies the starting Q value for each G2 acquire cycle.

Overrides:
setAcquireG2Q in class AlienClass1Reader
Parameters:
acquireG2Q - the starting Q value for each G2 acquire cycle
See Also:
getAcquireG2Q()

getAcquireC1Cycles

public int getAcquireC1Cycles()
Returns the number of complete acquire cycles to perform with each C1 read operation.

Overrides:
getAcquireC1Cycles in class AlienClass1Reader
Returns:
the number of complete acquire cycles to perform with each C1 read operation
See Also:
setAcquireC1Cycles(int)

getAcquireCycles

public int getAcquireCycles()
Description copied from class: AlienClass1Reader
Returns the number of complete acquire cycles to perform with each Class1 Gen1 read operation.

Overrides:
getAcquireCycles in class AlienClass1Reader
Returns:
the number of complete acquire cycles to perform with each Class1 Gen1 read operation
See Also:
AlienClass1Reader.setAcquireCycles(int)

setAcquireC1Cycles

public void setAcquireC1Cycles(int acquireC1Cycles)
Specifies the number of complete acquire cycles to perform with each C1 read operation.

Overrides:
setAcquireC1Cycles in class AlienClass1Reader
Parameters:
acquireC1Cycles - the number of complete acquire cycles to perform with each C1 read operation
See Also:
getAcquireC1Cycles()

setAcquireCycles

public void setAcquireCycles(int acquireC1Cycles)
Description copied from class: AlienClass1Reader
Specifies the number of complete acquire cycles to perform with each Class1 Gen1 read operation.

Overrides:
setAcquireCycles in class AlienClass1Reader
Parameters:
acquireC1Cycles - the number of complete acquire cycles to perform with each Class1 Gen1 read operation
See Also:
AlienClass1Reader.getAcquireCycles()

getAcquireC1Count

public int getAcquireC1Count()
Returns the number of reads to perform in each C1 acquire cycle.

Overrides:
getAcquireC1Count in class AlienClass1Reader
Returns:
the number of reads to perform in each C1 acquire cycle
See Also:
setAcquireC1Count(int)

getAcquireCount

public int getAcquireCount()
Description copied from class: AlienClass1Reader
Returns the number of reads to perform in each Class1 Gen1 acquire cycle.

Overrides:
getAcquireCount in class AlienClass1Reader
Returns:
the number of reads to perform in each Class1 Gen1 acquire cycle
See Also:
AlienClass1Reader.setAcquireCount(int)

setAcquireC1Count

public void setAcquireC1Count(int acquireC1Count)
Specifies the number of reads to perform in each C1 acquire cycle.

Overrides:
setAcquireC1Count in class AlienClass1Reader
Parameters:
acquireC1Count - the number of reads to perform in each C1 acquire cycle
See Also:
getAcquireC1Count()

setAcquireCount

public void setAcquireCount(int acquireC1Count)
Description copied from class: AlienClass1Reader
Specifies the number of reads to perform in each Class1 Gen1 acquire cycle.

Overrides:
setAcquireCount in class AlienClass1Reader
Parameters:
acquireC1Count - the number of reads to perform in each Class1 Gen1 acquire cycle
See Also:
AlienClass1Reader.getAcquireCount()

getAcquireC1EnterWakeCount

public int getAcquireC1EnterWakeCount()
Returns the number of wakes to perform at the start of each C1 acquire cycle.

Overrides:
getAcquireC1EnterWakeCount in class AlienClass1Reader
Returns:
the number of wakes to perform at the start of each C1 acquire cycle
See Also:
setAcquireC1EnterWakeCount(int)

getAcquireEnterWakeCount

public int getAcquireEnterWakeCount()
Description copied from class: AlienClass1Reader
Returns the number of wakes to perform at the start of each Class1 Gen1 acquire cycle.

Overrides:
getAcquireEnterWakeCount in class AlienClass1Reader
Returns:
the number of wakes to perform at the start of each Class1 Gen1 acquire cycle
See Also:
AlienClass1Reader.setAcquireEnterWakeCount(int)

setAcquireC1EnterWakeCount

public void setAcquireC1EnterWakeCount(int acquireC1EnterWakeCount)
Specifies the number of wakes to perform at the start of each C1 acquire cycle.

Overrides:
setAcquireC1EnterWakeCount in class AlienClass1Reader
Parameters:
acquireC1EnterWakeCount - the number of wakes to perform at the start of each C1 acquire cycle
See Also:
getAcquireC1EnterWakeCount()

setAcquireEnterWakeCount

public void setAcquireEnterWakeCount(int acquireC1EnterWakeCount)
Description copied from class: AlienClass1Reader
Specifies the number of wakes to perform at the start of each Class1 Gen1 acquire cycle.

Overrides:
setAcquireEnterWakeCount in class AlienClass1Reader
Parameters:
acquireC1EnterWakeCount - the number of wakes to perform at the start of each Class1 Gen1 acquire cycle
See Also:
AlienClass1Reader.getAcquireEnterWakeCount()

getAcquireC1ExitWakeCount

public int getAcquireC1ExitWakeCount()
Returns the number of wakes to perform at the end of each C1 acquire cycle.

Overrides:
getAcquireC1ExitWakeCount in class AlienClass1Reader
Returns:
the number of wakes to perform at the end of each C1 acquire cycle
See Also:
setAcquireC1ExitWakeCount(int)

getAcquireExitWakeCount

public int getAcquireExitWakeCount()
Description copied from class: AlienClass1Reader
Returns the number of wakes to perform at the end of all the Class1 Gen1 acquire cycles.

Overrides:
getAcquireExitWakeCount in class AlienClass1Reader
Returns:
the number of wakes to perform at the end of all the Class1 Gen1 acquire cycles
See Also:
AlienClass1Reader.setAcquireExitWakeCount(int)

setAcquireC1ExitWakeCount

public void setAcquireC1ExitWakeCount(int acquireC1ExitWakeCount)
Specifies the number of wakes to perform at the end each C1 acquire cycle.

Overrides:
setAcquireC1ExitWakeCount in class AlienClass1Reader
Parameters:
acquireC1ExitWakeCount - the number of wakes to perform at the end of each C1 acquire cycle
See Also:
getAcquireC1ExitWakeCount()

setAcquireExitWakeCount

public void setAcquireExitWakeCount(int acquireC1ExitWakeCount)
Description copied from class: AlienClass1Reader
Specifies the number of wakes to perform at the end all the Class1 Gen1 acquire cycles.

Overrides:
setAcquireExitWakeCount in class AlienClass1Reader
Parameters:
acquireC1ExitWakeCount - the number of wakes to perform at the end of all the Class1 Gen1 acquire cycles
See Also:
AlienClass1Reader.getAcquireExitWakeCount()

getAcquireC1SleepCount

public int getAcquireC1SleepCount()
Returns the number of sleeps to perform after each C1 acquire cycle.

Overrides:
getAcquireC1SleepCount in class AlienClass1Reader
Returns:
the number of sleeps to perform after each C1 acquire cycle
See Also:
setAcquireC1SleepCount(int)

getAcquireSleepCount

public int getAcquireSleepCount()
Description copied from class: AlienClass1Reader
Returns the number of sleeps to perform after each Class1 Gen1 acquire cycle.

Overrides:
getAcquireSleepCount in class AlienClass1Reader
Returns:
the number of sleeps to perform after each Class1 Gen1 acquire cycle
See Also:
AlienClass1Reader.setAcquireSleepCount(int)

setAcquireC1SleepCount

public void setAcquireC1SleepCount(int acquireC1SleepCount)
Specifies the number of sleeps to perform during each C1 acquire cycle.

Overrides:
setAcquireC1SleepCount in class AlienClass1Reader
Parameters:
acquireC1SleepCount - the number of sleeps to perform during each C1 acquire cycle
See Also:
getAcquireC1SleepCount()

setAcquireSleepCount

public void setAcquireSleepCount(int acquireC1SleepCount)
Description copied from class: AlienClass1Reader
Specifies the number of sleeps to perform during each Class1 Gen1 acquire cycle.

Overrides:
setAcquireSleepCount in class AlienClass1Reader
Parameters:
acquireC1SleepCount - the number of sleeps to perform during each Class1 Gen1 acquire cycle
See Also:
AlienClass1Reader.getAcquireSleepCount()

getReaderName

public java.lang.String getReaderName()
Returns the reader name. Since Alien OEM readers don't have the concept of a ReaderName built into them, this method simply returns "Alien OEM Reader Module".

Overrides:
getReaderName in class AlienClass1Reader
Returns:
the name of this AlienClassOEMReader
See Also:
AlienClass1Reader.setReaderName(String)

getReaderType

public java.lang.String getReaderType()
Returns the reader type. This string contains a textual type for the reader, the reader model#, and bit describing how many antennas, the EPC tag classes it readers, the frequency, and interface type.

Overrides:
getReaderType in class AlienClass1Reader
Returns:
the type of this AlienClassOEMReader

getReaderVersion

public java.lang.String getReaderVersion()
                                  throws AlienReaderException
Returns the firmware version of this reader, including the ReaderLocale and ReaderType values. The Reader will reply with 5 bytes specifying Reader Localization Code, Reader Type, and Firmware Version Number. This method formats this data to look something like the following:
    ReaderVersion = 00.00.88
    ReaderLocale = 01
    ReaderType = 04
 
These values are not ASCII encoded but rather numeric hexadecimal values. The firmware version is compiled into the firmware load file. The localization code and the reader type are stored in non-volatile memory by a protected command as part of the manufacturing.

Overrides:
getReaderVersion in class AlienClass1Reader
Returns:
a String representation of this reader's firmware version
Throws:
AlienReaderException - if reader communication fails

setReaderNumber

public void setReaderNumber(int readerNumber)
                     throws AlienReaderException
Changes the ReaderNumber parameter of this reader. ReaderNumber must be between 1 and 255. The value is stored in non-volatile memory in response to this command. The factory default reader number is 255 (0xFF).

Overrides:
setReaderNumber in class AlienClass1Reader
Parameters:
readerNumber - the new number for this reader
Throws:
AlienReaderException - if reader communication fails
See Also:
getReaderNumber()

getReaderNumber

public int getReaderNumber()
                    throws AlienReaderException
Returns the ReaderNumber stored in this reader. This value is a single byte, and can have values between 1 and 255. 0 is a reserved value, because when you send a command to a reader, you specify the ReaderNumber of the reader you intend to send the command to. Specifying 0 means "all readers".

The factory default reader number is 0xFF (255).

Overrides:
getReaderNumber in class AlienClass1Reader
Returns:
the ReaderNumber of this reader
Throws:
AlienReaderException - if reader communication fails
See Also:
setReaderNumber(int)

getBaudRate

public int getBaudRate()
                throws AlienReaderConnectionException
Returns the reader's serial communication baud rate. Allowable values are:
    19200
    38400
    57600
   115200
   230400
If the reader's baud rate is undetermined, this throws an AlienReaderConnectionException;

Returns:
the reader's serial baud rate
Throws:
AlienReaderConnectionException - if the baud rate cannot be determined

setBaudRate

public void setBaudRate(int baudRate)
                 throws AlienReaderException
Sets the reader's serial communication baud rate to the value specified. Allowable values are:
    19200
    38400
    57600
   115200
   230400
Any other values will be ignored.

Parameters:
baudRate - the new baud rate
Throws:
AlienReaderException - if reader communication fails

resetBaudRate

public int resetBaudRate()
                  throws AlienReaderConnectionException
Attempts to set the serial communication baud rate of this reader to 115,200. Returns the original serial baud rate, and also throws an AlienReaderCommunicationException if the attempt fails.

Returns:
the origial serial baud rate
Throws:
AlienReaderConnectionException - if the attempt fails

reboot

public void reboot()
            throws AlienReaderException
Causes the reader module to reboot. This operation can take up to 50 milliseconds.

Throws:
AlienReaderException - if reader communication fails

setIOPortValue

public void setIOPortValue(int portValue)
                    throws AlienReaderException
Sets or clears specified output port pins. The argument is a single int bitmap, from 0 to 255.

Ports start at LSB and are bitmapped toward the MSB. The actual number of available outputs is hardware dependant. Bits in the send data with no corresponding physical port are ignored. If the reader hardware is bi-directional, the value will be ignored in the case of the corresponding port pin defined as input. A bit value of 1 in the send data will cause the corresponding port to tri-state or be set to a logical one depending on hardware. A bit value of 0 will cause the corresponding port pin to be pulled low.

Parameters:
portValue - the bitmap representing the desired output port state
Throws:
AlienReaderException - if reader communication fails
See Also:
getIOPortValue(), getGeneralPurposeInputs(), getGeneralPurposeOutputs(), getBidirectionalDDR(), setBidirectionalDDR(int), getBidirectionalIOPorts()

getIOPortValue

public int getIOPortValue()
                   throws AlienReaderException
Returns the current state of the input/output port pins. The value is a bitmap with the LSB corresponding to physical port 0. The reader will return a 0 bit value for any port that is not supported by hardware. If a reader has bi-directional port pins, any port defined as an output will return a 0 in that bit position.

Returns:
the bitmap representing the state of the I/O ports
Throws:
AlienReaderException - if reader communication fails
See Also:
setIOPortValue(int), getGeneralPurposeInputs(), getGeneralPurposeOutputs(), getBidirectionalDDR(), setBidirectionalDDR(int), getBidirectionalIOPorts()

getExternalInput

public int getExternalInput()
                     throws AlienReaderException
Returns the decimal representation of the state of the external inputs.

The command returns a single byte result that represents the bit mask settings of the external input pins. Bit 0 represents the state of pin 0, Bit 1 represents the state of pin 1, etc. For example, if pin 1 is high and pin 0 is low, the bit mask would be 10binary which translates to 2decimal.

Overrides:
getExternalInput in class AlienClass1Reader
Returns:
the decimal representation of the state of the external inputs
Throws:
AlienReaderException - if reader communication fails

setExternalOutput

public void setExternalOutput(int value)
                       throws AlienReaderException
Changes the state of the reader's external output pins.

With this command you can set the external output pin values. The command takes a single integer parameter that represents the bit mask settings of the external pins.

Bit 0 represents the state of pin 0, and Bit 1 represents the state of pin 1, etc. For example, to set pin 1 to high and all other pins low, use the bit mask of 10binary which translates to 2decimal.

Overrides:
setExternalOutput in class AlienClass1Reader
Parameters:
value - the decimal representation of the desired state of the external outputs
Throws:
AlienReaderException - if reader communication fails
See Also:
AlienClass1Reader.getExternalOutput()

setActiveAntenna

public void setActiveAntenna(int antennaNumber)
                      throws AlienReaderException
Sets the active antenna to the specified value. Antennas are numbered 0 through N, where N is hardware dependent. If a non-supported antenna number is requested, the response packet indicates "unknown value" and no antenna set operation is performed.

Parameters:
antennaNumber - the number of the antenna to use
Throws:
AlienReaderException - if reader communication fails
See Also:
getActiveAntenna(), setAntennaSequence(String), setAntennaSequence(int[]), getAntennaSequence()

getActiveAntenna

public int getActiveAntenna()
                     throws AlienReaderException
Returns the number of the active antenna. The result is between 0 and N, where N is the hardware-dependant maximum antenna number.

Returns:
the number of the active antenna
Throws:
AlienReaderException - if reader communication fails
See Also:
setActiveAntenna(int), setAntennaSequence(String), setAntennaSequence(int[]), getAntennaSequence()

setProgAntenna

public void setProgAntenna(int antennaNumber)
                    throws AlienReaderException
Sets the programming antenna to the specified value. The programming antenna is the same as the "active" antenna.

Antennas are numbered 0 through N, where N is hardware dependent. If a non-supported antenna number is requested, the response packet indicates "unknown value" and no antenna set operation is performed.

Overrides:
setProgAntenna in class AlienClass1Reader
Parameters:
antennaNumber - the number of the antenna to program on
Throws:
AlienReaderException - if reader communication fails
See Also:
getProgAntenna()

getProgAntenna

public int getProgAntenna()
                   throws AlienReaderException
Returns the number of the programming antenna. The programming antenna is the same as the "active" antenna. The result is between 0 and N, where N is the hardware-dependant maximum antenna number.

Overrides:
getProgAntenna in class AlienClass1Reader
Returns:
the number of the programming antenna
Throws:
AlienReaderException - if reader communication fails
See Also:
setProgAntenna(int)

setRFAttenuation

public void setRFAttenuation(int attenuationValue)
                      throws AlienReaderException
Sets the RF power attenuation to the value associated with argument provided. The reader sets the RF power level equal to the maximum RF power less the attenuation value specified by this command. The value is stored in non-volatile memory. The maximum RF power is obtained using the getMaxRFPower command.

Overrides:
setRFAttenuation in class AlienClass1Reader
Parameters:
attenuationValue - the new RF attenuation
Throws:
AlienReaderException - if reader communication fails
See Also:
getRFAttenuation()

getRFAttenuation

public int getRFAttenuation()
                     throws AlienReaderException
Returns the RF power attenuation value from non-volatile memory.

Overrides:
getRFAttenuation in class AlienClass1Reader
Returns:
the RF attenuation value
Throws:
AlienReaderException - if reader communication fails
See Also:
setRFAttenuation(int)

getProgramEnableMode

public int getProgramEnableMode()
                         throws AlienReaderException
Returns a bitmap specifying which program functions are enabled for this reader.
    Bit 0 = Program enabled
    Bit 1 = Erase enabled
    Bit 2 = Lock enabled
    Bit 3 = Kill enabled
 

Returns:
a bitmap detailing which program functions are enabled
Throws:
AlienReaderException - if reader communication fails

getGeneralPurposeOutputs

public int getGeneralPurposeOutputs()
                             throws AlienReaderException
Returns a bitmap specifying which of the I/O ports have been configured to be General Purpose Outputs.

Returns:
bitmap showing which I/O ports are outputs
Throws:
AlienReaderException - if reader communication fails
See Also:
getGeneralPurposeInputs(), getBidirectionalIOPorts()

getGeneralPurposeInputs

public int getGeneralPurposeInputs()
                            throws AlienReaderException
Returns a bitmap specifying which of the I/O ports have been configured to be General Purpose Inputs.

Returns:
bitmap showing which I/O ports are inputs
Throws:
AlienReaderException - if reader communication fails
See Also:
getGeneralPurposeOutputs(), getBidirectionalIOPorts()

getBidirectionalIOPorts

public int getBidirectionalIOPorts()
                            throws AlienReaderException
Returns a bitmap specifying which of the I/O ports have been configured to be Bidirectional inputs/outputs. To determine if these bidirectional I/O ports are inputs or outputs, use the getBidirectionalDDR() method. To change the input/output status of these bidirectional I/O ports, use the setBidirectionalDDR(int) method.

Returns:
bitmap showing which I/O ports are bidirectional
Throws:
AlienReaderException - if reader communication fails
See Also:
getBidirectionalDDR(), setBidirectionalDDR(int)

getMaxHopTableIndex

public int getMaxHopTableIndex()
                        throws AlienReaderException
Returns the maximum allowable Hop Channel that is used in the hopping table.

Returns:
the maximum hop channel index
Throws:
AlienReaderException - if reader communication fails

getHardwareReaderType

public int getHardwareReaderType()
                          throws AlienReaderException
Returns this reader's Reader Type. The following codes are used:
    0x00 - Unspecified
    0x01 - ALR-9750
    0x02 - ALR-9930
    0x03 - ALR-9780
    0x04 - ALR-9930-A
 

Returns:
this reader's type code
Throws:
AlienReaderException - if reader communication fails
See Also:
getReaderVersion()

getLocalizationCode

public int getLocalizationCode()
                        throws AlienReaderException
Returns this reader's Localization Code. The following codes are used:
    0x00 - Unspecified
    0x01 - USA
    0x02 - Japan
    0x03 - Europe
 

Returns:
this reader's localization code
Throws:
AlienReaderException - if reader communication fails
See Also:
getReaderVersion()

getRadioType

public int getRadioType()
                 throws AlienReaderException
Returns the type of RF radio in this reader. The result is a one-byte numeric value. The upper nibble defines the maximum antenna address, which is equal to one less than the number of antennas:
 Upper nibble:
    1 antenna  = 0x0X
    4 antennas = 0x3X
   16 antennas = 0xFX
 
The lower nibble defines the frequency band:
 Lower nibble:
    868 MHz = 0xX1
    915 MHz = 0xX2
    950 MHz = 0xX3
   2450 MHz = 0xX4
 
For example, a 4-antenna 915 MHz reader reports a Radio Type of 0x32.

Returns:
this reader's radio type code
Throws:
AlienReaderException - if reader communication fails

getMinFrequency

public int getMinFrequency()
                    throws AlienReaderException
Returns the minimum RF frequency that this reader may be set to. The result is given in units of 100 kHz. For example, a reader who's minimum frequency is 902 MHz would report a MinFrequency value of 9020.

Returns:
the minimum RF frequency, in 100's of kHz
Throws:
AlienReaderException - if reader communication fails
See Also:
getMaxFrequency()

getMaxFrequency

public int getMaxFrequency()
                    throws AlienReaderException
Returns the maximum RF frequency that this reader may be set to. The result is given in units of 100 kHz. For example, a reader who's maximum frequency is 924.6 MHz would report a MinFrequency value of 9246.

Returns:
the maximum RF frequency, in 100's of kHz
Throws:
AlienReaderException - if reader communication fails
See Also:
getMinFrequency()

getHopStepSize

public int getHopStepSize()
                   throws AlienReaderException
Returns the frequency spacing of this reader's hop table. The units are in 10kHz, so a reader who's frequency spacing is 400 kHz would report a HopStepSize of 40.

Returns:
the frequency spacing, in 10's of kHz
Throws:
AlienReaderException - if reader communication fails
See Also:
getHopInterval()

getPLLType

public int getPLLType()
               throws AlienReaderException
Returns the type of PLL installed in this reader. The following codes are used:
    0x00 - Unspecified
    0x01 - Varil PLL400-915
    0x02 - Varil PLL400-864
 

Returns:
the PLL type code of this reader
Throws:
AlienReaderException - if reader communication fails

getMaxRFChannel

public int getMaxRFChannel()
                    throws AlienReaderException
Returns the maximum RF channel used in this reader.

Returns:
the max RF channel
Throws:
AlienReaderException - if reader communication fails
See Also:
getRFChannel()

getMaxRFPower

public int getMaxRFPower()
                  throws AlienReaderException
Returns the maximum RF power available with this reader hardware. The result has units of tenths of a dBm. For example, a reader whose maximum power is 30 dBm would return a value of 300.

Returns:
the maximum RF power, in tenths of a dBm
Throws:
AlienReaderException - if reader communication fails

getAvailableBaudRates

public int getAvailableBaudRates()
                          throws AlienReaderException
Returns a bitmap denoting the available baud rates for this reader. A 1 in a bit position indicates the referenced baud rate is available.
 Baud Rate Bitmap:
    bit 0 - 19,200
    bit 1 - 38,400
    bit 2 - 57,600
    bit 3 - 76,800
    bit 4 - 115,200
    bit 5 - 230,400
    bit 6 - 460,800
    bit 7 - unused
 

Returns:
a bitmap denoting available baud rates
Throws:
AlienReaderException - if reader communication fails

getSupportedTagTypes

public int getSupportedTagTypes()
                         throws AlienReaderException
Returns the bitmap indicating which Alien RFID tag types the reader should look for. There are currently three types of Alien RFID tags: "Quark", "Omega", and "Lepton". By asking the reader to ignore certain tag types, the reader can, under some circumstances, acquire tags at a higher speed.

This is primarily due to the fact that "Lepton" tags have longer id spaces (128 bits) than "Quark" and "Omega" tags (96 bits). If the reader is looking only for Leptons, or only for Quarks and Omegas, it knows beforehand how many bits of ID to expect from a tag, and can therefore operate more quickly.

The value returned is a bit map, where each bit enables a certain tag type:

    Bit 0 : Class 1, Gen 1 (64-bits) "Quark"
    Bit 1 : Class 1, Gen 2 (64-bits) "Omega"
    Bit 2 : Class 1, Gen 2 (96-bits) "Lepton"
    Bit 3 : reserved (if C0 is supported)
    Bit 4 : Class 1, Gen 2
    Bit 5 : reserved
    Bit 6 : reserved
    Bit 7 : reserved
 
So, a TagType of 3 ("011" decimal) indicates that the reader is looking only for Quark and Omega tag types. Similarly, a TagType of 7 indicates it is looking for all tag types, and a TagType of 4 indicates it is only looking for Lepton tags.

Returns:
the bitmap indicating the tag types the reader is looking for
Throws:
AlienReaderException - if reader communication fails
See Also:
setSupportedTagTypes(int)

setSupportedTagTypes

public void setSupportedTagTypes(int tagType)
                          throws AlienReaderException
Sets the bitmap indicating which Alien RFID tag types the reader should look for. There are currently three types of Alien RFID tags: "Quark", "Omega", and "Lepton". By asking the reader to ignore certain tag types, the reader can, under some circumstances, acquire tags at a higher speed.

This is primarily due to the fact that "Lepton" tags have longer id spaces (128 bits) than "Quark" and "Omega" tags (96 bits). If the reader is looking only for Leptons, or only for Quarks and Omegas, it knows beforehand how many bits of ID to expect from a tag, and can therefore operate more quickly.

The value returned is a bit map, where each bit enables a certain tag type:

    Bit 0 : Class 1, Gen 1 (64-bits) "Quark"
    Bit 1 : Class 1, Gen 2 (64-bits) "Omega"
    Bit 2 : Class 1, Gen 2 (96-bits) "Lepton"
    Bit 3 : reserved (if C0 is supported)
    Bit 4 : Class 1, Gen 2
    Bit 5 : reserved
    Bit 6 : reserved
    Bit 7 : reserved
 
So, to have the reader look only for Quark and Omega tag types, use a TagType of 3 ("011" decimal). Similarly, use a TagType of 7 to specify looking for all tag types, and a TagType of 4 to specify Lepton tags only.

Parameters:
tagType - the bitmap indicating the tag types the reader should look for
Throws:
AlienReaderException - if reader communication fails
See Also:
getSupportedTagTypes()

getHopInterval

public int getHopInterval()
                   throws AlienReaderException
Returns the length of time the reader dwells at each frequency before hopping to the next one. The value returned is in units of mSec.

Returns:
the time interval between frequency hops
Throws:
AlienReaderException - if reader communication fails
See Also:
getHopStepSize()

getRFChannel

public int getRFChannel()
                 throws AlienReaderException
Returns the RF channel currently being used by this reader.

Returns:
the RF channel number current being used
Throws:
AlienReaderException - if reader communication fails
See Also:
getMaxRFChannel()

getMaxAntenna

public int getMaxAntenna()
                  throws AlienReaderException
Returns the maximum antenna number that may be addressed by this reader. The number of antennas is equal to this value + 1, since antenna ports are numbered starting at zero.

Overrides:
getMaxAntenna in class AlienClass1Reader
Returns:
the maximum antenna number
Throws:
AlienReaderException - if reader communication fails

getReaderSerialNumber

public java.lang.String getReaderSerialNumber()
                                       throws AlienReaderException
Throws:
AlienReaderException

manageReserved

public java.lang.String manageReserved(java.lang.String reservedCommand)
                                throws AlienReaderException
Enables one of the "Manage Reserved" DLE-based command sequences to be sent to the reader. The reservedCommand argument is a string of hex bytes. The first byte is the Manage Reserved Parameters subcommand, followed by additional bytes which may be required for each subcommand.

Parameters:
reservedCommand - a string of hex bytes, including subcommand and data bytes
Returns:
reader response, as a string of hex bytes
Throws:
AlienReaderException - if reader communication fails

setMask

public void setMask(int bitLength,
                    int bitPointer,
                    java.lang.String tagMaskBytes)
             throws AlienReaderException
Set the Tag Mask, using a length, pointer, and string of hex bytes as parameters. This mask will be used in all maskable tag transactions which follow this command until a new mask is set. The bitLength parameter is the number of bits compared, bitPointer is the bit position in the ID to start comparing, and tagMaskBytes is a string of hex bytes containing the data to be compared against.
    setTagMask(32, 0, "A1 03")
    matches only tags where the first 32 bits match the hex value 0xA103
 
The number of tagMaskBytes should equal (bitLength + 7) / 8. All compares start with earliest ID bit modulated and compare towards last bit modulated. The mask is evaluated MSB first. The mask is stored in volatile memory (not retained when the reader is rebooted), and is initialized with a bitLength of zero, which indicates all tags are selected. bitPointer and tagMaskBytes are only used when bitLength is non-zero.

Overrides:
setMask in class AlienClass1Reader
Parameters:
bitLength - the number of bits in the tag mask
bitPointer - the pointer into the TagID to compare with the mask
tagMaskBytes - a string of hex bytes defining the mask value
Throws:
AlienReaderException - if reader communication fails
See Also:
setTagMask(String), getMask()

setMask

public void setMask(java.lang.String maskString)
             throws AlienReaderException
Sets the Tag Mask, as a String. Masks are important in both addressing tags and interrogating them. For a detailed description of Masks, please refer to the Reader Interface Guide.

This version of setMask takes one String argument, consisting of three comma separated values:

Note: Setting the mask to "All" will address all tags currently in the RF field.

Overrides:
setMask in class AlienClass1Reader
Parameters:
maskString - a string representation of the new mask
Throws:
AlienReaderException - if reader communication fails
See Also:
getMask(), setMask(int, int, String), setTagMask(String)

setTagMask

public void setTagMask(java.lang.String tagID)
                throws AlienReaderException
Sets the reader's tag mask to match the specified Tag ID. The mask can be in the format "XX XX XX XX", or "XXXX XXXX", or "XXXXXXXX", where "X" is one byte. The mask can also be "NULL" or "ALL" for all tags.

Overrides:
setTagMask in class AlienClass1Reader
Parameters:
tagID - the tag ID to mask to for subsequent reads and writes
Throws:
AlienReaderException - if reader communication fails
See Also:
getMask(), setMask(String), setMask(int, int, String)

getMask

public java.lang.String getMask()
                         throws AlienReaderException
Returns the current tag mask. The tag mask is represented as a bitLength, bitPointer, and string of bytes containing the mask data. This method returns these tag mask values as a comma-separated string. For example:
    64, 0, 11 22 33 44 55 66 77 88
    indicates a tag mask that is 64 bits long, starts at the first tagID bit
    and matches against the hex bytes 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88.
 

Overrides:
getMask in class AlienClass1Reader
Returns:
the tag mask formatted as a comma-separated string
Throws:
AlienReaderException - if reader communication fails
See Also:
setTagMask(String), setMask(int, int, String)

setG2Mask

public void setG2Mask(int bitLength,
                      int bitPointer,
                      java.lang.String tagMaskBytes)
               throws AlienReaderException
Throws:
AlienReaderException

setG2TagMask

public void setG2TagMask(java.lang.String tagID)
                  throws AlienReaderException
Description copied from class: AlienClass1Reader
Sets the reader's Class1/Gen2 tag mask to match the specified EPC. The mask can be in the format "XX XX XX XX...", or "XXXX XXXX...", or "XXXXXXXX...", where "X" is one byte. The mask can also be null or "0" for all tags.

Overrides:
setG2TagMask in class AlienClass1Reader
Parameters:
tagID - the EPC to mask to for subsequent reads and writes
Throws:
AlienReaderException - if reader communication fails
See Also:
AlienClass1Reader.getAcqG2Mask(), AlienClass1Reader.setAcqG2Mask(String), AlienClass1Reader.setAcqG2Mask(int, int, int, String), AlienClass1Reader.setG2MaskBits(int, String)

setBidirectionalDDR

public void setBidirectionalDDR(int bitmap)
                         throws AlienReaderException
Sets the input/output direction of Bi-Directional I/O ports. This command takes a byte-wide bitmap that defines Bi-Directional I/O ports as inputs or outputs. A one in a bit position defines the I/O as an input. A zero value defines it as output. The physical port is mapped against the bitmap starting at the LSB. Bits in the bitmap that do correspond to physical ports are ignored.

Parameters:
bitmap - the bitmap defining I/O state of bi-directional I/O ports
Throws:
AlienReaderException - if reader communication fails
See Also:
getBidirectionalDDR(), getBidirectionalIOPorts()

getBidirectionalDDR

public int getBidirectionalDDR()
                        throws AlienReaderException
Returns a bitmap defining the direction of the Bi-Directional I/O ports. A one in a bit position indicates that I/O is an input, while a zero indicates an output. The physical I/O port is mapped against the bitmap starting at the LSB.

Returns:
a bitmap indicating the input/ouput state of the bi-directional I/Os
Throws:
AlienReaderException - if reader communication fails
See Also:
setBidirectionalDDR(int), getBidirectionalIOPorts()

setRFOnOff

public void setRFOnOff(int powerOnOff)
                throws AlienReaderException
Turns the RF carrier on or off while idle (not reading tags). If a command is given to a reader to perform a tag read, it will automatically turn on RF for the duration of the acquisition. The reader will then restore the state of the RF carrier to what it was previous to starting the acquisition.

When performing multiple commands on a tag, it is more efficient if the carrier is not turned off between commands. It is therefore advisable to turn RF on explicitly before issuing multiple commands, then turn RF off explicitly after the commands have finished.

In the interests of future compatibility, you should use AlienClass1Reader.ON and AlienClass1Reader.OFF constants to set and test this parameter.

Parameters:
powerOnOff - the new idle ON/OFF state of the RF carrier
Throws:
AlienReaderException - if reader communication fails
See Also:
getRFOnOff()

getRFOnOff

public int getRFOnOff()
               throws AlienReaderException
Returns the current state of the RF power while the reader is idle.

Returns:
the current idle ON/OFF state of the RF carrier
Throws:
AlienReaderException - if reader communication fails
See Also:
setRFOnOff(int)

setAntennaSequence

public void setAntennaSequence(int[] antennaSequenceBytes)
                        throws AlienReaderException
Sets the sequence of antenna ports, using an array of ints, that is used by the reader when responding to an Inventory command. The Antenna Sequence can be up to eight bytes long, and each byte in the array is examined sequentially during the Inventory command. If the array element indexes a valid antenna number between 0 and N (N being hardware dependant) the inventory is executed from this antenna port. If the value of the array is 0xFF, the inventory is not executed. Each time the Inventory command is carried out, all 8 elements are examined. Attempting to load an array element with a number larger than N (but not 0xFF) will result in an error condition.

It should be noted that any array element can be set to any valid antenna number, thus allowing the sequence of antennas to be executed in any order, and the same antenna can be used multiple times in response to one Inventory command. The default values for the array are 0 in the first array element and 0xFF is the other seven.

Parameters:
antennaSequenceBytes - an array listing the sequence of antennas to use
Throws:
AlienReaderException - if reader communication fails
See Also:
setAntennaSequence(String), getAntennaSequence()

setAntennaSequence

public void setAntennaSequence(java.lang.String sequenceString)
                        throws AlienReaderException
Sets the sequence of antenna ports, using a comma-separated String of integer values, that is used by the reader when responding to an Inventory command. The Antenna Sequence can be up to eight values long, and each value is examined sequentially during the Inventory command. If the antenna value indexes a valid antenna number between 0 and N (N being hardware dependant) the inventory is executed from this antenna port. If the antenna value is 0xFF, the inventory is not executed. Each time the Inventory command is carried out, all 8 elements are examined. Attempting to load an array element with a number larger than N (but not 0xFF) will result in an error condition.

It should be noted that any array element can be set to any valid antenna number, thus allowing the sequence of antennas to be executed in any order, and the same antenna can be used multiple times in response to one Inventory command. The default values for the array are 0 in the first array element and 0xFF is the other seven.

Overrides:
setAntennaSequence in class AlienClass1Reader
Parameters:
sequenceString - a comma-separated list of antenna ports
Throws:
AlienReaderException - if reader communication fails
See Also:
setAntennaSequence(int[]), getAntennaSequence()

getAntennaSequence

public java.lang.String getAntennaSequence()
                                    throws AlienReaderException
Returns the Antenna Sequence, as a comma-separated String of hex values.

Overrides:
getAntennaSequence in class AlienClass1Reader
Returns:
a comma-separated String of antenna values
Throws:
AlienReaderException - if reader communication fails
See Also:
setAntennaSequence(int[]), setAntennaSequence(String)

getAntennaStatus

public int getAntennaStatus()
                     throws AlienReaderException
Returns the Antenna Status. The returned value is a bitmap, where each bit represents a reader antenna. A value of 1 in a bit position indicates an antenna is good.

Returns:
a bitmap showing good antennas
Throws:
AlienReaderException - if reader communication fails

getOperatingVoltage

public int getOperatingVoltage()
                        throws AlienReaderException
Returns the measured voltage level into the OEM Module, given in hundredths of a volt.

Returns:
the actual operating voltage
Throws:
AlienReaderException - if reader communication fails

sleepTag

public void sleepTag()
              throws AlienReaderException
Causes a tag in the field to enter the sleep state. A sleeping tag ignores any commands sent to it except the Wake command. This command is directed by the current Tag Mask setting, allowing all tags to be slept or just a subset.

Throws:
AlienReaderException - if reader communication fails
See Also:
wakeTag()

wakeTag

public void wakeTag()
             throws AlienReaderException
Requests all tags in the field wake up. This command is directed by the current Tag Mask settings, allowing all tags to be awakened or just a subset.

Throws:
AlienReaderException - if reader communication fails
See Also:
sleepTag()

verifyTag

public java.lang.String verifyTag()
                           throws AlienReaderException
Interrogates the state of a tag that may or may not be readable by the Acquire commands. A Verify command will return the complete tag memory WITHOUT validating the tag ID against the checksum. The tag memory returned by the Verify command is not guaranteed to be correct; it may or may not be valid.

A Verify command cannot sort multiple tags; it should only be used on one tag at a time.

Overrides:
verifyTag in class AlienClass1Reader
Returns:
the complete, unverified tag data
Throws:
AlienReaderException - if reader communication fails

doInventory

public Tag[] doInventory()
                  throws AlienReaderException
Performs an Inventory. Inventory is a high level command that forms the basis for tag sorting and collision avoidance/detection. The reader attempts to find and report the IDs of all tags in the RF field.

Two main types of Inventory are supported, and are selected by setting the acquireMode property to AlienClass1Reader.INVENTORY or AlienClass1Reader.GLOBALSCROLL.

    Inventory - Tree based. This will use binary mask selection techniques,
    and optionally sleep/wake commands to attempt to isolate all tags in the
    field in a binary tree method. This technique is best when large numbers
    of tags are expected in the field. This method is the slowest but has the
    strongest collision detection/avoidance algorithm.

    Global Scroll - Scroll N based. This will use the starting mask and
    optionally sleep/wake commands to repeatedly send MASKED SCROLL type
    commands to try to gather the IDs of tags in the field. This technique is
    best used when only one or a small number of tags is expected in the field.
    This technique is faster than the tree based, but depends only on variance
    of tag signal strength for collision detection and avoidance.
 
All four types of inventory are executed within a nested loop. The outer loop, governed by the acquireCycles parameters, executes Wake commands before the actual inventory type is executed. The number of wakes issued is determined by the acquireEnterWakeCount parameter. Note that acquireEnterWakeCount can equal 0, in which case no Wakes will be issued. The inner loop, governed by the acquireCount parameter, determines how many times the specified inventory type will execute without sending Wake commands. As each tag ID is gathered, an optional series of Sleep commands can be issued to this tag. The acquireSleepCount parameter determines how many will be sent, and may equal zero if no Sleep commands are desired.

The antenna list is examined within the looping structure, and each portion of the loop is executed for all valid antenna entries in the list. Therefore the inner and outer loops can be executed up to 8 times the acquireCycles and acquireCount values, dependent on the entries in the antenna list. After the inner and outer loops are executed, a series of Wake commands may be executed to wake any tags that were issued a Sleep command during the inventory process. The number of Wake commands executed is determined by the acquireExitWakeCount parameter. This parameter may be set to zero if no exit wakes are desired.

Returns:
an array of Tags acquired by this inventory command
Throws:
AlienReaderException - if reader communication fails
See Also:
setAcquireMode(String), setAcquireCycles(int), setAcquireEnterWakeCount(int), setAcquireCount(int), setAcquireSleepCount(int), setAcquireExitWakeCount(int), setAntennaSequence(String)

programTag

public void programTag(int numVerifies,
                       int numErases,
                       int numPrograms,
                       java.lang.String tagID)
                throws AlienReaderException
Writes data to the tag ID space. This command takes three loop control parameters, and the ID data as described below. The tagID string may be in the format "X X X X X X X X", "XX XX XX XX", "XXXX XXXX", or "XXXXXXXX", where "X" is one byte.

The reader automatically generates the CRC for the supplied tag ID data and programs it into the first two bytes of ID space. This command does not lock the tag or program a kill code.

Parameters:
numVerifies - the number of times to verify the existence of the tag prior to programming
numErases - the number of times to erase the tag prior to programming
numPrograms - the number of times to try to program the tag
tagID - the string representation of the 8- or 12-byte tag ID to program
Throws:
AlienReaderException - if reader communication fails
See Also:
programTag(String)

programTag

public void programTag(java.lang.String tagID)
                throws AlienReaderException
Writes data to the tag ID space, using default loop-control parameters. This command takes a string with the ID data and otherwise uses default values for the number of verify, erase, and program attempts. The tagID string may be in the format "X X X X X X X X", "XX XX XX XX", "XXXX XXXX", or "XXXXXXXX", where "X" is one byte.

The reader automatically generates the CRC for the supplied tag ID data and programs it into the first two bytes of ID space. This command does not lock the tag or program a lock code.

Overrides:
programTag in class AlienClass1Reader
Parameters:
tagID - the string representation of the 8- or 12-byte tag ID to program
Throws:
AlienReaderException - if reader communication fails
See Also:
programTag(int, int, int, String)

eraseTag

public void eraseTag(int numVerifies,
                     int numErases)
              throws AlienReaderException
Erases the data in the tag's ID space. This command takes two loop control parameters, as described below. A locked or unprogrammed tag cannot be erased.

Parameters:
numVerifies - the number of times to verify the existence of the tag prior to erasing
numErases - the number of times to try to erase the tag
Throws:
AlienReaderException - if reader communication fails
See Also:
eraseTag()

eraseTag

public void eraseTag()
              throws AlienReaderException
Erases the data in the tag's ID space, using default loop-control parameters. A locked or unprogrammed tag cannot be erased.

Overrides:
eraseTag in class AlienClass1Reader
Throws:
AlienReaderException - if reader communication fails
See Also:
eraseTag(int, int)

killTag

public void killTag(int numVerifies,
                    int numKills,
                    java.lang.String tagIDAndPassCode)
             throws AlienReaderException
Kills a tag by erasing the data in a locked tag's ID space. This command takes two loop control parameters, as described below, as well as a string representing the tagID (including PassCode) of the tag to kill. The tagID+PassCode string may be in the format "X X X X X X X X X", "XX XX XX XX X", "XXXX XXXX X", or "XXXXXXXXX", where "X" is one byte. An unlocked or unprogrammed tag cannot be killed.

Parameters:
numVerifies - the number of times to verify the existence of the tag prior to killing
numKills - the number of times to try to kill the tag
tagIDAndPassCode - a string representing the tag's ID, followed by its PassCode
Throws:
AlienReaderException - if reader communication fails
See Also:
killTag(String)

killTag

public void killTag(java.lang.String tagIDAndPassCode)
             throws AlienReaderException
Kills a tag by erasing the data in a locked tag's ID space, using default loop-control parameters. This command takes a string representing the tagID (including PassCode) of the tag to kill. The tagID+PassCode string may be in the format "X X X X X X X X X", "XX XX XX XX X", "XXXX XXXX X", or "XXXXXXXXX", where "X" is one byte. An unlocked or unprogrammed tag cannot be killed.

Overrides:
killTag in class AlienClass1Reader
Parameters:
tagIDAndPassCode - a string representing the tag's ID, followed by its PassCode
Throws:
AlienReaderException - if reader communication fails
See Also:
killTag(int, int, String)

lockTag

public void lockTag(int numVerifies,
                    int numLocks,
                    int tagIDLength,
                    int lockCode)
             throws AlienReaderException
Locks a Tag. This command takes two loop control parameters, as described below, as well as an integer specifying the length of the tag's ID, and an integer LockCode that can be used later to kill the tag. An unprogrammed tag cannot be locked.

Parameters:
numVerifies - the number of times to verify the existence of the tag prior to locking
numLocks - the number of times to try to lock the tag
tagIDLength - the number of bytes in the tag's ID (8 or 12)
lockCode - the byte value used to lock and kill the tag
Throws:
AlienReaderException - if reader communication fails
See Also:
lockTag(int, int), lockTag(String)

lockTag

public void lockTag(int tagIDLength,
                    int lockCode)
             throws AlienReaderException
Locks a Tag, using default loop-control parameters. This command takes an integer specifying the length of the tag's ID, and an integer LockCode that can be used later to kill the tag. An unprogrammed tag cannot be locked.

Parameters:
tagIDLength - the number of bytes in the tag's ID (8 or 12)
lockCode - the byte value used to lock and kill the tag
Throws:
AlienReaderException - if reader communication fails
See Also:
lockTag(int, int, int, int), lockTag(String)

lockTag

public void lockTag(java.lang.String passCode)
             throws AlienReaderException
Locks a Tag, using default loop-control parameters and tagID length. This command takes a string argument specifying the PassCode that can be used later to kill the tag. An unprogrammed tag cannot be locked.

Overrides:
lockTag in class AlienClass1Reader
Parameters:
passCode - a String representing the byte value used to lock and kill the tag
Throws:
AlienReaderException - if reader communication fails
See Also:
lockTag(int, int, int, int), lockTag(int, int)

run

public void run()
Run the automode function for this reader. Autonomous mode is turned on with the setAutoMode() method, and simply acquires tags over and over again, storing tag data in the tagTable. The TagList can be retrived while this reader is in autonomous mode by calling and of the getTag or getTagList methods.

Specified by:
run in interface java.lang.Runnable

getTimer

public java.lang.String getTimer()
Returns the Timer text for the most recent acquire. The timer data is calculated based on data recorded within the getTagList(n) method.

Returns:
the timer data

readerCommandCLI

public java.lang.String readerCommandCLI()
Enables raw DLE-based command sequences to be sent to the reader.

Returns:
the DLE exchange with the reader

rcCLI

public java.lang.String rcCLI()
Enables raw DLE-based command sequences to be sent to the reader.

Returns:
the DLE exchange with the reader

manageReservedCLI

public java.lang.String manageReservedCLI()
Enables one of the "Manage Reserved" DLE-based command sequences to be sent to the reader.

Returns:
the DLE exchange with the reader

sendString

public void sendString(java.lang.String command)
                throws AlienReaderConnectionException
Intercepts a command string intended for the OEM reader, and attempts to handle the command using methods from this class. A response is formulated from the reader's reply and stored in String format in a local field, which is then returned by receiveString() when it is called.

This gives the illusion that the reader is accepting and returning ASCII-based communications.

Furthermore, if the command string is not preceeded by a \1 character (which doReaderCommand() adds automatically, then it is assumed that the command is coming from a command line interface, and appropriate "Alien>" prompts are attached to the response string.

Overrides:
sendString in class AbstractReader
Parameters:
command - the text string to send
Throws:
AlienReaderConnectionException - if communication fails
See Also:
receiveString(boolean)

receiveString

public java.lang.String receiveString(boolean blockForInput)
Returns the response string prepared by the sendString() method, as it if came from a reader sporting an ASCII-based interface. The blockForInput parameter is ignored in this implementation.

Overrides:
receiveString in class AbstractReader
Parameters:
blockForInput - ignored
Returns:
the text string prepared after performing the reader command
See Also:
sendString(String)

sendBytes

public void sendBytes(byte[] bytes)
               throws AlienReaderException
Sends an arbitrary sequence of bytes to the reader. No attempt is made to validate the sequence, or read and return the reader's response. The bytes sent should consititute a complete, packetized reader command, including <DLE><SOM>, messagePayload, <DLE><EOM>. The messagePayload should start with the SessionID and Reader#, followed by the command byte and any required CommandData bytes, followed by two CRC bytes.

Parameters:
bytes - the array of bytes to send to the reader
Throws:
AlienReaderException - if reader communication fails
See Also:
receiveBytes()

receiveBytes

public byte[] receiveBytes()
                    throws AlienReaderException
Receives and entire response message from the reader. If the data received from the reader is not consistent with the DLE-packetization rules, the data is ignored (likely resulting in a timeout exception). This method is inventory-aware, meaning that it is aware that inventory responses comprise more than one complete DLE-packetized message. The returned bytes will be for the entire inventory response.

Returns:
the reader's response the the last command send
Throws:
AlienReaderException - if reader communication fails
See Also:
sendBytes(byte[])

toString

public java.lang.String toString()
Returns a String representation of this reader object (it's ReaderType).

Overrides:
toString in class AlienClass1Reader
Returns:
the reader's type