Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Using the framework described here, I'm trying to read from a smart card. I have built an apdu command. The command structure appears to be correct because it works in java. When I call the SCardTransmit() function, the command gets executed, but it returns an empty response buffer of length Le+2 bytes. The first two bytes holding SW1 and SW2 are 6118. I believe this means that there are more bytes to be read into the buffer. However when I change the buffer size, the response buffer size is changed but i still get error code 6118. This is a select command that is followed by a get data command returning status 6100, which I think means that there are more than 0xFF bytes to be read still. So how do I get the response buffer to be filled?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
144 views
Welcome To Ask or Share your Answers For Others

1 Answer

The described behaviour matches a T=0 protocol card. In that protocol you never get the command response directly, but have to send a GET RESPONSE command with the length reported in the return code of the previous command, here 0x18.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...