Detection of smart card removal and insertion using PCSC in C

拈花ヽ惹草 提交于 2020-01-14 19:14:47

问题


I am using PCSC-lite v1.6.4 for my smartcard based application development. I need a way to detect as soon as smart card is removed from reader and then to detect the insertion into reader so that smartcard will be forced to complete a specific process again.

If possible, is there any interrupt/event based way instead of simple polling?


回答1:


There is SCardGetStatusChange in WinSCard library.

Blocks execution until the current availability of the cards in a specific set of readers changes.

Since PCSC Lite is a reimplementation of WinSCard library you can also use it in PCSC Lite (here). You can find several examples.



来源:https://stackoverflow.com/questions/42456748/detection-of-smart-card-removal-and-insertion-using-pcsc-in-c

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