5
votes

I got an ACR122U NFC reader SDK with the sample demo and tools taken from ACS.Then,i am trying to run the ACR122U reader tool put the mifare card 1K on the NFC reader to run the tool. .Then,everything is ok.But,only when to get the ATS it trouble..it say function not supported.Then,because of that cannot do the load authentication,authentication,read block and all the things.Means,PICC command (T=CL Emulation) for mifare classic Memory cards unable to run.

it is was happen same to topaz and mifare ultralight which could not supported while i try to get the ATS.even when connect with phone nokia c7 the tag also function not supported.

SO,can you give suggestion why function not supported? and when i set the PICC operating parameter also got a problem.Below are the code

ACR122U PICC Interface Connected to : ACS ACR122 0

ACR122U Get Firmware Version Firmware Version : ACR122U207

ACR122U Status < FF 00 00 00 02 D4 04

D5 05 00 00 01 01 00 00 00 80 90 00 Error Code: 00 Field: 00 (RF Field is NOT Present and NOT Detected) Number of Target: 01 Logical Number: 01 Bit Rate in Reception: 00 (106 kbps) Bit Rate in Transmission: 00 (106 kbps) Modulation Type: 00 (ISO14443 or Mifare)

ACR122U Get ATR

ATR Value: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A Active Protocol: T=CL Card Type: ISO 14443A, Part3 (Mifare 1K)

ACR122U APDU Command

< FF CA 00 00 04

13 29 DF 97 90 00

here are shown the problem.It should return 90 00-success

ACR122U Get Data Get UID < FF CA 00 00 00

90 00 UID: 13 29 DF 97

Get ATS < FF CA 01 00 00

6A 81 Function not supported

ACR122U Load Authentication Keys < FF 82 00 00 06 FF FF FF FF FF FF

90 00 < Key Structure: 00 < Key Number: 00 < Key: FF FF FF FF FF FF Load Authentication Keys Success

PICC command (T=CL Emulation) for mifare classic Memory cards unable to run.

ACR122U Read Binary Block

ACR122U Authentication < FF 86 00 00 05 01 00 04 60 00

63 00 Operation failed < FF B0 00 04 10 63 00 Operation failed

1

1 Answers

2
votes

I realize that this is an old question but I am working on the same card (Mifare 1K). My start code is:

public void start() throws CardReaderException {
    TerminalFactory factory = TerminalFactory.getDefault();
    List<CardTerminal> terminals;
    try {
        terminals = factory.terminals().list();
        //System.out.println("Terminals: " + terminals);
        // get the first terminal
        CardTerminal terminal = terminals.get(0);
        // establish a connection with the card
        card = terminal.connect("*");
        //System.out.println("card: " + card);
        channel = card.getBasicChannel();
    } catch (CardException e) {
        e.printStackTrace();
    }       
}

which is then followed with the authenticate code:

private boolean authenticate(byte block) {
    byte [] setKey = new byte[]{(byte) 0xff, (byte) 0x82, 00, 01, 06, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
    byte [] authKey = new byte[] {(byte) 0xff, (byte) 0x86, 00, 00, 0x05, 0x01, 0x00, block, 0x60, 0};

    ResponseAPDU r;
    try {
        r = channel.transmit(new CommandAPDU(setKey));
        if ( r.getBytes()[0] != retOk) {
            return false;
        }

        r = channel.transmit(new CommandAPDU(authKey));
        if ( r.getBytes()[0] != retOk) {
            return false;
        }
    } catch (CardException e) {
        e.printStackTrace();
    }


    return true;
}

after I have authenticated I can either read (0xFF, 0xB0, 0x00, block, 0x10) or write (0xFF, 0xD6, 0x00, block, 0x10) to the card.