Page 1 of 1

searching for ways to check if the card is inserted in smartcard reader

Posted: Tue Sep 01, 2015 3:44 am
by shyjarod
As far as I know, Mode of Enquiry is the only way to check if the card is inserted in the smart card reader.
Check if the card is in the reader at set intervals during a "while" circulation.

I've already browse the code of scuba. It also uses the same way to confirm the card and then sends CardEvent.

Is there any interrupt check methods?
For example, register a card change function. When the card is extracted from the reader, it can inform me. In this case, I needn't to write the while circulation. In my opinion, Mode of Enquiry is not an excellent method after all.

Re: searching for ways to check if the card is inserted in smartcard reader

Posted: Wed Nov 04, 2015 3:13 am
by UNKNwYSHSA
Use the SCardStatusChange function.
You can have a look at implementation of CardMonitor class in pyScard project.
The class CardMonitor detect card status changing and notice CardMonitorObservers.
pySCard based on PCSC functions, so, you can implement the monitor function with other lanaguage(s) which can use PCSC functions.