diff --git a/CHANGELOG.md b/CHANGELOG.md index deb55e3..7adcee1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Added support for NXP MIFARE Classic (1K, 4K variants) in `PcscCardCommunicationProtocol` with ATR pattern + `3B8F8001804F0CA00000030603000(1|2).*` according to PC/SC Part 3 Supplemental Document. +### Changed +- Changed default sharing mode from `EXCLUSIVE` to `SHARED` in `PcscReader.setSharingMode()` to improve compatibility + with multi-threaded applications. ### Fixed - Fixed PC/SC context contention on Linux by implementing separate contexts for monitoring and communication operations, preventing `SCARD_E_SHARING_VIOLATION` errors and thread blocking when using card presence detection concurrently with diff --git a/gradle.properties b/gradle.properties index ea95467..59932cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group = org.eclipse.keyple title = Keyple Plugin PCSC Java Lib description = Keyple add-on to manage PC/SC readers -version = 2.5.4-SNAPSHOT +version = 2.6.0-SNAPSHOT # Java Configuration javaSourceLevel = 1.8 diff --git a/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscCardCommunicationProtocol.java b/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscCardCommunicationProtocol.java index f169020..8ae835d 100644 --- a/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscCardCommunicationProtocol.java +++ b/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscCardCommunicationProtocol.java @@ -67,6 +67,23 @@ public enum PcscCardCommunicationProtocol { */ INNOVATRON_B_PRIME("3B8.8001(80)?5A0A.*"), + /** + * NXP MIFARE Classic technologies (1K, 4K variants). + * + *
According to PC/SC Part 3 Supplemental Document: + * + *
Default rule = {@code 3B8F8001804F0CA00000030603000(1|2).*} + * + * @since 2.6.0 + */ + MIFARE_CLASSIC("3B8F8001804F0CA00000030603000(1|2).*"), + /** * NXP MIFARE Ultralight technologies. * @@ -78,11 +95,11 @@ public enum PcscCardCommunicationProtocol { *
Default rule = {@code 3B8F8001804F0CA0000003060300030.*} + *
Default rule = {@code 3B8F8001804F0CA000000306030003.*} * * @since 2.5.0 */ - MIFARE_ULTRALIGHT("3B8F8001804F0CA0000003060300030.*"), + MIFARE_ULTRALIGHT("3B8F8001804F0CA000000306030003.*"), /** * STMicroelectronics ST25/SRT512 memory tags. diff --git a/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReader.java b/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReader.java index 3fa1eeb..d87d587 100644 --- a/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReader.java +++ b/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReader.java @@ -154,7 +154,7 @@ enum DisconnectionMode { } /** - * Changes the PC/SC sharing mode (default value {@link SharingMode#EXCLUSIVE}). + * Changes the PC/SC sharing mode (default value {@link SharingMode#SHARED}). * *
This mode will be used when a new {@link Card} is created. * diff --git a/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReaderAdapter.java b/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReaderAdapter.java index 68230b3..04ff454 100644 --- a/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReaderAdapter.java +++ b/src/main/java/org/eclipse/keyple/plugin/pcsc/PcscReaderAdapter.java @@ -54,7 +54,7 @@ final class PcscReaderAdapter private CardChannel channel; private Boolean isContactless; private String protocol = IsoProtocol.ANY.getValue(); - private boolean isModeExclusive = true; + private boolean isModeExclusive = false; private DisconnectionMode disconnectionMode = DisconnectionMode.RESET; private final AtomicBoolean loopWaitCard = new AtomicBoolean(); @@ -599,7 +599,7 @@ public void stopWaitForCardRemoval() { /** * {@inheritDoc} * - *
The default value is {@link SharingMode#EXCLUSIVE}. + *
The default value is {@link SharingMode#SHARED}. * * @since 2.0.0 */