Implement SCardControl
This commit is contained in:
@@ -92,6 +92,21 @@ CardReader.prototype.transmit = function(data, res_len, protocol, cb) {
|
||||
this._transmit(data, res_len, protocol, cb);
|
||||
};
|
||||
|
||||
CardReader.prototype.control = function(data, control_code, res_len, cb) {
|
||||
if (!this.connected) {
|
||||
return cb(new Error("Card Reader not connected"));
|
||||
}
|
||||
|
||||
var output = new Buffer(res_len);
|
||||
this._control(data, control_code, output, function(err, len) {
|
||||
if (err) {
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
cb(err, output.slice(0, len));
|
||||
});
|
||||
};
|
||||
|
||||
CardReader.prototype.SCARD_STATE_UNAWARE = 0x0000;
|
||||
CardReader.prototype.SCARD_STATE_IGNORE = 0x0001;
|
||||
CardReader.prototype.SCARD_STATE_CHANGED = 0x0002;
|
||||
|
||||
Reference in New Issue
Block a user