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

        public MFReader​(String identifier,
                        ICommConnection connection,
                        String... minReaderRevision)
        Creates a new MifareReader with the specified connection
        Parameters:
        identifier - reader identifier
        connection - connection
        minReaderRevision - min reader revision
      • MFReader

        @Deprecated
        public MFReader​(String identifier,
                        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​(String identifier,
                        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​(String identifier,
                        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 List<String> 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 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_RRESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • getTagData

        public 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_RRESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • getTagData

        public String getTagData​(int blockNumber,
                                 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_RRESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • getTagData

        public String getTagData​(int firstBlock,
                                 int numberOfFollowingBlocks,
                                 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_RRESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • setTagData

        public void setTagData​(int blocknumber,
                               String data,
                               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_RRESPONSE
        • NOT_EXPECTED_RESPONSE
        • WRONG_PARAMETER
        CommConnectionException - possible Error codes:
        • NOT_INITIALISE
        • CONNECTION_LOST
        • RECV_TIMEOUT
        • UNHANDLED_ERROR
      • selectCard

        public int selectCard​(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
      • authenticatedSector

        public void authenticatedSector​(int sector,
                                        String key,
                                        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