src: add disposition parameter to disconnect
This commit is contained in:
@@ -84,10 +84,18 @@ CardReader.prototype.connect = function(options, cb) {
|
||||
}
|
||||
};
|
||||
|
||||
CardReader.prototype.disconnect = function(cb) {
|
||||
CardReader.prototype.disconnect = function(disposition, cb) {
|
||||
if (typeof disposition === 'function') {
|
||||
cb = disposition;
|
||||
disposition = undefined;
|
||||
}
|
||||
|
||||
if (typeof disposition !== 'number') {
|
||||
disposition = this.SCARD_UNPOWER_CARD;
|
||||
}
|
||||
|
||||
if (this.connected) {
|
||||
this._disconnect(cb);
|
||||
this._disconnect(disposition, cb);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user