Android NFC : Tag lost when APDU command sent to a smart card
Asked Answered
D

1

10

I am doing an EMV application on Android OS (Samsung Galaxy).

I am able to send several APDU commands without problem but when I am trying to send the internal authentication command. I have this error : Tag lost. Have you got any idea concerning the purpose of this error ? I am not an experimented developer on Android, It may I have forgotten some stuff.

  • the command is correct.
  • I can replace by another command, it works (I mean I can recover a response).

In which cases a NFC communication can be broken on Android?

Here, you can see my problem when the command is sent :

D/ECInfoGrabber(14088): Send: 00 88 00 00 04 14 16 67 3D
D/OpenGLRenderer(14088): Flushing caches (mode 0) D/dalvikvm(14088): GC_FOR_ALLOC freed 227K, 4% free 14298K/14855K, paused 29ms I/dalvikvm-heap(14088): Grow heap (frag case) to 14.142MB for 115216-byte allocation D/dalvikvm(14088): GC_FOR_ALLOC freed 3K, 4% free 14408K/14983K, paused 15ms

Thanks

Disbud answered 2/8, 2012 at 11:58 Comment(0)
G
17

One possibility is that the response from the card takes more time than the default time-out setting. This often occurs when the card has to do some internal calculations; typically in case of cryptographic operations such as authentication.

You can change the time-out value using IsoDep.setTimeout():

 IsoDep iso = IsoDep.get(tag);
 iso.connect();
 iso.setTimeOut(5000); // 5 sec time out
 iso.transceive(apduCommand); // now send your command 
Grimsby answered 3/8, 2012 at 21:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.