<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-09-27 23:50 GMT+02:00 Christophe FERRANDO <span dir="ltr"><<a href="mailto:christophe.ferrando@sylyca.com" target="_blank">christophe.ferrando@sylyca.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="FR"><div><p class="MsoNormal"><span style="color:rgb(87,88,90)">Hello,</span></p></div></div></blockquote><div><br></div><div>Hello Christophe,<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="FR"><br><div><p class="MsoNormal"><span style="color:rgb(87,88,90)"></span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">I am working on some tests for my product.</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">On of the test says :</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">Insert a card who does not support RAW PROTOCOL (A french health card : Vitale) : OK</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">First, call :</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">rv = SCardEstablishContext(SCARD_<wbr>SCOPE_USER, NULL, NULL, &hContext);</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">OK</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">Second, the return should be SCARD_E_NOT_READY</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">rv = SCardConnect(hContext,<wbr>mszReaders,SCARD_SHARE_DIRECT,</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">                               <wbr>                              <wbr>   -1, &hCard, &dwActiveProtocol);</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">The result is every time SUCCESS, even with no card, with RAW_PROTOCOL instead of -1, …</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">I don’t think i can have an error with this test ?</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"> </span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)">Any idea, how can i have the return SCARD_E_NOT_READY, which is present in the documentation of SCARD_CONNECT.</span></p><p class="MsoNormal"><span style="color:rgb(87,88,90)"></span></p></div></div></blockquote><br>SCARD_E_NOT_READY is not used by any pcsc-lite function.<br><br>SCARD_SHARE_DIRECT (on pcsc-lite) is used to talk to the reader, not to the card. So it is normal that you do not get an error if the card is not present or not responding.<br><br>The pcsc-lite API for SCardConnect() is at:<br><a href="https://pcsclite.alioth.debian.org/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5">https://pcsclite.alioth.debian.org/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5</a><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">A list of (major) differences between Windows PC/SC and pcsc-lite is available at <a href="https://pcsclite.alioth.debian.org/api/group__API.html#differences">https://pcsclite.alioth.debian.org/api/group__API.html#differences</a><br><br></div><div class="gmail_quote">Bye<br><br></div>-- <br><div class="gmail_signature"> Dr. Ludovic Rousseau</div>
</div></div>