cardreader: add SCARD_CTL_CODE js implementation

This commit is contained in:
Samo Fortuna
2017-02-22 12:20:53 +01:00
committed by Santiago Gimeno
parent 98a5269015
commit 1a369f0fad

View File

@@ -140,6 +140,15 @@ CardReader.prototype.control = function(data, control_code, res_len, cb) {
});
};
CardReader.prototype.SCARD_CTL_CODE = function(code) {
var isWin = /^win/.test(process.platform);
if (isWin) {
return (0x31 << 16 | (code) << 2);
} else {
return 0x42000000 + (code);
}
};
// extend prototype
function inherits(target, source) {
for (var k in source.prototype) {