Apdu command reading a passive tag?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
suads
 
Posts: 3
Joined: Mon Oct 15, 2018 10:15 am

Apdu command reading a passive tag?

Post by suads »

I'm using libnfc and the apdu_examle.c with PN532 on my Beaglebone. I have a android example for emulating Miffare classic 1k card HCE(Host Card emulation) on my phone and everyting is working fine. If I tap the phone I can read the message that I'm sending from my phone.

Is it possible to send apdu commands to read data from a Miffare classic 1k card (passive tag)? not phone. The card is ISO/IEC 14443A standard. Must there be a specific format or data structure on the card?
Which specifications need my card to satisfy?
Here are some more info about the card:

ISO/IEC 14443A (106 kbps) target: ATQA (SENS_RES): 00 04

UID size: single
bit frame anticollision supported UID (NFCID1): db 6c 10 2b
SAK (SEL_RES): 08
Not compliant with ISO/IEC 14443-4
Not compliant with ISO/IEC 18092
Fingerprinting based on MIFARE type Identification Procedure:

MIFARE Classic 1K
MIFARE Plus (4 Byte UID or 4 Byte RID) 2K, Security level 1
SmartMX with MIFARE 1K emulation

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Apdu command reading a passive tag?

Post by adafruit_support_mike »

NDEF and APDU operate at different levels.. NDEF is a way of arranging data on an NFC card, while APDU is a set of messages sent back and forth between NFC devices.

Mifare cards may or may not support APDU messages for communication. You'll have to check the datasheet of the card you want to use to see if it lists 'ISO/IEC 7816' as one of its supported modes.

User avatar
suads
 
Posts: 3
Joined: Mon Oct 15, 2018 10:15 am

Re: Apdu command reading a passive tag?

Post by suads »

Thank you for your response
I m not sure what card it is, I bought it from ebay that came with the module mfrc-522
https://www.ebay.com/itm/RC522-Card-Rea ... :rk:1:pf:0
As far as I understand, Miffare classic 1k card with ISO14443A standard supports the apdu commands not directly the reader maps this commands. Or Am I wrong?????

This is what I found on the Internet by searching:

"As MIFARE Classic cards do not speak APDU, it's difficult to give you a ready-made APDU command for this. (MIFARE Classic cards are contactless memory cards and use their own proprietary contactless protocol and PC/SC-compliant smartcard readers usually only map these proprietary memory access commands to APDUs.)
However, if your reader supports PC/SC 2.01 commands for storage cards, commands could look like this
"

But everytime I send something over apdu I'm getting the following error:
libnfc.chip.pn53x Chip error: "Command Not Acceptable" (27), returned error: "Invalid argument(s)" (-2))
Bu

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Apdu command reading a passive tag?

Post by adafruit_support_mike »

You can't use APDU to communicate directly with a passive NFC tag. The tag doesn't have the hardware to generate APDU responses.

This page talks about Mifare compatibility with APDU though:

https://www.mifare.net/support/forum/to ... port-apdu/

User avatar
suads
 
Posts: 3
Joined: Mon Oct 15, 2018 10:15 am

Re: Apdu command reading a passive tag?

Post by suads »

Thank you Mike I understand it,
So I'm using nfc_initiator_transceive_bytes function from libnfc and thats my fault the tag doesn't understand this.
Now I know how to send it using this http://downloads.acs.com.hk/drivers/cn/ ... U-2.02.pdf, but I don't know what function to use to send the native commands.
Is there a function in libnfc to send native commands in libnfc?

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”