Page 1 of 1

Exception 0x8010002F, why?

Posted: Mon Jan 09, 2017 2:56 am
by Ruenie
When I use GPShell to to test my java card applet, I got error "send_APDU() returns 0x8010002F (A communications error with the smart card has been detected. Retry the operation."
i.e.
sending command >A404000008, the error appears, expected to be 0x6099. Perhaps someone can help me with this problem. Thanks for all the help.

My code:

Code: Select all

public static void install(byte[] bArray, short bOffset, byte bLength) {  
        // GP-compliant JavaCard applet registration 
        pin = new OwnerPIN((byte) 0X03,(byte) 0X08); 
        pin.update(PIN_NO, (short) 0, (byte) 0x08); 
        new DZCARD().register(bArray, (short) (bOffset + 1), bArray[bOffset]); 
         
    } 
 
    public void process(APDU apdu) { 
        // Good practice: Return 9000 on SELECT 
        if (selectingApplet()) { 
             
            return; 
        } 
 
        byte[] buf = apdu.getBuffer(); 
        switch (buf[ISO7816.OFFSET_INS]) { 
        case (byte) 0x04: 
            if(buf[ISO7816.OFFSET_CLA]!=(byte) 0xA4) 
                ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED); 
            else 
            { 
                short byte_read=(short)(apdu.setIncomingAndReceive()); 
                byte x = Util.arrayCompare(buf, ISO7816.OFFSET_CDATA, APPLET_ID, (short)0 , byte_read); 
                if(x!= (byte) 0x00) 
                { 
                    ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND); 
                } 
            } 
        ISOException.throwIt((short) 0x6099); 
            break; 

Re: Exception 0x8010002F, why?

Posted: Mon Jan 09, 2017 5:25 am
by BrooksIQ
0x60 can not be used as SW1 status word, which results in the communication error. It will not request any action on data transfer.