问题
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