{"action":"created","issue":{"url":"https://api.github.com/repos/santigimeno/node-pcsclite/issues/10","labels_url":"https://api.github.com/repos/santigimeno/node-pcsclite/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/santigimeno/node-pcsclite/issues/10/comments","events_url":"https://api.github.com/repos/santigimeno/node-pcsclite/issues/10/events","html_url":"https://github.com/santigimeno/node-pcsclite/issues/10","id":39605023,"number":10,"title":"Implement reconnect / SCardReconnect","user":{"login":"santigimeno","id":1084056,"avatar_url":"https://avatars.githubusercontent.com/u/1084056?v=3","gravatar_id":"","url":"https://api.github.com/users/santigimeno","html_url":"https://github.com/santigimeno","followers_url":"https://api.github.com/users/santigimeno/followers","following_url":"https://api.github.com/users/santigimeno/following{/other_user}","gists_url":"https://api.github.com/users/santigimeno/gists{/gist_id}","starred_url":"https://api.github.com/users/santigimeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santigimeno/subscriptions","organizations_url":"https://api.github.com/users/santigimeno/orgs","repos_url":"https://api.github.com/users/santigimeno/repos","events_url":"https://api.github.com/users/santigimeno/events{/privacy}","received_events_url":"https://api.github.com/users/santigimeno/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/santigimeno/node-pcsclite/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-08-06T09:42:32Z","updated_at":"2015-05-21T21:07:30Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/santigimeno/node-pcsclite/issues/comments/104420401","html_url":"https://github.com/santigimeno/node-pcsclite/issues/10#issuecomment-104420401","issue_url":"https://api.github.com/repos/santigimeno/node-pcsclite/issues/10","id":104420401,"user":{"login":"iboxgithub","id":5391993,"avatar_url":"https://avatars.githubusercontent.com/u/5391993?v=3","gravatar_id":"","url":"https://api.github.com/users/iboxgithub","html_url":"https://github.com/iboxgithub","followers_url":"https://api.github.com/users/iboxgithub/followers","following_url":"https://api.github.com/users/iboxgithub/following{/other_user}","gists_url":"https://api.github.com/users/iboxgithub/gists{/gist_id}","starred_url":"https://api.github.com/users/iboxgithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iboxgithub/subscriptions","organizations_url":"https://api.github.com/users/iboxgithub/orgs","repos_url":"https://api.github.com/users/iboxgithub/repos","events_url":"https://api.github.com/users/iboxgithub/events{/privacy}","received_events_url":"https://api.github.com/users/iboxgithub/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T21:07:30Z","updated_at":"2015-05-21T21:07:30Z","body":"Hi, sure\r\n\r\nvar pcsc = Npm.require('pcsclite');\r\n        var pcsc = pcsc(); //todo: change var name ?\r\n\r\n        pcsc.on('reader', function(reader) {\r\n\r\n            function exit() {\r\n                reader.close();\r\n                pcsc.close();\r\n            }\r\n\r\n            console.log('Using card reader: ', reader.name);\r\n\r\n            reader.connect(/*this.SCARD_SHARE_SHARED,*/function(err, protocol) { \r\n                if (err) {\r\n                    console.log('Connection between middleware and card failed: ' + err);\r\n                    return exit();\r\n                }\r\n\r\n                //Get length\r\n                cmd_1 = new Buffer([0x80, 0x04, 0x00, 0x00, 0x00]);\r\n                reader.transmit(cmd_1, 255, protocol, function(err, data) {\r\n                    if (err) {\r\n                        console.log(err);\r\n                    }\r\n                    else{\r\n                        console.log('Data received: ', data);\r\n                    }\r\n                    return exit();\r\n                });\r\n            });\r\n\r\n            reader.on('end', function() {\r\n                console.log('***********************************************');\r\n            });\r\n        });\r\n        pcsc.on('error', function(err) {\r\n            console.log('PCSC error', err.message);\r\n        });"}}