[Pcsclite-muscle] Multiple command processing and card recognition

Ertan Küçükoğlu ertan at cronosmedikal.com
Fri Feb 8 12:50:43 PST 2019


Hello,

I am new to forum and pcsclite both. Thanks to everyone who has helped and
still helping.

I read sample C code from
https://ludovicrousseau.blogspot.com/2010/04/pcsc-sample-in-c.html I believe
I understand main process flow. What I need to do with DESFire/DESFire EV1
cards is:

1- Read ID of card.
2- Send command
3- Send command
4- Send command
5- ... (send other commands)
6- Send last command

Total number of commands will change. On average it will be about 20-30
commands but may go high to 40 commands or more in total and they will not
be firing one after other. There will be changing intervals between them.
Above sequence is for a single card. Once another card gets to be processed,
everything from number 1 repeats.

I am planning to use Lazarus (FreePascal aka fpc) object-oriented language
and planning to build myself a class so that I will not be needing to call
"SCardEstablishContext" and "SCardListReaders" frequently. I have following
questions:
A- How long can I keep Context and Reader without a need to call
"SCardReleaseContext"?
B- I need to auto identify when card is in range. What function(s) I should
be using for that?
C- Is it safe to call these functions constantly in a thread? More or less
24/7 non-stop? Do I need to wait between calls? For how long?

Thanks & regards,
Ertan Küçükoğlu





More information about the pcsclite-muscle mailing list