>From android point of view it doesnt matter what the command data is, its all byte[] to the transcieve. I try to get a isodep first. if that fails i try to get a NfcB tag.
In my cardB case, I tried to connect * transcieve using ISODep and get back 6700 If I try to get a NfcB tag, the connect fails with exception. On Tue, May 3, 2011 at 11:10 PM, Michael Roland <[email protected]> wrote: > Hallo, > > which variant did you use, the low-level access or the IsoDep acccess? > > The low-level example will only work with MIFARE Ultralight cards (these > are always NfcA). Sorry, I don't know any example for low-level access > to NfcB cards. The IsoDep example will certainly only give a useful > result if the card contains the ICAO electronic passport application... > > br > Michael > > > On 30.04.2011 00:58 priti - wrote: > > Hi Michael, > > > > Thanks! that worked with my nfcA cards! > > But when I use it with my nfcB cards, I am getting a "67 00" (protocol > > error?) > > > > Appreciate your help, > > Priti > > > > On Thu, Apr 28, 2011 at 8:50 AM, Michael Roland <[email protected] > > <mailto:[email protected]>> wrote: > > > > Hallo, > > > > > What exactly is low level access? > > > > With low-level access (as compared to APDU based access) I mean some > > vendor specific (proprietary) protocol according to the ISO/IEC > 14443-3 > > standard. Thus, instead of sending high-level APDU commands a more > > simple protocol is used (such a protocol is for example the MIFARE > > Ultralight and the MIFARE Classic command-set). > > > > > How do I send/receive nfcA/nfcB commands then? > > > > For NfcA (e.g. MIFARE Ultralight) you would simply retrieve an NfcA > > object: > > > > NfcA myTag = NfcA.getTag(tag); > > > > And then transceive low-level commands with transceive() method. E.g. > > > > byte[] data = myTag.transceive(new byte[]{ (byte)0x30, (byte)0x00 > }); > > > > would retrieve the first 16 bytes of data from an MIFARE Ultralight > tag. > > > > > > But as you suggested you want to transfer APDUs, instead of getting > an > > NfcA object you would want to get an IsoDep object for the tag. This > > object wraps an APDU-based (ISO/IEC 14443-4 & ISO/IEC 7816-4) > > connection: > > > > IsoDep myCard = IsoDep.getTag(tag); > > > > The transceive() method then allows you to directly transmit command > > APDUs to the contactless smart card and returns the response APDU: > > > > byte[] response = myCard.transceive(command); > > > > Where command could be, for instance, a SELECT(file by DF name) > command. > > The following command would select the ICAO electronic passport > > application (AID A0000002471001): > > byte[] command = new byte[]{ > > (byte)0x00, /* CLA = 00 (first interindustry command set) */ > > (byte)0xA4, /* INS = A4 (SELECT) */ > > (byte)0x04, /* P1 = 04 (select file by DF name) */ > > (byte)0x0C, /* P2 = 0C (first or only file; no FCI) */ > > (byte)0x07, /* Lc = 7 (data/AID has 7 bytes) */ > > /* AID = A0000002471001: */ > > (byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x02, > > (byte)0x47, (byte)0x10, (byte)0x01 > > }; > > > > As a response you would get e.g. status code 9000 if the applet was > > found on the card. > > > > Best regards, > > Michael > > > > > > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

