[Pcsclite-muscle] Not receiving card removed event

Ludovic Rousseau ludovic.rousseau at gmail.com
Fri Sep 21 02:46:02 PDT 2018

Le ven. 21 sept. 2018 à 10:47, Sam Van Den Berge
<sam.van.den.berge at telenet.be> a écrit :
> Hello,


> I'm having an issue with the correct detection of a card removed event in
> pcscd v1.8.23. In my test case I use a card that is not a smart card.
> Obviously reading that card fails because it can't be powered on but afterwards
> the card removed event is not correctly propagated to my application.
> My application will go to the next state when the card is actually removed so
> to do this I first check if a card is currently present. If no card is present,
> I continue to the next state. If a card is present, I wait infinitely until the
> card is removed with a call to SCardGetStatusChange.
> Now, if the card is removed somewhere between checking if a card is present and
> waiting until the card is removed, the call to wait until the card is removed
> (SCardGetStatusChange) will never return.

Can you provide a sample code that exhibits the problem?

Does the problem always occurs if you remove the card between your
check for card present and the call to SCardGetStatusChange()?

> I've compiled pcsc with DO_TRACE and I attached the application log and pcscd
> log here. My comments are surrounded with ===.

You can also use another way to generate a trace of PC/SC calls.


 Dr. Ludovic Rousseau

More information about the pcsclite-muscle mailing list