santigimeno / node-pcsclite

Bindings over pcsclite to access Smart Cards
ISC License
171 stars 127 forks source link

example of a reader.control function #65

Open barisvelioglu opened 7 years ago

barisvelioglu commented 7 years ago

I am using ACR1252U-A1 for reader. I cannot do any transmit operations succesffully but I cannot get any response by using control command.

What I tried is

reader.control(new Buffer([0xE0, 0x00, 0x00, 0x18, 0x00]), 3500, 30, function(err, data)[
  console.log(data) // undefined
});

image

boris-savic commented 7 years ago

Control code should be set based on your OS.

So instead of directly using 3500 set it with reader.SCARD_CTL_CODE(3500)

reader.control(new Buffer([0xE0, 0x00, 0x00, 0x18, 0x00]), reader.SCARD_CTL_CODE(3500), 30, function(err, data)[
  console.log(data) // undefined
});
ellenlowing commented 4 years ago

That works like a charm. Thank you!