Skip to content

Commit

Permalink
cardreader: allow 0 as a valid protocol value
Browse files Browse the repository at this point in the history
  • Loading branch information
Samo Fortuna authored and santigimeno committed Feb 22, 2017
1 parent 51e9db2 commit 98a5269
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pcsclite.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ CardReader.prototype.connect = function(options, cb) {

options = options || {};
options.share_mode = options.share_mode || this.SCARD_SHARE_EXCLUSIVE;
options.protocol = options.protocol || this.SCARD_PROTOCOL_T0 | this.SCARD_PROTOCOL_T1;

if (typeof options.protocol === 'undefined' || options.protocol === null) {
options.protocol = this.SCARD_PROTOCOL_T0 | this.SCARD_PROTOCOL_T1;
}

if (!this.connected) {
this._connect(options.share_mode, options.protocol, cb);
Expand Down

0 comments on commit 98a5269

Please sign in to comment.