SCardTransmit() returns empty response buffer

一笑奈何 提交于 2019-12-25 17:17:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/17220075/scardtransmit-returns-empty-response-buffer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!