Skip to content

Commit

Permalink
Change Reader connect share_mode to SCARD_SHARE_EXCLUSIVE
Browse files Browse the repository at this point in the history
  • Loading branch information
pokusew committed Dec 23, 2024
1 parent f2284c0 commit 8837086
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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]) {
Expand Down

0 comments on commit 8837086

Please sign in to comment.