Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.alien.enterpriseRFID.reader
Class AlienClassBPTReader

    java.lang.Object
      com.alien.enterpriseRFID.reader.AbstractReader
          com.alien.enterpriseRFID.reader.AlienClass1Reader
              com.alien.enterpriseRFID.reader.AlienClassBPTReader

public class AlienClassBPTReader
extends AlienClass1Reader

This class allows the system to interact with an Alien Class BPT (Battery Powered Tag) Reader. The Reader classes are the primary classes for communicating with a reader either over the network or serial port.

The AlienClassBPTReader class extends the AlienClass1Reader class, since BPT readers have the same functionality as the passive readers, with the addition of memory, sensor, and logging functions:

- Memory - The Battery Powered Backscatter tags can optionally support a read-write onboard memory typically in the range of 4K bytes to 16K bytes. The memory commands implemented in this class allow this tag memory to be read and written in discrete blocks via RF communication.
- Sensors - The Battery Powered Backscatter tags can optionally support the use of onboard sensors such as temperature or vibration sensors. The sensor commands can be used to interrogate and control the use of these on-board devices.
- Logging - If a tag is equipped with one or more sensors and on-board memory, they can be instructed to autonomously log data to tag memory even in the absence of an RF field. The logging commands are the interface to this functionality.

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

The discovery commands are the same regardless of the reader type. A discovery item supports one method to turn a discovery object into an Alien reader object:

          public AlienClass1Reader getReader() throws Exception

If the reader is actually a 2450Mhz Battery Powered Reader, the reader object that is instanced will be of the type AlienClassBPTReader, and can be cast into this type, i.e.,

          AlienClass1Reader class1Reader = discoveryItem.getReader();
          if (class1Reader instanceof AlienClassBPTReader) {
            AlienClassBPTReader classBPTReader = (AlienClassBPTReader)class1Reader;
          }

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 Nanoscanner Developers Guide.

Version:
  1.3 Feb 2004
Author:
  Chris Parkinson, David Krull

Field Summary
`static int` | `DEFAULT_TIMEOUT` Specifies the default communication timeout value.
`static short` | `NO_READING` Indicates the lack of valid memory data in the communication from the tag.
`static short` | `NO_WRITING` Indicates the lack of valid memory data in the communication from the tag.

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, TIMEOUTMODE_CHARACTER, TIMEOUTMODE_COMMAND`

Constructor Summary
`AlienClassBPTReader()` Constructs a new AlienClassBPTReader object.

Method Summary
`void` | `clearMemory(java.lang.String tagID)` Completely erases the memory of a specified tag.
`byte[]` | `getLoggingInterval(java.lang.String tagID)` Returns the periodicity at which the tag logs sensor data to tag memory, with timing values returned as a triple byte array.
`short[]` | `getMemory(java.lang.String tagID, int lengthIndex, int startIndex)` Returns a chunk of tag memory from the specified tag.
`int` | `getMemoryPacketSize()` Returns the number of bytes to use in each memory related transmission packet to and from the tag.
`int` | `getSensorValue(java.lang.String tagID)` Returns the sensor value of the tag's onboard sensor.
`Tag` | `getTagID(java.lang.String tagID)` Returns the ID of a unique tag specified by the mask commands.
`java.lang.String` | `getTagInfo(java.lang.String tagID)` Returns information about a single tag being masked.
`boolean` | `isLogging(java.lang.String tagID)` Returns the status of Logging Mode for the specified tag.
`void` | `setLogging(java.lang.String tagID, boolean isLogging)` Enables or disables logging for a specified tag.
`void` | `setLoggingInterval(java.lang.String tagID, byte[] byteArray)` Sets the periodicity at which the tag logs sensor data to tag memory, with timing values specified as a triple byte array.
`void` | `setLoggingInterval(java.lang.String tagID, int hours, int mins, int secs)` Sets the periodicity at which the tag logs sensor data to tag memory, with timing values specified as individual integers.
`boolean` | `setMemory(java.lang.String tagID, int startIndex, byte[] byteArray)` Stores a series of bytes into tag memory.
`void` | `setMemoryPacketSize(int memoryPacketSize)` Specifies the number of bytes to use in each memory related transmission packet to and from the tag.
`java.lang.String` | `toString()` Returns a String representation of this reader object (it's ReaderType).

Methods inherited from class com.alien.enterpriseRFID.reader.AlienClass1Reader
`autoModeReset, autoModeTriggerNow, clearIOList, clearTagList, eraseTag, g2Erase, g2Read, g2Wake, g2Wake, g2Write, getAcqC1Mask, getAcqG2AccessPwd, getAcqG2Mask, getAcqG2MaskAction, getAcqG2MaskAntenna, getAcqG2SL, getAcqMask, getAcquireC0Count, getAcquireC0Cycles, getAcquireC1Count, getAcquireC1Cycles, getAcquireC1EnterWakeCount, getAcquireC1ExitWakeCount, getAcquireC1SleepCount, getAcquireCount, getAcquireCycles, getAcquireEnterWakeCount, getAcquireExitWakeCount, getAcquireG2Count, getAcquireG2Cycles, getAcquireG2Ops, getAcquireG2Ops, getAcquireG2OpsMode, getAcquireG2Q, getAcquireG2Selects, getAcquireG2Session, getAcquireG2TagData, getAcquireG2Target, getAcquireMode, getAcquireSleep, getAcquireSleepCount, getAcquireTime, getAcquireWakeCount, getAntennaSequence, getAutoAction, getAutoErrorOutput, getAutoFalseOutput, getAutoFalsePause, getAutoMode, getAutoModeStatus, getAutoProgError, getAutoStartPause, getAutoStartTrigger, getAutoStopPause, getAutoStopTimer, getAutoStopTrigger, getAutoTrueOutput, getAutoTruePause, getAutoWaitOutput, getAutoWorkOutput, getCommandPort, getCustomTagList, getCustomTagList, getDHCP, getDNS, getExternalInput, 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, getMask, getMaxAntenna, getMyData, getNetmask, getNetworkTimeout, getNetworkUpgrade, getNotifyAddress, getNotifyFormat, getNotifyHeader, getNotifyInclude, getNotifyKeepAliveTime, getNotifyMode, getNotifyQueueLimit, getNotifyRetryCount, getNotifyRetryPause, getNotifyTime, getNotifyTrigger, getPassword, getPersistTime, getProgAlienImageMap, getProgAlienImageNSI, getProgAntenna, getProgAttempts, getProgBlockAlign, getProgBlockSize, getProgC1KillPwd, getProgDataUnit, getProgEPCData, getProgEPCDataInc, getProgEPCDataIncCount, getProgEraseAttempts, getProgG2AccessPwd, getProgG2KillPwd, getProgG2LockType, getProgG2NSI, getProgIncrementOnFail, getProgProtocol, getProgramID, getProgramPassCode, getProgReadAttempts, getProgSingulate, getProgUserData, getProgUserDataInc, getProgUserDataIncCount, getReaderBaudRate, getReaderFunction, getReaderName, getReaderNumber, getReaderPassword, getReaderType, getReaderUsername, getReaderVersion, getRFAttenuation, getRFAttenuation, getRFAttenuations, getRFAttenuations, getRFLevel, getRFLevel, getRFLevels, getRFLevels, getRFModulation, getRSSIFilter, getSpeedFilter, getStreamHeader, getTag, getTag, getTagAuth, getTagID, getTagID, getTagInfo, getTagList, getTagList, getTagListAntennaCombine, getTagListCustomFormat, getTagListFormat, getTagListMillis, getTagStreamAddress, getTagStreamCountFilter, getTagStreamCountFilterMinimum, getTagStreamCustomFormat, getTagStreamFormat, getTagStreamKeepAliveTime, getTagStreamMode, getTagType, getTime, getTimeServer, getTimeZone, getUpgradeAddress, getUpgradeIPAddress, getUpgradePort, getUptime, getUsername, getWWWPort, heartbeatNow, hideAlienUserBlocks, killTag, lockAccessPwd, lockAccessPwd, lockEPC, lockEPC, lockKillPwd, lockKillPwd, lockTag, lockUser, lockUser, lockUserBlocks, macroDel, macroDelAll, macroList, macroRun, macroStartRec, macroStopRec, macroView, notifyNow, ping, ping, programAccessPwd, programAccessPwd, programAlienImage, programAndLockEPC, programAndLockEPC, programAndLockUser, programAndLockUser, programEPC, programEPC, programKillPwd, programKillPwd, programTag, programUser, programUser, reboot, resetAutoMode, saveSettings, setAcqC1Mask, setAcqC1Mask, setAcqG2AccessPwd, setAcqG2Mask, setAcqG2Mask, setAcqG2MaskAction, setAcqG2MaskAntenna, setAcqG2SL, setAcqMask, setAcqMask, setAcquireC0Count, setAcquireC0Cycles, setAcquireC1Count, setAcquireC1Cycles, setAcquireC1EnterWakeCount, setAcquireC1ExitWakeCount, setAcquireC1SleepCount, setAcquireCount, setAcquireCycles, setAcquireEnterWakeCount, setAcquireExitWakeCount, setAcquireG2Count, setAcquireG2Cycles, setAcquireG2Ops, setAcquireG2Ops, setAcquireG2Ops, setAcquireG2OpsMode, setAcquireG2Q, setAcquireG2Selects, setAcquireG2Session, setAcquireG2TagData, setAcquireG2TagData, setAcquireG2Target, setAcquireMode, setAcquireSleep, setAcquireSleepCount, setAcquireTime, setAcquireWakeCount, setAntennaSequence, setAutoAction, setAutoErrorOutput, setAutoFalseOutput, setAutoFalsePause, setAutoMode, setAutoProgError, setAutoStartPause, setAutoStartTrigger, setAutoStartTrigger, setAutoStopPause, setAutoStopTimer, setAutoStopTrigger, setAutoStopTrigger, setAutoTrueOutput, setAutoTruePause, setAutoWaitOutput, setAutoWorkOutput, setC1MaskBits, setC1TagMask, setCommandPort, setDefaultIOListFormat, setDefaultTagListFormat, setDHCP, setDNS, setExternalOutput, setFactorySettings, setFactorySettings, setG2MaskBits, setG2TagMask, setGateway, setHeartbeatAddress, setHeartbeatCount, setHeartbeatPort, setHeartbeatTime, setHostname, setInitExternalOutput, setInvertExternalInput, setInvertExternalOutput, setIOListCustomFormat, setIOListFormat, setIOStreamAddress, setIOStreamAddress, setIOStreamCustomFormat, setIOStreamFormat, setIOStreamKeepAliveTime, setIOStreamMode, setIOType, setIPAddress, setLBT, setLBTLimit, setLogLevel, setMailFrom, setMailServer, setMask, setMask, setMaskBits, setMyData, setNetmask, setNetworkTimeout, setNetworkUpgrade, setNotifyAddress, setNotifyAddress, setNotifyFormat, setNotifyHeader, setNotifyInclude, setNotifyKeepAliveTime, setNotifyMode, setNotifyQueueLimit, setNotifyRetryCount, setNotifyRetryPause, setNotifyTime, setNotifyTrigger, setPassword, setPersistTime, setProgAlienImageMap, setProgAlienImageNSI, setProgAntenna, 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, setReaderNumber, setReaderPassword, setReaderUsername, setRFAttenuation, setRFAttenuation, setRFAttenuations, setRFLevel, setRFLevel, setRFLevels, setRFModulation, setRSSIFilter, setRSSIFilter, setSpeedFilter, setSpeedFilter, setStreamHeader, setTagAuth, setTagListAntennaCombine, setTagListCustomFormat, setTagListFormat, setTagListMillis, setTagMask, 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, verifyTag, 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, receiveString, sendString, setAddress, setConnection, setConnection, setDebugLevel, 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

### NO_READING

    public static final short NO_READING

  Indicates the lack of valid memory data in the communication from the tag.

  See Also:
    `NO_WRITING`, Constant Field Values

### NO_WRITING

    public static final short NO_WRITING

  Indicates the lack of valid memory data in the communication from the tag.

  See Also:
    `NO_READING`, Constant Field Values

### DEFAULT_TIMEOUT

    public static final int DEFAULT_TIMEOUT

  Specifies the default communication timeout value. BPT readers generally take longer to respond than other Alien readers.

  See Also:
    Constant Field Values

Constructor Detail

### AlienClassBPTReader

    public AlienClassBPTReader()

  Constructs a new AlienClassBPTReader object.

Method Detail

### getTagID

    public Tag getTagID(java.lang.String tagID)
                 throws java.lang.Exception

  Returns the ID of a unique tag specified by the mask commands. If no unique tag can be found (either the mask is incorrect or not specific enough to singulate a tag), the result will be "No Tags".
  - If `tagID` is null the Reader mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to get the value for (or null to use the currently masked tag)
  Returns:
    the `Tag` object matching the specified tagID
  Throws:
    `java.lang.Exception` - if reader communication fails

### getTagInfo

    public java.lang.String getTagInfo(java.lang.String tagID)
                                throws AlienReaderException

  Returns information about a single tag being masked. The information returned will be a multi-line reply containing the following elements:
  - Memory Size
  - Sensor Type

  Note: Please refer to the Nanoscanner Tag Guide for detailed descriptions of tag types.

  - If `tagID` is null the Reader Mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to get the TagInfo for (or null to use the currently masked tag)
  Returns:
    Memory and Sensor information about the tag
  Throws:
    `AlienReaderException` - if reader communication fails

### getSensorValue

    public int getSensorValue(java.lang.String tagID)
                       throws AlienReaderException

  Returns the sensor value of the tag's onboard sensor. If the sensor was already switched off, this command will start the sensor before returning a value, which may take up to 1 second. Sensors will automatically be switched off two seconds after this command has been completed in order to preserve the battery life of the tag.

  Typically the tag has no knowledge of the type of sensor attached to it. Consequently this command simply returns the raw number as returned by the sensor. No attempt is made to process this number into a humanly understandable form.

  Note: Please refer to the Nanoscanner Tag Guide for detailed descriptions of to format of raw sensor values. Because there are many different types of sensors attached to the Nanoscanner tags, the format of the raw sensor values may change due to the type of data being acquired.

  - If `tagID` is null the Reader Mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to get the SensorValue for (or null to use the currently masked tag)
  Returns:
    the current sensor value as integer
  Throws:
    `AlienReaderException` - if reader communication fails
    `AlienReaderCommandErrorException` - if the reader does not return a sensor value
    `AlienReaderNoTagException` - if there is no tag in the field

### isLogging

    public boolean isLogging(java.lang.String tagID)
                      throws AlienReaderException

  Returns the status of Logging Mode for the specified tag. Once Logging is set up, a tag can be removed from an RF field and still have sensor data logged periodically to memory. Bringing the tag back into an RF field will allow the memory to be retrieved and examined. This method returns `true` if the tag is set to log sensor data.

  The reader will query and return the logging mode of the tagID specified, or the currently-masked tag.

  - If `tagID` is null the Reader mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to get LoggingMode status from (or null to use the currently masked tag)
  Returns:
    `true` if the tag is currently logging sensor data, `false` otherwise
  Throws:
    `AlienReaderException` - if reader communication fails
    `AlienReaderNoTagException` - if there is no tag in the field
  See Also:
    `setLogging(String, boolean)`

### setLogging

    public void setLogging(java.lang.String tagID,
                           boolean isLogging)
                    throws AlienReaderException

  Enables or disables logging for a specified tag. Once set up, a tag can be removed from an RF field and still have sensor data logged periodically to memory. Bringing the tag back into an RF field will allow the memory to be retrieved and examined.

  The automatic, time based logging of sensor data to a tag memory is controlled by setting the logging mode of the tag.

  - OFF (`false`) - turns off all automatic logging
  - ON (`true`) - turns on the automatic logging as defined by the logging interval command. Turning on the logging mode like this will not erase the tag's memory; it will simply cause logged data to be appended to the current memory store. (Use the clear memory command to erase the memory before logging).
  The reader will set the logging mode for the tagID specified, or the currently-masked tag.
  - If `tagID` is null the Reader Mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to set LoggingMode for (or null to use the currently masked tag)
    `isLogging` - `true` to turn on logging, `false` to stop it.
  Throws:
    `AlienReaderException` - if reader communication fails
    `AlienReaderNoTagException` - if there is no tag in the field
  See Also:
    `isLogging(java.lang.String)`

### getLoggingInterval

    public byte[] getLoggingInterval(java.lang.String tagID)
                              throws AlienReaderException

  Returns the periodicity at which the tag logs sensor data to tag memory, with timing values returned as a triple byte array. When automatic logging is active, the tag will retrieve a value from the sensor and store it in tag memory on a periodic basis until the memory is full (at which point logging will cease). The periodicity of this logging is controlled by the loggingInterval parameter. This parameter is defined in terms of hours:mins:secs and defines the period between sensor logs.
  - If `tagID` is null the Reader Mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to get LoggingInterval values from (or null to use the currently masked tag)
  Returns:
    a byte array, with byte0=hours, byte1=mins, byte2=secs
  Throws:
    `AlienReaderException` - if reader communication fails
    `AlienReaderNoTagException` - if there is no tag in the field
    `AlienReaderCommandErrorException` - if the logInterval is invalid
  See Also:
    `setLoggingInterval(String, byte[])`, `setLoggingInterval(String, int, int, int)`

### setLoggingInterval

    public void setLoggingInterval(java.lang.String tagID,
                                   byte[] byteArray)
                            throws AlienReaderException

  Sets the periodicity at which the tag logs sensor data to tag memory, with timing values specified as a triple byte array. When automatic logging is active, the tag will retrieve a value from the sensor and store it in tag memory on a periodic basis until the memory is full (at which point logging will cease). The periodicity of this logging is controlled by the loggingInterval parameter. This parameter is defined in terms of hours:mins:secs and defines the period between sensor logs.

  Note: The minimum allowable logging interval is 1 minute.

  Note: The tag will sleep while not in use, and then will wake up to take a sensor reading and then sleep again. This mode of operation ensures a long battery life.

  The logging interval command specifies the interval with three values, of the form hh:mm:ss. These three values are passed into this method as a triple byte array.

  The reader will set the loggingInterval for the tagID specified, or the currently-masked tag.

  - If `tagID` is null the Reader Mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to set LoggingInterval values (or null to use the currently masked tag)
    `byteArray` - byte0 = hours, byte1=mins, byte2=secs
  Throws:
    `AlienReaderException` - if reader communication fails
    `AlienReaderNoTagException` - if there is no tag in the field
  See Also:
    `getLoggingInterval(String)`

### setLoggingInterval

    public void setLoggingInterval(java.lang.String tagID,
                                   int hours,
                                   int mins,
                                   int secs)
                            throws AlienReaderException

  Sets the periodicity at which the tag logs sensor data to tag memory, with timing values specified as individual integers. When automatic logging is active, the tag will retrieve a value from the sensor and store it in tag memory on a periodic basis until the memory is full (at which point logging will cease). The periodicity of this logging is controlled by the loggingInterval parameter. This parameter is defined in terms of hours:mins:secs and defines the period between sensor logs.

  Note: The minimum allowable logging interval is 1 minute.

  Note: The tag will sleep while not in use, and then will wake up to take a sensor reading and then sleep again. This mode of operation ensures a long battery life.

  The logging interval command takes three parameters, of the form hh:mm:ss. These three values are passed into this method as the integers `hours`, `mins`, and `secs`.

  The reader will set the loggingInterval for the tagID specified, or the currently-masked tag.

  - If `tagID` is null the Reader Mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to set LoggingInterval values (or null to use the currently masked tag)
    `hours` - the number of hours in the interval
    `mins` - the number of minutes in the interval
    `secs` - the number of seconds in the interval
  Throws:
    `AlienReaderException` - if reader communication fails
    `AlienReaderNoTagException` - if there is no tag in the field
  See Also:
    `getLoggingInterval(String)`

### getMemory

    public short[] getMemory(java.lang.String tagID,
                             int lengthIndex,
                             int startIndex)
                      throws AlienReaderException

  Returns a chunk of tag memory from the specified tag. Each battery tag may have on-board memory that can be used for arbitrary user data storage, or for holding sensor logging data. This method allow tag memory to be interrogated.

  This method returns an array of shorts. Each item in the array represents a single byte of memory (value 0-255), or is set to `NO_READING` if no reading could be obtained. (This is equivalent to the command line returning a '**' for the value. This is usually due to temporary interference, and repeating the call will often result in readings being returned).

  `getMemory` takes three parameters:

  - tagID - the tagID of the tag to get memory from (see below)
  - lengthIndex - the number of bytes to read, expressed as a decimal number. The maximum number of bytes you can read at one time is 4096 (4 kB).
  - startIndex - the start address of the memory to read, expressed as a single decimal number.
  The results of the Get Memory command are multiple lines of ascii data, where each line of data will represent up to 16 hexadecimal bytes of memory. A line of data may include values specified by `NO_READING` instead of expected data – this indicates that the request for a particular block of memory failed (usually RF communications failure). The data can usually be extracted by repeating the command after repositioning the tag.

  The reader will set the get memory from the tagID specified, or the currently-masked tag.

  - If `tagID` is null the Reader mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.
  Note: Memory is transferred to and from the tag in blocks of memory defined by the reader's memoryPacketSize parameter. The smaller the packet (i.e. 1 or 2 bytes) the smaller the transmission rate but also the smaller the error rate. Likewise the higher the packet size (i.e. 16 bytes) the higher the transmission rate but also the higher the error rate in a noisy environment.

  Parameters:
    `tagID` - the ID of the tag to get memory from (or null to use the currently masked tag)
    `lengthIndex` - the number of bytes to read (up to max of 4096 bytes per call)
    `startIndex` - the starting address of memory to read
  Returns:
    a short array of memory values from the tag
  Throws:
    `AlienReaderException` - if reader communication fails
  See Also:
    `setMemory(String, int, byte[])`, `getMemoryPacketSize()`, `setMemoryPacketSize(int)`, `clearMemory(String)`

### setMemory

    public boolean setMemory(java.lang.String tagID,
                             int startIndex,
                             byte[] byteArray)

  Stores a series of bytes into tag memory. Each battery tag may have on-board memory that can be used for arbitrary user data storage, or for holding sensor logging data. This method will attempt to store a series of bytes into tag memory. The maximum number of bytes for this method is specified by the reader's memoryPacketSize parameter. Any bytes supplied past this number will be ignored.

  `setMemory` takes three parameters:

  - tagID - the tagID of the tag to set memory in (see below)
  - startIndex - the start address of the memory to write, expressed as a single decimal number
  - byteArray - the array of hex bytes to write

  The reader will set the get memory from the tagID specified, or the currently-masked tag.

  - If `tagID` is null the Reader mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.
  Note: Memory is transferred to and from the tag in blocks of memory defined by the reader's memoryPacketSize parameter. The smaller the packet (i.e. 1 or 2 bytes) the smaller the transmission rate but also the smaller the error rate. Likewise the higher the packet size (i.e. 16 bytes) the higher the transmission rate but also the higher the error rate in a noisy environment.

  Parameters:
    `tagID` - the ID of the tag to set memory in (or null to use the currently masked tag)
    `startIndex` - the start address of the memory location to write to
    `byteArray` - the array of hex bytes to write to memory
  Returns:
    `true` if all data was written, `false` otherwise
  See Also:
    `getMemory(String, int, int)`, `getMemoryPacketSize()`, `setMemoryPacketSize(int)`, `clearMemory(String)`

### clearMemory

    public void clearMemory(java.lang.String tagID)
                     throws AlienReaderException

  Completely erases the memory of a specified tag. The reader will clear the tag memory from the tagID specified, or the currently-masked tag.
  - If `tagID` is null the Reader mask will not be changed.
  - If `tagID` is not null, the Reader mask will be set to the required value.
  - The `tagID` can be in the format XX XX XX XX or XXXX XXXX or XXXXXXXX.

  Parameters:
    `tagID` - the ID of the tag to clear memory for (or null to use the currently masked tag(s))
  Throws:
    `AlienReaderException` - if reader communication fails

### getMemoryPacketSize

    public int getMemoryPacketSize()
                            throws AlienReaderException

  Returns the number of bytes to use in each memory related transmission packet to and from the tag. The smaller the packet (i.e. 1 or 2 bytes) the smaller the transmission rate but also the smaller the error rate. Likewise the higher the packet size (i.e. 16 bytes) the higher the transmission rate but also the higher the error rate in a noisy environment.

  The default setting for this value is 16 bytes. The allowable range is 1 to 16 bytes.

  Returns:
    the number of bytes to transmit when dealing with tag memory
  Throws:
    `AlienReaderException` - if reader communication fails
  See Also:
    `setMemoryPacketSize(int)`

### setMemoryPacketSize

    public void setMemoryPacketSize(int memoryPacketSize)
                             throws AlienReaderException

  Specifies the number of bytes to use in each memory related transmission packet to and from the tag. The smaller the packet (i.e. 1 or 2 bytes) the smaller the transmission rate but also the smaller the error rate. Likewise the higher the packet size (i.e. 16 bytes) the higher the transmission rate but also the higher the error rate in a noisy environment.

  The default setting for this value is 16 bytes. The allowable range is 1 to 16 bytes.

  Parameters:
    `memoryPacketSize` - the number of bytes to transmit when dealing with tag memory
  Throws:
    `AlienReaderException` - if reader communication fails
  See Also:
    `getMemoryPacketSize()`

### 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD