Use the protocol parameter in CardReader.transmit
- We were simply hard-coding the T=0 protocol.
This commit is contained in:
@@ -51,7 +51,7 @@ Example
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log('Protocol(', this.name, '):', protocol);
|
||||
reader.transmit(new Buffer([0x00, 0xB0, 0x00, 0x00, 0x20]), 40, 1, function(err, data) {
|
||||
reader.transmit(new Buffer([0x00, 0xB0, 0x00, 0x00, 0x20]), 40, protocol, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
|
||||
@@ -30,7 +30,7 @@ pcsc.on('reader', function(reader) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log('Protocol(', this.name, '):', protocol);
|
||||
reader.transmit(new Buffer([0x00, 0xB0, 0x00, 0x00, 0x20]), 40, 1, function(err, data) {
|
||||
reader.transmit(new Buffer([0x00, 0xB0, 0x00, 0x00, 0x20]), 40, protocol, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
|
||||
@@ -416,7 +416,8 @@ void CardReader::DoTransmit(uv_work_t* req) {
|
||||
pthread_mutex_lock(&obj->m_mutex);
|
||||
/* Connected? */
|
||||
if (obj->m_card_handle) {
|
||||
result = SCardTransmit(obj->m_card_handle, SCARD_PCI_T0, ti->in_data, ti->in_len,
|
||||
SCARD_IO_REQUEST send_pci = { ti->card_protocol, sizeof(SCARD_IO_REQUEST) };
|
||||
result = SCardTransmit(obj->m_card_handle, &send_pci, ti->in_data, ti->in_len,
|
||||
&io_request, tr->data, &tr->len);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user