Click here to Skip to main content
15,894,337 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I developed a host app by using Java Smart Card IO framework. Host app send a reading command to card and is waiting to receive response.
During this process, timeout occur (timeout value is defined by me).

I suppose reading process will be stop when timeout occur. My question is how to do this?

- Currently,the host app is connect to card by using basic channel. I tried to close this channel but I got exception java.lang.IllegalStateException: Cannot close basic logical channel
- I also tried to open a logical channel by calling channel = card.openLogicalChannel();, but when the host send reading command it receive SW 6D00 - Instruction code not support or invalid.
- I also tried to disconnect terminal and card by calling card.disconnect(), but I got exception

javax.smartcardio.CardException: sun.security.smartcardio.PCSCException: WINDOWS_ERROR_INVALID_HANDLE
    at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:219)
    at sun.security.smartcardio.ChannelImpl.transmit(ChannelImpl.java:90)
    at ISO.ISO7816.readRecords(ISO7816.java:234)
    at javasmartcardio.UI.PTCMainFrame$9.run(PTCMainFrame.java:343)
    at java.lang.Thread.run(Thread.java:745)
Caused by: sun.security.smartcardio.PCSCException: WINDOWS_ERROR_INVALID_HANDLE
    at sun.security.smartcardio.PCSC.SCardTransmit(Native Method)
    at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:189)
Posted
Updated 23-Dec-15 21:55pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900