-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement reconnect / SCardReconnect #10
Comments
+1 |
@iboxgithub do you have a sample code explaining your issue? |
Hi, sure var pcsc = Npm.require('pcsclite');
|
is this example relevant? |
I don't know. I'll try to implement the SCardReconnect wrapper as soon as I can if you think it can solve your issues |
Thank you very much !!! |
@iboxgithub WIP implementation here: #34. Could you test it and see if it works for you? |
Hi Santiago, sorry about that but I have no clue how to update your package with your commit on my computer (I used the npm install command at the first time), if you give me quick steps I take care about it right after. Thanks again a lot for your help and concern. |
Let me know if this works for you:
|
Hi, excuse me I didn't give feedback I came back home super late. function exit() { Now, looking at the pcslite doc there I am trying to find the difference of state of my card when it had ALREADY been connected in order to put the reconnect in a loop but variables like reader.SCARD_SHARE_SHARED or reader.SCARD_RESET_CARD alwys have the same value, do you know which one will say 'the card is locked'? Thanks for your help, I keep on testing on my side |
|
@iboxgithub I think it's pretty well explained in the documentation. If a command you execute returns |
Yes you are right it is straightforward, nevertheless my problem is that in JS I never catch it (0x80100068L), just Sharing violation. (0x8010000b) I still use the same code (totally pasted from Ludovic Rousseau blog), triggered on a button click from a web interface. pcsc.on('reader', function(reader) {
|
Despite the fact I am able to make it work within the same pcsc.on bloc, I am not able to create a new bloc and connect again, I will always have a sharing violation. Could this come from dwShareMode that is on Exclusive by default? |
@iboxgithub It looks like that. Have you tried using As a side note, I think I should add the actual error code in the Error object |
Thanks, I succeeded to do when I wanted with SCARD_SHARE_SHARED set up in the connect function (I tried before but not using the good parameter -_-) So, in this case there's indeed no need for the Reconnect function, but remains the case where the error SCARD_W_RESET_CARD would be returned. When the error object will be updated with that let me know, I will test it |
More generally what are the steps that occured when I restart my server? Because now that I copied this prototype in my real code where several transmit can occur I have an erratic behavior :
So the best would be to everytime "simulate" a server restart (from the card reader POV) to have a real reconnection function no? There would be no more need for a share mode, am I missing something by inexperience? |
@iboxgithub I'm not sure I follow... can you post code that causes the error? |
My apologies, I was not properly handling an error, it is solved now, so no need to take care about my last post. The Error object returned topic stays on the table (even though not impacting me). |
@iboxgithub That's great news! Thanks for following up the issue |
No description provided.
The text was updated successfully, but these errors were encountered: