Class MFReader

    • Field Detail

      • CARD_TYPE_MIFARE_1K

        public static final int CARD_TYPE_MIFARE_1K
        Card type mifare 1k
        See Also:
        Constant Field Values
      • CARD_TYPE_MIFARE_4K

        public static final int CARD_TYPE_MIFARE_4K
        Card type mifare 4k
        See Also:
        Constant Field Values
      • CARD_TYPE_MIFARE_DESFIRE

        public static final int CARD_TYPE_MIFARE_DESFIRE
        Card type mifare desfire
        See Also:
        Constant Field Values
      • CARD_TYPE_MIFARE_ULTRALIGHT

        public static final int CARD_TYPE_MIFARE_ULTRALIGHT
        Card type mifare ultralight
        See Also:
        Constant Field Values
    • Constructor Detail

      • MFReader

        @Deprecated
        public MFReader​(java.lang.String identifier,
                        java.lang.String usbDeviceSerialNumber)
        Deprecated.
        Use the reader classes ( QuasarMF, DeskID_MF, Dwarf14, QR14) for instantiate the reader
        Creates a new MifareReader class for communicate with the specified metraTec usb mifare reader
        Parameters:
        identifier - reader identifier
        usbDeviceSerialNumber - serial number of the usb mifare reader
      • MFReader

        @Deprecated
        public MFReader​(java.lang.String identifier,
                        java.lang.String ipAddress,
                        int port)
        Deprecated.
        Use the reader classes ( QuasarMF, DeskID_MF, Dwarf14, QR14) for instantiate the reader
        Creates a new UHFReader class for communicate with the specified metraTec ethernet mifare reader
        Parameters:
        identifier - reader identifier
        ipAddress - ip address of the ethernet mifare reader
        port - port of the ethernet uhf reader
      • MFReader

        @Deprecated
        public MFReader​(java.lang.String identifier,
                        java.lang.String portName,
                        int baudrate,
                        int dataBit,
                        int stopBit,
                        int parity,
                        int flowControl)
        Deprecated.
        Use the reader classes ( QuasarMF, DeskID_MF, Dwarf14, QR14) for instantiate the reader
        Creates a new UHFReader class for communicate with the specified metraTec ethernet mifare reader
        Parameters:
        identifier - reader identifier
        portName - port on which the rs232 mifare reader is connected
        baudrate - baudrate of the rs232 mifare reader
        dataBit - rs232 databits
        stopBit - rs232 stopbit
        parity - rs232 parity
        flowControl - rs232 flowcontrol
    • Method Detail

      • getInventoryOnlyNewTags

        public java.util.List<MfTag> getInventoryOnlyNewTags()
                                                      throws RFIDReaderException,
                                                             CommConnectionException
        returns all UIDs from ISO/IEC 14443-1 to 3 compatible transponders, which are new in the read range of the reader.
        Returns:
        List with the tag UIDs
        Throws:
        RFIDReaderException - possible RFIDErrorCodes:
        • CCE, CRC communication error
        • NER, not expected response
        CommConnectionException - possible ICommConnection Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • getTagData

        public java.lang.String getTagData​(int blockNumber)
                                    throws RFIDReaderException,
                                           CommConnectionException
        Reads data from a tag
        Parameters:
        blockNumber - blocknumber
        Returns:
        tag data
        Throws:
        RFIDReaderException - possible Error codes:
        • AUTHENTICATION_ERROR
        • CARD_NOT_AUTHENTICATED
        • BLOCK_NOT_AUTHENTICATED
        • NO_KEY_SELECTED
        • TAG_NOT_RESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • getTagData

        public java.lang.String getTagData​(int firstBlock,
                                           int numberOfFollowingBlocks)
                                    throws RFIDReaderException,
                                           CommConnectionException
        Reads data from the given tag
        Parameters:
        firstBlock - first block
        numberOfFollowingBlocks - number of following blocks
        Returns:
        tag data
        Throws:
        RFIDReaderException - possible Error codes:
        • AUTHENTICATION_ERROR
        • CARD_NOT_AUTHENTICATED
        • BLOCK_NOT_AUTHENTICATED
        • NO_KEY_SELECTED
        • TAG_NOT_RESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • getTagData

        public java.lang.String getTagData​(int blockNumber,
                                           java.lang.String TagID)
                                    throws RFIDReaderException,
                                           CommConnectionException
        Reads data from the given tag and authenticated automatically
        Parameters:
        blockNumber - blocknumber
        TagID - tag id
        Returns:
        tag data
        Throws:
        RFIDReaderException - possible Error codes:
        • AUTHENTICATION_ERROR
        • CARD_NOT_AUTHENTICATED
        • BLOCK_NOT_AUTHENTICATED
        • NO_KEY_SELECTED
        • TAG_NOT_RESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • getTagData

        public java.lang.String getTagData​(int firstBlock,
                                           int numberOfFollowingBlocks,
                                           java.lang.String TagID)
                                    throws RFIDReaderException,
                                           CommConnectionException
        Reads data from the given tag and authenticated automatically
        Parameters:
        firstBlock - first block
        numberOfFollowingBlocks - number of following blocks
        TagID - tag id
        Returns:
        tag data
        Throws:
        RFIDReaderException - possible Error codes:
        • AUTHENTICATION_ERROR
        • CARD_NOT_AUTHENTICATED
        • BLOCK_NOT_AUTHENTICATED
        • NO_KEY_SELECTED
        • TAG_NOT_RESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • setTagData

        public void setTagData​(int blocknumber,
                               java.lang.String data,
                               java.lang.String TagID)
                        throws RFIDReaderException,
                               CommConnectionException
        Write Data to the Tag
        Parameters:
        blocknumber - block number
        data - data
        TagID - tag id
        Throws:
        RFIDReaderException - possible Error codes:
        • NO_KEY_SELECTED
        • NO_CARD_SELECTED
        • BLOCK_NOT_AUTHENTICATED
        • CARD_NOT_AUTHENTICATED
        • TAG_NOT_RESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • selectCard

        public int selectCard​(java.lang.String cardUID)
                       throws CommConnectionException,
                              RFIDReaderException
        select a specific transponder
        Parameters:
        cardUID - card id
        Returns:
        Card type (SAK Code, SAK length is 1 byte for short UIDs (4Bytes) and 2 bytes for double length UID (7 bytes))
        Throws:
        RFIDReaderException - possible RFIDErrorCodes:
        • TNR, tag not responding
        • EHX, hex expected
        • CCE, CRC communication error
        • NER, not expected response
        CommConnectionException - possible ICommConnection Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • setKeyToUse

        public void setKeyToUse​(java.lang.String type,
                                java.lang.String key)
                         throws CommConnectionException,
                                RFIDReaderException
        set the key to use for authentication
        Parameters:
        key - key to use
        type - key type (A or B)
        Throws:
        RFIDReaderException - possible Error codes:
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • authenticatedSector

        public void authenticatedSector​(int sector,
                                        java.lang.String key,
                                        java.lang.String type)
                                 throws CommConnectionException,
                                        RFIDReaderException
        authenticate a MiFare sector
        Parameters:
        sector - MiFare sector
        key - key to use
        type - key type (A or B)
        Throws:
        RFIDReaderException - possible RFIDErrorCodes:
        • BIH, Block is too high
        • ATE, Authentication Error
        • NKS, No Key Selected
        • CNS, Card is not selected
        • TNR, Tag not responding
        • CCE, CRC communication error
        • NER, no expected response
        CommConnectionException - possible ICommConnection Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • authenticatedSector

        public void authenticatedSector​(int sector)
                                 throws CommConnectionException,
                                        RFIDReaderException
        authenticate a Mifare sector
        Parameters:
        sector - Mifare sector
        Throws:
        RFIDReaderException - possible RFIDErrorCodes:
        • BIH, Block is too high
        • ATE, Authentication Error
        • NKS, No Key Selected
        • CNS, Card is not selected
        • TNR, Tag Not Responding
        • CCE, CRC communication error
        • NER, no expected response
        CommConnectionException - possible ICommConnection Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • setMultiplexAntennas

        public void setMultiplexAntennas​(int numberOfAntennas)
                                  throws CommConnectionException,
                                         RFIDReaderException
        Description copied from class: MetratecReader
        In case you want to automatically switch between multiple antennas (e.g. trying to find all tags in a search area that can only be searched using multiple antennas) you can use this automatic switching mode.
        Switching always starts with the lowest antenna port (0). Switching to the next antenna port oc- curs automatically with the start of every tag manipulation command. No pin state is changed until the first tag manipulation command.
        Specified by:
        setMultiplexAntennas in class MetratecReader<MfTag>
        Parameters:
        numberOfAntennas - number of antennas [1..16], 0 for disable; Please note that for this parameter the number given is the counted number of participating antennas, not the antenna port numbers, thus stating a number "X" would stand for "X antennas participating".
        Throws:
        CommConnectionException - if an communication exception occurs
        RFIDReaderException - if an protocol exception occurs (e.g. CRC error, value out of range, ..)