Contains the event origin (reader name), the event type and possibly the card selection - * response (when available). + *
Contains the event origin (reader name), the event type and possibly the + * card selection response (when available). * * @since 1.0.0 */ @@ -81,16 +82,18 @@ class CardReaderEvent { virtual Type getType() const = 0; /** - * Returns the card selection responses when it is available and null in all other cases. It may - * be available when the event type is {@link Type#CARD_INSERTED} and always present when the - * event type is {@link Type#CARD_MATCHED}. + * Returns the card selection responses when it is available and null in all + * other cases. It may be available when the event type is {@link + * Type#CARD_INSERTED} and always present when the event type is {@link + * Type#CARD_MATCHED}. * *
It is necessary to use the method
* keypop::reader::selection::CardSelectionManager
- * ::parseScheduledCardSelectionsResponse(ScheduledCardSelectionsResponse) to analyze the
- * result.
+ * ::parseScheduledCardSelectionsResponse(ScheduledCardSelectionsResponse)
+ * to analyze the result.
*
- * @return Null if the event is not carrying a ScheduledCardSelectionsResponse.
+ * @return Null if the event is not carrying a
+ * ScheduledCardSelectionsResponse.
* @since 1.0.0
*/
virtual const std::shared_ptr The association between the communication protocol name known by the reader and the
- * communication protocol name defined by the application is intended to manage non-ISO cards.
- * It allows a unique protocol name to be set when constructing a card selector as defined by
+ * The association between the communication protocol name known by the
+ * reader and the communication protocol name defined by the application is
+ * intended to manage non-ISO cards. It allows a unique protocol name to be
+ * set when constructing a card selector as defined by
* the Keypop Card API regardless of the type of reader that will be used.
*
- * @param physicalProtocolName The name of the physical communication protocol as known by the
- * reader. See the reader documentation for the list of supported communication
- * protocols.
- * @param logicalProtocolName The name of the logical protocol associated with the cards
- * detected with the physical protocol also provided. This name can be used by the
- * application to perform filtering at the time of selection.
- * @throw IllegalArgumentException If one of the provided communication protocols is null or
- * empty.
- * @throw ReaderProtocolNotSupportedException If the reader communication protocol is not
- * supported.
+ * @param physicalProtocolName The name of the physical communication
+ * protocol as known by the reader. See the reader documentation for the
+ * list of supported communication protocols.
+ * @param logicalProtocolName The name of the logical protocol associated
+ * with the cards detected with the physical protocol also provided. This
+ * name can be used by the application to perform filtering at the time of
+ * selection.
+ * @throw IllegalArgumentException If one of the provided communication
+ * protocols is null or empty.
+ * @throw ReaderProtocolNotSupportedException If the reader communication
+ * protocol is not supported.
* @since 1.0.0
*/
virtual void activateProtocol(
- const std::string& physicalProtocolName, const std::string& logicalProtocolName)
+ const std::string& physicalProtocolName,
+ const std::string& logicalProtocolName)
= 0;
/**
- * Deactivates the provided reader communication protocol. Inhibits the detection of cards using
- * this reader communication protocol.
+ * Deactivates the provided reader communication protocol. Inhibits the
+ * detection of cards using this reader communication protocol.
*
- * @param physicalProtocolName The name of the physical communication protocol as known by the
- * reader. See the reader documentation for the list of supported communication
- * protocols.
- * @throw IllegalArgumentException If the provided reader communication protocol is null or
- * empty.
- * @throw ReaderProtocolNotSupportedException If the reader communication protocol is not
- * supported.
+ * @param physicalProtocolName The name of the physical communication
+ * protocol as known by the reader. See the reader documentation for the
+ * list of supported communication protocols.
+ * @throw IllegalArgumentException If the provided reader communication
+ * protocol is null or empty.
+ * @throw ReaderProtocolNotSupportedException If the reader communication
+ * protocol is not supported.
* @since 1.0.0
*/
- virtual void deactivateProtocol(const std::string& physicalProtocolName) = 0;
+ virtual void deactivateProtocol(const std::string& physicalProtocolName)
+ = 0;
/**
* Returns the name of the physical protocol currently used by the reader.
*
- * @return Null if no selection has been made yet or if no protocol has been activated.
+ * @return Null if no selection has been made yet or if no protocol has been
+ * activated.
* @see #activateProtocol(const std::string&, const std::string&)
* @since 1.2.0
*/
diff --git a/include/keypop/reader/ObservableCardReader.hpp b/include/keypop/reader/ObservableCardReader.hpp
index 7b0b190..2bca07d 100644
--- a/include/keypop/reader/ObservableCardReader.hpp
+++ b/include/keypop/reader/ObservableCardReader.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -56,15 +57,16 @@ class ObservableCardReader : virtual public CardReader {
*/
enum NotificationMode {
/**
- * All cards presented to the readers are notified to the observers, regardless of the
- * result of the selection.
+ * All cards presented to the readers are notified to the observers,
+ * regardless of the result of the selection.
*
* @since 1.0.0
*/
ALWAYS,
/**
- * Only the cards that have been successfully selected will be notified to the observers.
- * The others will be ignored and the application will not be aware of their presence.
+ * Only the cards that have been successfully selected will be notified
+ * to the observers. The others will be ignored and the application will
+ * not be aware of their presence.
*
* @since 1.0.0
*/
@@ -76,38 +78,47 @@ class ObservableCardReader : virtual public CardReader {
*
* The invocation of this method is mandatory when the reader has to be observed.
*
- * In case of a fatal error during the observation, the handler will receive a notification.
+ * In case of a fatal error during the observation, the handler will
+ * receive a notification.
*
- * @param exceptionHandler The exception handler implemented by the application.
+ * @param exceptionHandler The exception handler implemented by the
+ * application.
* @throws IllegalArgumentException If the provided handler is null.
* @since 1.0.0
*/
virtual void setReaderObservationExceptionHandler(
- std::shared_ptr The provided observer must implement the CardReaderObserverSpi interface to be able
- * to receive the events produced by this reader (card insertion, removal, etc.)
+ * The provided observer must implement the CardReaderObserverSpi
+ * interface to be able to receive the events produced by this reader (card
+ * insertion, removal, etc.)
*
- * @param observer An observer object implementing the required interface (should be not null).
+ * @param observer An observer object implementing the required interface
+ * (should be not null).
* @throw IllegalArgumentException If the provided observer is null.
* @since 1.0.0
*/
- virtual void addObserver(std::shared_ptr The observer will no longer receive any of the events produced by this reader.
+ * The observer will no longer receive any of the events produced by this
+ * reader.
*
* @param observer The observer object to be removed (should be not null).
* @throw IllegalArgumentException If the provided observer is null.
* @since 1.0.0
*/
- virtual void removeObserver(const std::shared_ptr The DetectionMode indicates the action to be followed after processing the card.
+ * The DetectionMode indicates the action to be followed after processing
+ * the card.
*
* @param detectionMode The card detection mode.
* @throw IllegalArgumentException If the provided detection mode is null.
@@ -144,19 +156,23 @@ class ObservableCardReader : virtual public CardReader {
virtual void stopCardDetection() = 0;
/**
- * Notifies the observation process that the processing of the card has been completed in order
- * to ensure that the card monitoring cycle runs properly.
+ * Notifies the observation process that the processing of the card has been
+ * completed in order to ensure that the card monitoring cycle runs
+ * properly.
*
- * This method has no effect if the physical communication channel has already been closed.
+ * This method has no effect if the physical communication channel has
+ * already been closed.
*
* It is mandatory to invoke this method when the physical communication channel with
* the card could not be closed properly. In practice, it is recommended to invoke this method in all cases (e.g. in a "finally"
- * statement) at the end of a card processing whatever the result.
+ * The channel closing is nominally managed during the last transmission
+ * with the card. However, there are cases where exchanges with the card are
+ * interrupted (e.g. by an exception), in which case it is necessary to
+ * explicitly close the channel using this method.
+ *
+ * In practice, it is recommended to invoke this method in all cases
+ * (e.g. in a "finally" statement) at the end of a card processing whatever
+ * the result.
*
* @since 1.0.0
*/
diff --git a/include/keypop/reader/ReaderApiFactory.hpp b/include/keypop/reader/ReaderApiFactory.hpp
index bad1dd2..0ac8791 100644
--- a/include/keypop/reader/ReaderApiFactory.hpp
+++ b/include/keypop/reader/ReaderApiFactory.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -30,26 +31,32 @@ using keypop::reader::selection::IsoCardSelector;
*/
class ReaderApiFactory {
public:
+ /**
+ *
+ */
+ virtual ~ReaderApiFactory() = default;
+
/**
* Returns a new instance of CardSelectionManager.
*
* @return A new instance of CardSelectionManager.
* @since 2.0.0
*/
- virtual std::shared_ptr The most likely reason is a physical disconnection of the reader, but other technical problems
- * may also be the origin of the failure.
+ * The most likely reason is a physical disconnection of the reader, but
+ * other technical problems may also be the origin of the failure.
*
* @since 1.0.0
*/
@@ -31,7 +32,9 @@ class ReaderCommunicationException final : public std::runtime_error {
* @since 1.0.0
*/
explicit ReaderCommunicationException(const std::string& message)
- : std::runtime_error(message) {
+ : std::runtime_error(message)
+ , mMessage(message)
+ {
}
/**
@@ -41,9 +44,26 @@ class ReaderCommunicationException final : public std::runtime_error {
*/
ReaderCommunicationException(
const std::string& message, const std::shared_ptr These filters are all optional but can also be combined.
*
- * If no filtering is specified, any card that responds when inserted in the reader will be
- * considered selected.
+ * If no filtering is specified, any card that responds when inserted in the
+ * reader will be considered selected.
*
- * Conversely, if one or more filters have been defined, the card will not be selected if one
- * of them rejects the card.
+ * Conversely, if one or more filters have been defined, the card will not be
+ * selected if one of them rejects the card.
*
* An instance of this interface can be obtained via the method {@link
* ReaderApiFactory#createBasicCardSelector()}.
diff --git a/include/keypop/reader/selection/CardSelectionManager.hpp b/include/keypop/reader/selection/CardSelectionManager.hpp
index 0d3a580..263e976 100644
--- a/include/keypop/reader/selection/CardSelectionManager.hpp
+++ b/include/keypop/reader/selection/CardSelectionManager.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -14,8 +15,8 @@
#include "keypop/reader/CardReader.hpp"
#include "keypop/reader/ObservableCardReader.hpp"
+#include "keypop/reader/cpp/CardSelectorBase.hpp"
#include "keypop/reader/selection/CardSelectionResult.hpp"
-#include "keypop/reader/selection/CardSelector.hpp"
#include "keypop/reader/selection/spi/CardSelectionExtension.hpp"
namespace keypop {
@@ -24,46 +25,48 @@ namespace selection {
using keypop::reader::CardReader;
using keypop::reader::ObservableCardReader;
-using keypop::reader::selection::CardSelectionResult;
-using keypop::reader::selection::CardSelector;
+using keypop::reader::cpp::CardSelectorBase;
using keypop::reader::selection::spi::CardSelectionExtension;
/**
- * Service dedicated to card selection, based on the preparation of a card selection scenario.
+ * Service dedicated to card selection, based on the preparation of a card
+ * selection scenario.
*
- * A card selection scenario consists of one or more selection cases based on a {@link
- * CardSelectionExtension}. A card selection scenario consists of one or more selection cases based on
+ * a CardSelectionExtension. If a card selection case fails, the service will try with the next card selection case defined
- * in the scenario, until there are no further card selection cases available.
+ * If a card selection case fails, the service will try with the next card
+ * selection case defined in the scenario, until there are no further card
+ * selection cases available.
*
* If a card selection case succeeds:
*
* The logical channel established with the card can be left open (default) or closed after card
- * selection (by using the {@link CardSelectionManager#prepareReleaseChannel()} method).
+ * The logical channel established with the card can be left open (default)
+ * or closed after card selection (by using the
+ * CardSelectionManager#prepareReleaseChannel() method).
*
* This service allows to:
*
* The multiple selection mode is disabled by default.
*
@@ -87,39 +90,42 @@ class CardSelectionManager {
/**
* Appends a card selection case to the card selection scenario.
*
- * The method returns the index giving the current position of the selection in the selection
- * scenario (0 for the first application, 1 for the second, etc.). This index will be used to
- * retrieve the corresponding result in the {@link CardSelectionResult} object.
+ * The method returns the index giving the current position of the
+ * selection in the selection scenario (0 for the first application, 1 for
+ * the second, etc.). This index will be used to retrieve the corresponding
+ * result in the {@link CardSelectionResult} object.
*
- * @param cardSelector The card selector containing the filters to be used to select the card.
- * @param cardSelectionExtension The card selection extension to be used to parse the card
- * selection response.
+ * @param cardSelector The card selector containing the filters to be used
+ * to select the card.
+ * @param cardSelectionExtension The card selection extension to be used to
+ * parse the card selection response.
* @return A non-negative int.
- * @throws IllegalArgumentException If the provided card selector or card selection extension is
- * null.
+ * @throws IllegalArgumentException If the provided card selector or card
+ * selection extension is null.
* @since 2.0.0
*/
virtual int prepareSelection(
- const std::shared_ptr It is thus possible to chain several selections on the same card selection scenario by
- * restarting the card connection sequence.
+ * It is thus possible to chain several selections on the same card
+ * selection scenario by restarting the card connection sequence.
*
* @since 1.0.0
*/
virtual void prepareReleaseChannel() = 0;
/**
- * Exports the current prepared card selection scenario to a string in string format.
+ * Exports the current prepared card selection scenario to a string in
+ * string format.
*
- * This string can be imported into the same or another card selection manager via the method
- * importCardSelectionScenario(const std::string&).
+ * This string can be imported into the same or another card selection
+ * manager via the method importCardSelectionScenario(const std::string&).
*
* @return A non-null string.
* @see importCardSelectionScenario(const std::string&)
@@ -130,47 +136,54 @@ class CardSelectionManager {
/**
* Imports a card selection scenario provided as a string in string format.
*
- * The string must have been exported from a card selection manager via the method
- * exportCardSelectionScenario().
+ * The string must have been exported from a card selection manager via
+ * the method exportCardSelectionScenario().
*
- * @param cardSelectionScenario The string containing the exported card selection scenario.
- * @return The index of the last imported selection in the card selection scenario.
+ * @param cardSelectionScenario The string containing the exported card
+ * selection scenario.
+ * @return The index of the last imported selection in the card selection
+ * scenario.
* @throws IllegalArgumentException If the string is null or malformed.
* @see exportCardSelectionScenario()
* @since 1.1.0
*/
- virtual int importCardSelectionScenario(const std::string& cardSelectionScenario) = 0;
+ virtual int
+ importCardSelectionScenario(const std::string& cardSelectionScenario)
+ = 0;
/**
- * Explicitely executes a previously prepared card selection scenario and returns the card
- * selection result.
+ * Explicitely executes a previously prepared card selection scenario and
+ * returns the card selection result.
*
* @param reader The reader to communicate with the card.
* @return A non-null reference.
* @throw IllegalArgumentException If the provided reader is null.
- * @throw ReaderCommunicationException If the communication with the reader has failed.
- * @throw CardCommunicationException If communication with the card has failed or if the status
- * word check is enabled in the card request and the card has returned an unexpected
- * code.
- * @throw InvalidCardResponseException If the card returned invalid data during the selection
- * process.
+ * @throw ReaderCommunicationException If the communication with the reader
+ * has failed.
+ * @throw CardCommunicationException If communication with the card has
+ * failed or if the status word check is enabled in the card request and the
+ * card has returned an unexpected code.
+ * @throw InvalidCardResponseException If the card returned invalid data
+ * during the selection process.
* @since 1.0.0
*/
virtual const std::shared_ptr calypsonet::terminal::reader::CardReaderEvent are pushed to the observer according to the
- * specified notification mode.
+ * calypsonet::terminal::reader::CardReaderEvent are pushed to the
+ * observer according to the specified notification mode.
*
* The result of the scenario execution will be analyzed by
* parseScheduledCardSelectionsResponse(ScheduledCardSelectionsResponse).
*
- * @param observableCardReader The reader with which the card communication is carried out.
- * @param notificationMode The card notification mode to use when a card is detected.
+ * @param observableCardReader The reader with which the card communication
+ * is carried out.
+ * @param notificationMode The card notification mode to use when a card is
+ * detected.
* @throw IllegalArgumentException If one of the parameters is null.
* @since 1.0.0
*/
@@ -180,77 +193,88 @@ class CardSelectionManager {
= 0;
/**
- * Analyzes the responses provided by a calypsonet::terminal::reader::CardReaderEvent
- * following the insertion of a card and the execution of the card selection scenario.
+ * Analyzes the responses provided by a
+ * calypsonet::terminal::reader::CardReaderEvent following the insertion of
+ * a card and the execution of the card selection scenario.
*
- * @param scheduledCardSelectionsResponse The card selection scenario execution response.
+ * @param scheduledCardSelectionsResponse The card selection scenario
+ * execution response.
* @return A non-null reference.
- * @throw IllegalArgumentException If the provided card selection response is null.
- * @throw InvalidCardResponseException If the data returned by the card could not be
- * interpreted.
+ * @throw IllegalArgumentException If the provided card selection response
+ * is null.
+ * @throw InvalidCardResponseException If the data returned by the card
+ * could not be interpreted.
* @since 1.0.0
*/
- virtual std::shared_ptr This string can be imported into the same or another card selection manager via the method
- * importProcessedCardSelectionScenario(const std::string&).
+ * This string can be imported into the same or another card selection
+ * manager via the method importProcessedCardSelectionScenario(const
+ * std::string&).
*
- * Prerequisite: the card selection scenario must first have been processed via the
- * processCardSelectionScenario(const std::shared_ptr Prerequisite: the card selection scenario must first have been
+ * processed via the processCardSelectionScenario(const
+ * std::shared_ptr Caution: if the local environment does not have the card extensions involved in the
- * selection scenario, then methods processCardSelectionScenario(const
- * std::shared_ptr Caution: if the local environment does not have the card extensions
+ * involved in the selection scenario, then methods
+ * processCardSelectionScenario(const std::shared_ptr Prerequisites:
*
* Each selection case prepared with the card selection manager is associated with an index
- * corresponding to its rank in the order of preparation. Each selection case prepared with the card selection manager is associated
+ * with an index corresponding to its rank in the order of preparation. These filters are all optional but can also be combined.
*
- * If no filtering is specified, any card that responds when inserted in the reader will be
- * considered selected.
+ * If no filtering is specified, any card that responds when inserted in the
+ * reader will be considered selected.
*
- * Conversely, if one or more filters have been defined, the card will not be selected if one of
- * them rejects the card.
+ * Conversely, if one or more filters have been defined, the card will not be
+ * selected if one of them rejects the card.
*
* @param The protocol is identified by its logical name.
*
* Prerequisites: the reader must be of type keypop::reader::ConfigurableCardReader
* and the targeted card protocol(s) must be activated via the
- * keypop::reader::ConfigurableCardReader#activateProtocol(const std::string&,
- * const std::string&) method and associated with the logical name used as a filter.
+ * keypop::reader::ConfigurableCardReader#activateProtocol(const
+ * std::string&, const std::string&) method and associated with the logical
+ * name used as a filter.
*
- * @param logicalProtocolName The logical name of the protocol to use as filter.
+ * @param logicalProtocolName The logical name of the protocol to use as
+ * filter.
* @return The current instance.
- * @throw IllegalArgumentException If the provided logical protocol name is null or empty.
+ * @throw IllegalArgumentException If the provided logical protocol name is
+ * null or empty.
* @since 2.0.0
*/
virtual T& filterByCardProtocol(const std::string& logicalProtocolName) = 0;
/**
- * Restricts the selection process to cards whose power-on data provided by the reader matches a
- * specific regular expression.
+ * Restricts the selection process to cards whose power-on data provided by
+ * the reader matches a specific regular expression.
*
* @param powerOnDataRegex The regular expression to use as filter.
* @return The current instance.
- * @throw IllegalArgumentException If the provided regular expression is null, empty or invalid.
+ * @throw IllegalArgumentException If the provided regular expression is
+ * null, empty or invalid.
* @since 2.0.0
*/
virtual T& filterByPowerOnData(const std::string& powerOnDataRegex) = 0;
diff --git a/include/keypop/reader/selection/CommonIsoCardSelector.hpp b/include/keypop/reader/selection/CommonIsoCardSelector.hpp
index b3b7035..0b3cf79 100644
--- a/include/keypop/reader/selection/CommonIsoCardSelector.hpp
+++ b/include/keypop/reader/selection/CommonIsoCardSelector.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -13,112 +14,44 @@
#include These filters are all optional but can also be combined.
*
- * If no filtering is specified, any card that responds when inserted in the reader will be
- * considered selected.
+ * If no filtering is specified, any card that responds when inserted in the
+ * reader will be considered selected.
*
- * Conversely, if one or more filters have been defined, the card will not be selected if one of
- * them rejects the card.
+ * Conversely, if one or more filters have been defined, the card will not be
+ * selected if one of them rejects the card.
*
* @param The DF is selected only if its name starts with the provided AID, as defined by ISO7816-4
- * chapter 4.2.
+ * The DF is selected only if its name starts with the provided AID, as
+ * defined by ISO7816-4 chapter 4.2.
*
- * The provided AID will be used as a parameter of the "Selection Application" ISO card
- * command.
+ * The provided AID will be used as a parameter of the "Selection
+ * Application" ISO card command.
*
* @param aid The AID as a byte array containing 5 to 16 bytes.
* @return The current instance.
- * @throw IllegalArgumentException If the provided array is null or out of range.
+ * @throw IllegalArgumentException If the provided array is null or out of
+ * range.
* @since 2.0.0
*/
virtual T& filterByDfName(const std::vector The DF is selected only if its name starts with the provided AID, as defined by ISO7816-4
- * chapter 4.2.
+ * The DF is selected only if its name starts with the provided AID, as
+ * defined by ISO7816-4 chapter 4.2.
*
- * The provided AID will be used as a parameter of the "Selection Application" ISO card
- * command.
+ * The provided AID will be used as a parameter of the "Selection
+ * Application" ISO card command.
*
* @param aid The AID as a hexadecimal string of 5 to 16 bytes.
* @return The current instance.
- * @throw IllegalArgumentException If the provided string is null, invalid or out of range.
+ * @throw IllegalArgumentException If the provided string is null, invalid
+ * or out of range.
* @since 2.0.0
*/
virtual T& filterByDfName(const std::string& aid) = 0;
@@ -161,7 +95,9 @@ class CommonIsoCardSelector These filters are all optional but can also be combined.
*
- * If no filtering is specified, any card that responds when inserted in the reader will be
- * considered selected.
+ * If no filtering is specified, any card that responds when inserted in the
+ * reader will be considered selected.
*
- * Conversely, if one or more filters have been defined, the card will not be selected if one of
- * them rejects the card.
+ * Conversely, if one or more filters have been defined, the card will not be
+ * selected if one of them rejects the card.
*
* An instance of this interface can be obtained via the method
* ReaderApiFactory#createIsoCardSelector().
diff --git a/include/keypop/reader/selection/ScheduledCardSelectionsResponse.hpp b/include/keypop/reader/selection/ScheduledCardSelectionsResponse.hpp
index 7b85371..81144b6 100644
--- a/include/keypop/reader/selection/ScheduledCardSelectionsResponse.hpp
+++ b/include/keypop/reader/selection/ScheduledCardSelectionsResponse.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -17,13 +18,13 @@ namespace selection {
* Response of the execution of a scheduled selection scenario provided by a
* calypsonet::terminal::reader::CardReaderEvent.
*
- * Contains the card's responses to one or more of the scenario's selection cases, i.e. the
- * data from the selection step itself and any responses to commands that may have been executed
- * afterwards.
+ * Contains the card's responses to one or more of the scenario's selection
+ * cases, i.e. the data from the selection step itself and any responses to
+ * commands that may have been executed afterwards.
*
* It is necessary to use the method
- * CardSelectionManager#parseScheduledCardSelectionsResponse(ScheduledCardSelectionsResponse) to
- * analyze the result.
+ * CardSelectionManager#parseScheduledCardSelectionsResponse(ScheduledCardSelectionsResponse)
+ * to analyze the result.
*
* @since 1.0.0
*/
diff --git a/include/keypop/reader/selection/spi/CardSelectionExtension.hpp b/include/keypop/reader/selection/spi/CardSelectionExtension.hpp
index b25d43f..a78b4e3 100644
--- a/include/keypop/reader/selection/spi/CardSelectionExtension.hpp
+++ b/include/keypop/reader/selection/spi/CardSelectionExtension.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -15,9 +16,10 @@ namespace selection {
namespace spi {
/**
- * SPI provided by a card extension, allowing to enrich a selection case with additional
- * commands if required, and to interpret the return to selection in order to build and fill the
- * specific SmartCard which acts as an image of the targeted card.
+ * SPI provided by a card extension, allowing to enrich a selection case with
+ * additional commands if required, and to interpret the return to selection in
+ * order to build and fill the specific SmartCard which acts as an image of the
+ * targeted card.
*
* @since 2.0.0
*/
diff --git a/include/keypop/reader/selection/spi/IsoSmartCard.hpp b/include/keypop/reader/selection/spi/IsoSmartCard.hpp
index de63cde..7050be1 100644
--- a/include/keypop/reader/selection/spi/IsoSmartCard.hpp
+++ b/include/keypop/reader/selection/spi/IsoSmartCard.hpp
@@ -1,14 +1,16 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
+#include The information that could be collected by the selection process, i.e. the power-on data or
- * the response to the "Select Application" command are made available. The information that could be collected by the selection process, i.e. the
+ * power-on data or the response to the "Select Application" command are made
+ * available. Must be implemented and possibly extended by a ISO card extension to meet its specific needs.
+ * Must be implemented and possibly extended by a ISO card extension to meet
+ * its specific needs.
*
* @since 2.0.0
*/
class IsoSmartCard : public SmartCard {
public:
/**
- * Gets the card data received in response to the "Select Application" command (including the
- * status word).
+ * Gets the card data received in response to the "Select Application"
+ * command (including the status word).
*
* @return Null if no selection application has been performed.
* @since 1.0.0
*/
- virtual const std::hecto& getSelectApplicationResponse() const = 0;
+ virtual const std::vector The power-on data that could be collected by the selection process are made available.
+ * The power-on data that could be collected by the selection process are
+ * made available.
*
- * Must be implemented and possibly extended by a card extension to meet its specific needs.
+ * Must be implemented and possibly extended by a card extension to meet its
+ * specific needs.
*
* @since 1.0.0
*/
@@ -34,13 +37,14 @@ class SmartCard {
virtual ~SmartCard() = default;
/**
- * Basic smart card with which communication has been established after a selection process
- * and which is ready to receive APDUs.
+ * Basic smart card with which communication has been established after a
+ * selection process and which is ready to receive APDUs.
*
- * The power-on data that could be collected by the selection process are made available.
+ * The power-on data that could be collected by the selection process are
+ * made available.
*
- * Must be implemented and possibly extended by a card extension to meet its specific
- * needs.
+ * Must be implemented and possibly extended by a card extension to meet
+ * its specific needs.
*
* @since 1.0.0
*/
diff --git a/include/keypop/reader/spi/CardReaderObservationExceptionHandlerSpi.hpp b/include/keypop/reader/spi/CardReaderObservationExceptionHandlerSpi.hpp
index aba0aca..020746b 100644
--- a/include/keypop/reader/spi/CardReaderObservationExceptionHandlerSpi.hpp
+++ b/include/keypop/reader/spi/CardReaderObservationExceptionHandlerSpi.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -18,8 +19,9 @@ namespace reader {
namespace spi {
/**
- * Reader observation error handler to implement in order to be notified of errors that may occur
- * during operations carried out by the card monitoring process.
+ * Reader observation error handler to implement in order to be notified of
+ * errors that may occur during operations carried out by the card monitoring
+ * process.
*
* @since 1.0.0
*/
diff --git a/include/keypop/reader/spi/CardReaderObserverSpi.hpp b/include/keypop/reader/spi/CardReaderObserverSpi.hpp
index f2ba02b..61696aa 100644
--- a/include/keypop/reader/spi/CardReaderObserverSpi.hpp
+++ b/include/keypop/reader/spi/CardReaderObserverSpi.hpp
@@ -1,11 +1,12 @@
-/**************************************************************************************************
- * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
- * *
- * This program and the accompanying materials are made available under the *
- * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
- * *
- * SPDX-License-Identifier: MIT *
- **************************************************************************************************/
+/******************************************************************************
+ * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
+ * *
+ * This program and the accompanying materials are made available under the *
+ * terms of the MIT License which is available at *
+ * https://opensource.org/licenses/MIT. *
+ * *
+ * SPDX-License-Identifier: MIT *
+ ******************************************************************************/
#pragma once
@@ -31,10 +32,13 @@ class CardReaderObserverSpi {
* The event notification should be done sequentially and synchronously but
* this may depend on the implementation used.
*
- * @param readerEvent The not null CardReaderEvent containing the event data.
+ * @param readerEvent The not null CardReaderEvent containing the event
+ * data.
* @since 1.0.0
*/
- virtual void onReaderEvent(const std::shared_ptr
- *
*
- *
- * The channel closing is nominally managed during the last transmission with the card. However,
- * there are cases where exchanges with the card are interrupted (e.g. by an exception), in
- * which case it is necessary to explicitly close the channel using this method.
- *
- *
- * A card selection case targets a specific card.
- * Optionally, additional commands can be defined to be executed after the successful selection of
- * the card.
+ *
A card selection case targets a specific card.
+ *
Optionally, additional commands can be defined to be executed after the
+ * successful selection of the card.
*
- *
*
*
- *
*
*
- * An instance of this interface can be obtained via the method {@link
- * ReaderApiFactory#createCardSelectionManager()}.
+ * An instance of this interface can be obtained via the method
+ * ReaderApiFactory#createCardSelectionManager().
*
* @since 1.0.0
*/
@@ -75,8 +78,8 @@ class CardSelectionManager {
virtual ~CardSelectionManager() = default;
/**
- * Sets the multiple selection mode to process all selection cases even in case of a successful
- * selection.
+ * Sets the multiple selection mode to process all selection cases even in
+ * case of a successful selection.
*
*
- *
*
- * @param processedCardSelectionScenario The string containing the exported processed card
- * selection scenario.
+ * @param processedCardSelectionScenario The string containing the exported
+ * processed card selection scenario.
* @return A non-null reference.
- * @throw IllegalArgumentException If the string is null, malformed or contains more card
- * selection cases than the current card selection scenario.
- * @throw InvalidCardResponseException If the data returned by the card could not be
- * interpreted.
+ * @throw IllegalArgumentException If the string is null, malformed or
+ * contains more card selection cases than the current card selection
+ * scenario.
+ * @throw InvalidCardResponseException If the data returned by the card
+ * could not be interpreted.
* @see exportProcessedCardSelectionScenario()
* @since 1.3.0
*/
virtual const std::shared_ptr
- * The same index is used here to find out which selection cases were successful.
- * However, only one case will correspond to the selected card state. The getters of this interface
- * allow to make use of these results according to the configurations and the needs of the
- * application.
+ *
The
+ * same index is used here to find out which selection cases were
+ * successful.
However, only one case will correspond to the selected card
+ * state. The getters of this interface allow to make use of these results
+ * according to the configurations and the needs of the application.
*
* @since 1.0.0
*/
class CardSelectionResult {
public:
/**
- * Gets all SmartCard corresponding to all successful selection cases in a map for which
- * the key is the selection index provided by the
+ * Gets all SmartCard corresponding to all successful selection cases in a
+ * map for which the key is the selection index provided by the
* CardSelectionManager#prepareSelection(CardSelection) method.
*
* @return A not null but possibly empty map.
* @since 1.0.0
*/
- virtual const std::map
- * Both are optional but cannot be null at the same time.
+ *
Both are optional but cannot be null at the same time.
*
- *