From 5d7f1efc9b7a91eac2319f7cdf5ed94a9e7e385d Mon Sep 17 00:00:00 2001 From: Martin Endler Date: Mon, 23 Dec 2024 15:01:53 +0100 Subject: [PATCH] Change Reader connect share_mode to SCARD_SHARE_EXCLUSIVE --- src/Reader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Reader.js b/src/Reader.js index e0156b5..ba280d5 100644 --- a/src/Reader.js +++ b/src/Reader.js @@ -26,6 +26,7 @@ export const KEY_TYPE_B = 0x61; export const CONNECT_MODE_DIRECT = 'CONNECT_MODE_DIRECT'; export const CONNECT_MODE_CARD = 'CONNECT_MODE_CARD'; +export const CONNECT_MODE_CARD_EXCLUSIVE = 'CONNECT_MODE_CARD_EXCLUSIVE'; class Reader extends EventEmitter { @@ -212,11 +213,12 @@ class Reader extends EventEmitter { } - connect(mode = CONNECT_MODE_CARD) { + connect(mode = CONNECT_MODE_CARD_EXCLUSIVE) { const modes = { [CONNECT_MODE_DIRECT]: this.reader.SCARD_SHARE_DIRECT, [CONNECT_MODE_CARD]: this.reader.SCARD_SHARE_SHARED, + [CONNECT_MODE_CARD_EXCLUSIVE]: this.reader.SCARD_SHARE_EXCLUSIVE, }; if (!modes[mode]) {