[Pcsclite-muscle] PCSC-LITE more than one Card Reader.

Yusuf Bülbül y.bulbul
Thu May 18 02:16:14 PDT 2017


Hi.




I am using pcsclite for Ubuntu 16.04 TLS. I am developping a C++ application on QT.  I have a problem about pcsclite. Can you help me? I will be very glad, if you can.




When I use single card reader, everything is okey.  I can list readers and communicate them.  But, When I have plugged two smart card reader to usb hub,  I can't list all readers.  I can take only first smart card reader name. I can't take completed string  after '0/' for mszReaders.   I have tried the install last stable version of Pcsclite and ccid driver, but, it's same. I have stucked here.  pcsc-lite version:1.8.20, ccid driver version:1.4.99.









My code is;









    LONG rv;

    SCARDCONTEXT hContext;
    LPSTR mszReaders;
    DWORD dwReaders, dwActiveProtocol;

    DWORD dwState, dwProtocol, dwAtrLen, dwReaderLen;
    SCARD_IO_REQUEST pioSendPci;

    SCARDHANDLE hCard;



   if (SCardEstablishContext(SCARD_SCOPE_SYSTEM    , NULL, NULL, &hContext) == CARD_S_SUCCESS)
   {
       printf("SCardEstablishContext: Succesfull. rv: %ld \n", rv);

       LPSTR mszGroups;
       DWORD dwGroups;




       rv = SCardListReaderGroups(hContext, NULL, &dwGroups);
       mszGroups = (LPSTR)malloc(sizeof(char)*dwGroups);
       rv = SCardListReaderGroups(hContext, mszGroups, &dwGroups);
       printf("Group Readers: %s \n", mszGroups);

       dwReaders = SCARD_AUTOALLOCATE;

       if (SCardListReaders(hContext, NULL, (LPSTR)&mszReaders, &dwReaders) == SCARD_S_SUCCESS)
       {

           printf("reader name: %s\n", mszReaders);
           printf("dword: %ld\n", dwReaders);




      }




}









Output for one card reader plugged:




SCardEstablishContext: Succesfull. rv: 13672000
Group Readers: SCard$DefaultReaders
reader name: Microchip SEC1110 [CCID Interface] (D191B0BC) 01 00
dword: 53









Output for two Card Reader Plugged:




SCardEstablishContext: Succesfull. rv: 21179968
Group Readers: SCard$DefaultReaders
reader name: Microchip SEC1110 [CCID Interface] (71917A4C) 00 00
dword: 105









Thank You & Best Regards




Yusuf.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20170518/77bfa9ce/attachment.html>



More information about the pcsclite-muscle mailing list