[Pcsclite-muscle] pcsc-lite & SCardLocateCardsByATR() function

Lev Serebryakov lev
Fri Oct 14 05:58:17 PDT 2011


Hello, Ludovic.
You wrote 14 ??????? 2011 ?., 16:22:41:

>> ?I'm porting some software, which uses WinSCard API, from Windows to
>> ?Linux with pcsc-lite.
>> ?Almost everything is Ok, but this software uses one call, which is
>> ?absent in PCSC-Lite implementation: SCardLocateCardsByATR(), and
>> ?structure SCARD_ATRMASK.
>>
>> ? This API is used to find cardreader with card of specific vendor,
>> ?with which this software works: it looks like, tat call returns all
>> ?available cradreaders and cards, seen by them, and select cards,
>> ?which have specific attributes (it checks many bytes in returned
>> ?SCARD_ATRMASK to be specific one, looks like long "magic number").
>>
>> ? How this API could be emulated in terms of pcsc-lite API? I could
>> ?not find any similar APIs in pcsc-lite.
> If you want to know in which reader is inserted the card you are
> looking for you can use SCardListReaders() to list the readers and
> then SCardGetStatusChange() to get the ATR of the cards in the
> different readers.
   Yep, it seems, that SCardLocateCardsByATR() is wrapper (with loop
 and some checks) around these two functions. I think, I understand
 how to re-implement it by myself, thank you :)


-- 
// Black Lion AKA Lev Serebryakov <lev at serebryakov.spb.ru>





More information about the pcsclite-muscle mailing list