Skip to content

Commit 761027e

Browse files
fix: correct card selection preparation in PC/SC examples
1 parent 452a7d6 commit 761027e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
7+
### Fixed
8+
- Fixed bad preparation of the selection in PC/SC examples.
79

810
## [2025-04-18]
911
### Changed

Example_Plugin_PCSC/src/main/java/org/eclipse/keyple/plugin/pcsc/example/UseCase3_ChangeProtocolRules/Main_ChangeProtocolRules_Pcsc.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ public static void main(String[] args) {
113113
.filterByCardProtocol(CARD_PROTOCOL_MIFARE_CLASSIC_4_K);
114114

115115
// Prepare the selection by adding the created generic selection to the card selection scenario.
116-
cardSelectionManager.prepareSelection(cardSelector, null);
116+
cardSelectionManager.prepareSelection(
117+
cardSelector, cardExtension.createGenericCardSelectionExtension());
117118

118119
// Actual card communication: run the selection scenario.
119120
CardSelectionResult selectionResult = cardSelectionManager.processCardSelectionScenario(reader);

Example_Plugin_PCSC/src/main/java/org/eclipse/keyple/plugin/pcsc/example/UseCase4_TransmitControl/Main_TransmitControl_Pcsc.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ public static void main(String[] args) throws InterruptedException {
101101
}
102102

103103
// Get the generic card extension service
104-
GenericExtensionService genericExtensionService = GenericExtensionService.getInstance();
104+
GenericExtensionService cardExtension = GenericExtensionService.getInstance();
105105

106106
// check the extension
107-
smartCardService.checkCardExtension(genericExtensionService);
107+
smartCardService.checkCardExtension(cardExtension);
108108

109109
ReaderApiFactory readerApiFactory = smartCardService.getReaderApiFactory();
110110
// Get the core card selection manager.
@@ -115,7 +115,8 @@ public static void main(String[] args) throws InterruptedException {
115115
IsoCardSelector cardSelector = readerApiFactory.createIsoCardSelector().filterByDfName(AID);
116116

117117
// Prepare the selection by adding the created generic selection to the card selection scenario.
118-
cardSelectionManager.prepareSelection(cardSelector, null);
118+
cardSelectionManager.prepareSelection(
119+
cardSelector, cardExtension.createGenericCardSelectionExtension());
119120

120121
// Schedule the selection scenario, always notify card presence.
121122
cardSelectionManager.scheduleCardSelectionScenario(

0 commit comments

Comments
 (0)