mk09
mk09

Reputation: 373

Detection of smart card removal and insertion using PCSC in C

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?

Upvotes: 5

Views: 5400

Answers (1)

arminb
arminb

Reputation: 2093

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.

Upvotes: 6

Related Questions