Package com.metratec.lib.rfidreader
Class MetratecReaderGen1<T extends RfidTag>
- java.lang.Object
-
- com.metratec.lib.rfidreader.MetratecReader<T>
-
- com.metratec.lib.rfidreader.MetratecReaderGen1<T>
-
- Type Parameters:
T
- rfid tag instance
public abstract class MetratecReaderGen1<T extends RfidTag> extends MetratecReader<T>
- Author:
- Matthias Neumann (neumann@metratec.com)
-
-
Field Summary
-
Fields inherited from class com.metratec.lib.rfidreader.MetratecReader
STATE_CONFIGURING, STATE_CONNECTING, STATE_RUNNING, STATE_STOPPED, STATE_WAITING_FOR_RECONNECT
-
-
Constructor Summary
Constructors Constructor Description MetratecReaderGen1(java.lang.String identifier, ICommConnection connection)
Construct a new StandardReader instance with the specified connection
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
getCRCState()
Gets the state of the Cyclic Redundancy Check (CRC)boolean
getEndOfFrameState()
End of Frame Statejava.lang.String
getFirmwareRevision()
get the Firmware Revisionjava.lang.String
getHardwareRevision()
Gets the hardware revisionboolean
getInput(int pin)
Reads the current state of an input pinReaderType
getReaderType()
Parse the Firmware Name and return theReaderType
java.lang.String
getRevision()
Gets the firmware revisionjava.lang.String
getSerialNumber()
Gets the serial numbervoid
ping()
test if the reader is alivevoid
reset()
Reset the readerabstract void
scanInventory()
Looks for all tags in range of the reader and call events with founded tags.void
scanInventory(long tagKeepTime)
Looks for all tags in range of the reader and call events with founded tags.void
setOutput(int pin, boolean state)
Sets the state of an output pinabstract void
setPower(int power)
void
standby()
Sets the reader in a power saving modevoid
startInventory(long tagLostTime)
Looks for all tags in range of the reader and call events with founded tags.void
stop()
stop the readerjava.util.List<T>
stopInventory()
Stops the current continues inventoryvoid
wakeUp()
Ends the power saving mode-
Methods inherited from class com.metratec.lib.rfidreader.MetratecReader
connect, connect, disconnect, getIdentifier, getInputDebounceTime, getInventory, getReceiveTimeout, isConnected, setAntennaPort, setIdentifier, setInputDebounceTime, setMaxReconnectWaitTime, setMinReconnectWaitTime, setMultiplexAntennas, setReaderEventListener, setReceiveTimeout, setTagEventListener, start, start, startAndWait, startAndWait, startInventory
-
-
-
-
Constructor Detail
-
MetratecReaderGen1
public MetratecReaderGen1(java.lang.String identifier, ICommConnection connection)
Construct a new StandardReader instance with the specified connection- Parameters:
identifier
- reader identifierconnection
- connection
-
-
Method Detail
-
reset
public void reset() throws RFIDReaderException, CommConnectionException
Reset the reader- Throws:
RFIDReaderException
- if a error occurs, seeRFIDReaderException.getErrorCode()
andThrowable.getMessage()
for more detailsCommConnectionException
- if a error occurs, seeCommConnectionException.getErrorCode()
andThrowable.getMessage()
for more details
-
stop
public void stop() throws CommConnectionException
Description copied from class:MetratecReader
stop the reader- Overrides:
stop
in classMetratecReader<T extends RfidTag>
- Throws:
CommConnectionException
- possible ICommConnection Error codes:- UNHANDLED_ERROR
-
standby
public void standby() throws RFIDReaderException, CommConnectionException
Sets the reader in a power saving mode- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
wakeUp
public void wakeUp() throws RFIDReaderException, CommConnectionException
Ends the power saving mode- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getRevision
public java.lang.String getRevision() throws RFIDReaderException, CommConnectionException
Gets the firmware revision- Returns:
- the device type, hardware architecture and firmware revision of the reader
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
getReaderType
public ReaderType getReaderType() throws RFIDReaderException, CommConnectionException
Description copied from class:MetratecReader
Parse the Firmware Name and return theReaderType
- Specified by:
getReaderType
in classMetratecReader<T extends RfidTag>
- Returns:
- the
ReaderType
- Throws:
RFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)CommConnectionException
- if an communication exception occurs
-
getFirmwareRevision
public java.lang.String getFirmwareRevision() throws RFIDReaderException, CommConnectionException
Description copied from class:MetratecReader
get the Firmware Revision- Specified by:
getFirmwareRevision
in classMetratecReader<T extends RfidTag>
- Returns:
- the Firmware Revision as String
- Throws:
RFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)CommConnectionException
- if an communication exception occurs
-
getSerialNumber
public java.lang.String getSerialNumber() throws RFIDReaderException, CommConnectionException
Description copied from class:MetratecReader
Gets the serial number- Specified by:
getSerialNumber
in classMetratecReader<T extends RfidTag>
- Returns:
- the serial number of the reader. The serial number is an ASCII string of 16 characters.
- Throws:
RFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)CommConnectionException
- if an communication exception occurs
-
getHardwareRevision
public java.lang.String getHardwareRevision() throws RFIDReaderException, CommConnectionException
Description copied from class:MetratecReader
Gets the hardware revision- Specified by:
getHardwareRevision
in classMetratecReader<T extends RfidTag>
- Returns:
- the hardware revision of the reader which corresponds to the PCB layout version printed on the board. The number is an ASCII string of four characters.
- Throws:
RFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)CommConnectionException
- if an communication exception occurs
-
getEndOfFrameState
public boolean getEndOfFrameState()
End of Frame State- Returns:
- end of frame ('\n') is active state
-
getCRCState
public boolean getCRCState()
Gets the state of the Cyclic Redundancy Check (CRC)- Returns:
- the CRC State
-
getInput
public boolean getInput(int pin) throws RFIDReaderException, CommConnectionException
Description copied from class:MetratecReader
Reads the current state of an input pin- Specified by:
getInput
in classMetratecReader<T extends RfidTag>
- Parameters:
pin
- input pin to read- Returns:
- true if input is high, false if input is low
- Throws:
RFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)CommConnectionException
- if an communication exception occurs
-
setOutput
public void setOutput(int pin, boolean state) throws RFIDReaderException, CommConnectionException
Description copied from class:MetratecReader
Sets the state of an output pin- Specified by:
setOutput
in classMetratecReader<T extends RfidTag>
- Parameters:
pin
- output pinstate
- true for high state, false for low state- Throws:
RFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)CommConnectionException
- if an communication exception occurs
-
ping
public void ping() throws CommConnectionException
test if the reader is alive- Throws:
CommConnectionException
- possible ICommConnection Errorcodes:- NOT_INITIALISE
- CONNECTION_LOST
- RECV_TIMEOUT
- UNHANDLED_ERROR
-
setPower
public abstract void setPower(int power) throws CommConnectionException, RFIDReaderException
- Parameters:
power
- reader power value- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
scanInventory
public abstract void scanInventory() throws CommConnectionException, RFIDReaderException
Looks for all tags in range of the reader and call events with founded tags.- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
scanInventory
public void scanInventory(long tagKeepTime) throws CommConnectionException, RFIDReaderException
Looks for all tags in range of the reader and call events with founded tags.- Parameters:
tagKeepTime
- tag keep time- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
startInventory
public void startInventory(long tagLostTime) throws CommConnectionException, RFIDReaderException
Description copied from class:MetratecReader
Looks for all tags in range of the reader and call events with founded tags.- Specified by:
startInventory
in classMetratecReader<T extends RfidTag>
- Parameters:
tagLostTime
- timeout in milliseconds for tag lost event- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs (e.g. CRC error, value out of range, ..)
-
stopInventory
public java.util.List<T> stopInventory() throws CommConnectionException, RFIDReaderException
Description copied from class:MetratecReader
Stops the current continues inventory- Specified by:
stopInventory
in classMetratecReader<T extends RfidTag>
- Returns:
- the current inventory
- Throws:
CommConnectionException
- if an communication exception occursRFIDReaderException
- if an protocol exception occurs
-
-