Keyple C++
0.9.0
Keyple, an Open Source SDK for Ticketing
|
#include <StubReaderImpl.h>
Inherits keyple::core::seproxy::plugin::AbstractObservableLocalReader, keyple::plugin::stub::StubReader, keyple::core::seproxy::plugin::SmartInsertionReader, and keyple::core::seproxy::plugin::SmartRemovalReader.
Public Member Functions | |
StubReaderImpl (const std::string &pluginName, const std::string &readerName) | |
StubReaderImpl (const std::string &pluginName, const std::string &name, TransmissionMode transmissionMode) | |
~StubReaderImpl () | |
void | closePhysicalChannel () override |
std::vector< uint8_t > | transmitApdu (const std::vector< uint8_t > &apduIn) override |
void | setParameter (const std::string &name, const std::string &value) override |
const std::map< const std::string, const std::string > & | getParameters () const override |
const TransmissionMode & | getTransmissionMode () const override |
void | insertSe (std::shared_ptr< StubSecureElement > _se) override |
void | removeSe () override |
std::shared_ptr< StubSecureElement > | getSe () override |
bool | waitForCardPresent () override |
void | stopWaitForCard () override |
bool | waitForCardAbsentNative () override |
void | stopWaitForCardRemoval () override |
bool | checkSePresence () override |
![]() | |
AbstractObservableLocalReader (const std::string &pluginName, const std::string &readerName) | |
virtual | ~AbstractObservableLocalReader ()=default |
bool | isSePresent () override |
void | startSeDetection (const ObservableReader::PollingMode pollingMode) final |
void | stopSeDetection () final |
void | setDefaultSelectionRequest (std::shared_ptr< AbstractDefaultSelectionsRequest > defaultSelectionsRequest, const ObservableReader::NotificationMode ¬ificationMode) final |
void | setDefaultSelectionRequest (std::shared_ptr< AbstractDefaultSelectionsRequest > defaultSelectionsRequest, const ObservableReader::NotificationMode ¬ificationMode, const ObservableReader::PollingMode pollingMode) final |
virtual std::shared_ptr< ReaderEvent > | processSeInserted () |
bool | isSePresentPing () |
void | processSeRemoved () |
const ObservableReader::PollingMode & | getPollingMode () const |
const MonitoringState & | getCurrentMonitoringState () const |
void | switchState (const MonitoringState stateId) |
void | addObserver (const std::shared_ptr< ObservableReader::ReaderObserver > observer) final |
void | removeObserver (const std::shared_ptr< ObservableReader::ReaderObserver > observer) final |
void | notifyObservers (const std::shared_ptr< ReaderEvent > event) final |
int | countObservers () const final |
void | clearObservers () final |
void | terminateSeCommunication () override |
void | finalizeSeProcessing () override |
void | onEvent (const InternalEvent event) |
![]() | |
AbstractLocalReader (const std::string &pluginName, const std::string &readerName) | |
virtual | ~AbstractLocalReader ()=default |
virtual bool | isLogicalChannelOpen () const final |
void | addSeProtocolSetting (std::shared_ptr< SeProtocol > seProtocol, const std::string &protocolRule) override |
virtual void | setSeProtocolSetting (const std::map< std::shared_ptr< SeProtocol >, std::string > &protocolSetting) override |
virtual std::shared_ptr< SelectionStatus > | openLogicalChannel (std::shared_ptr< SeSelector > seSelector) |
std::shared_ptr< SelectionStatus > | openLogicalChannelAndSelect (std::shared_ptr< SeSelector > seSelector) |
virtual std::vector< std::shared_ptr< SeResponse > > | processSeRequests (const std::vector< std::shared_ptr< SeRequest >> &seRequests, const MultiSeRequestProcessing &multiSeRequestProcessing, const ChannelControl &channelControl) override |
virtual std::shared_ptr< SeResponse > | processSeRequest (const std::shared_ptr< SeRequest > seRequest, const ChannelControl &channelControl) override |
![]() | |
std::vector< std::shared_ptr< SeResponse > > | transmitSeRequests (const std::vector< std::shared_ptr< SeRequest >> &seRequests, const MultiSeRequestProcessing &multiSeRequestProcessing, const ChannelControl &channelControl) override |
std::shared_ptr< SeResponse > | transmitSeRequest (std::shared_ptr< SeRequest > seRequest, const ChannelControl &channelControl) override |
const std::string & | getPluginName () const |
const std::string & | getName () const override |
![]() | |
AbstractSeProxyComponent (const std::string &name) | |
virtual | ~AbstractSeProxyComponent ()=default |
const std::string & | getName () const |
void | setParameters (const std::map< const std::string, const std::string > ¶meters) |
![]() | |
virtual | ~SeReader () |
virtual bool | operator== (const SeReader &o) const |
![]() | |
virtual | ~ProxyElement ()=default |
virtual void | setParameters (const std::map< const std::string, const std::string > ¶meters) |
![]() | |
ObservableReaderNotifier () | |
virtual | ~ObservableReaderNotifier () |
![]() | |
virtual | ~ObservableReader ()=default |
virtual void | addObserver (const std::shared_ptr< ReaderObserver > observer)=0 |
virtual void | removeObserver (const std::shared_ptr< ReaderObserver > observer)=0 |
![]() | |
virtual | ~StubReader ()=default |
![]() | |
virtual | ~SmartInsertionReader () |
![]() | |
virtual | ~SmartRemovalReader () |
Protected Member Functions | |
const std::vector< uint8_t > & | getATR () override |
bool | isPhysicalChannelOpen () override |
void | openPhysicalChannel () override |
bool | protocolFlagMatches (const std::shared_ptr< SeProtocol > protocolFlag) override |
std::shared_ptr< ObservableReaderStateService > | initStateService () override |
![]() | |
void | closeLogicalAndPhysicalChannels () |
virtual void | setForceGetDataFlag (bool forceGetDataFlag) |
void | closeLogicalChannel () |
std::shared_ptr< ApduResponse > | processApduRequest (std::shared_ptr< ApduRequest > apduRequest) |
const std::map< std::shared_ptr< SeProtocol >, std::string > & | getProtocolsMap () const |
![]() | |
AbstractReader (const std::string &pluginName, const std::string &name) | |
virtual | ~AbstractReader ()=default |
Protected Attributes | |
std::shared_ptr< ExecutorService > | mExecutorService |
![]() | |
std::shared_ptr< ObservableReaderStateService > | mStateService |
![]() | |
std::shared_ptr< DefaultSelectionsRequest > | mDefaultSelectionsRequest |
ObservableReader::NotificationMode | mNotificationMode |
Additional Inherited Members | |
![]() | |
enum | PollingMode { PollingMode::REPEATING, PollingMode::SINGLESHOT } |
![]() | |
std::atomic< bool > | mShuttingDown |
![]() | |
static bool | startsWith (const std::vector< uint8_t > &source, const std::vector< uint8_t > &match) |
keyple::plugin::stub::StubReaderImpl::StubReaderImpl | ( | const std::string & | pluginName, |
const std::string & | readerName | ||
) |
Do not use directly
pluginName | |
readerName |
keyple::plugin::stub::StubReaderImpl::StubReaderImpl | ( | const std::string & | pluginName, |
const std::string & | name, | ||
TransmissionMode | transmissionMode | ||
) |
Specify
pluginName | |
name | |
transmissionMode |
keyple::plugin::stub::StubReaderImpl::~StubReaderImpl | ( | ) |
|
overridevirtual |
Wrapper for the native method of the plugin specific local reader to verify the presence of the SE.
This method must be implemented by the ProxyReader plugin (e.g. Pcsc reader plugin).
This method is invoked by isSePresent.
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implements keyple::core::seproxy::plugin::AbstractLocalReader.
|
overridevirtual |
Closes the current physical channel.
This method must be implemented by the ProxyReader plugin (e.g. Pcsc/Nfc/Omapi Reader).
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implements keyple::core::seproxy::plugin::AbstractLocalReader.
|
overrideprotectedvirtual |
This abstract method must be implemented by the derived class in order to provide the SE ATR when available.
Gets the SE Answer to reset
Implements keyple::core::seproxy::plugin::AbstractLocalReader.
|
overridevirtual |
Gets the parameters
Implements keyple::core::seproxy::ProxyElement.
|
overridevirtual |
Get inserted SE
Implements keyple::plugin::stub::StubReader.
|
overridevirtual |
Implements keyple::core::seproxy::SeReader.
|
overrideprotectedvirtual |
Initialize the ObservableReaderStateService with the possible states and their implementation. ObservableReaderStateService define the initial state.
Make sure to initialize the stateService in your reader constructor with stateService = initStateService()
Implements keyple::core::seproxy::plugin::AbstractObservableLocalReader.
|
overridevirtual |
STATE CONTROLLERS FOR INSERTING AND REMOVING SECURE ELEMENT
Implements keyple::plugin::stub::StubReader.
|
overrideprotectedvirtual |
Tells if the physical channel is open or not
This method must be implemented by the ProxyReader plugin (e.g. Pcsc/Nfc/Omapi Reader).
Implements keyple::core::seproxy::plugin::AbstractLocalReader.
|
overrideprotectedvirtual |
This abstract method must be implemented by the derived class in order to provide a selection and ATR filtering mechanism.
The Selector provided in argument holds all the needed data to handle the Application Selection and ATR matching process and build the resulting SelectionStatus.
seSelector | the SE selector |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implements keyple::core::seproxy::plugin::AbstractLocalReader.
|
overrideprotectedvirtual |
Test if the current protocol matches the provided protocol flag.
The method must be implemented by the ProxyReader plugin.
The protocol flag is used to retrieve from the protocolsMap the String used to differentiate this particular protocol. (e.g. in PC/SC the only way to identify the SE protocol is to analyse the ATR returned by the reader [ISO SE and memory card SE have specific ATR], in Android Nfc the SE protocol can be deduced with the TagTechnology interface).
protocolFlag | the protocol flag |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implements keyple::core::seproxy::plugin::AbstractLocalReader.
|
overridevirtual |
Remove se from reader if any
Implements keyple::plugin::stub::StubReader.
|
overridevirtual |
This method has to be implemented by the reader plugin.
Allows to define a proprietary setting for a reader or a plugin (contactless protocols polling sequence, baud rate, … etc.).
key | the parameter key |
value | the parameter value |
IllegalArgumentException | if the parameter or the value is not supported |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implements keyple::core::seproxy::plugin::AbstractSeProxyComponent.
|
overridevirtual |
Interrupts the waiting of a SE
Reimplemented from keyple::core::seproxy::plugin::SmartInsertionReader.
|
overridevirtual |
Interrupts the waiting of the removal of the SE
Reimplemented from keyple::core::seproxy::plugin::SmartRemovalReader.
|
overridevirtual |
Transmits a single APDU and receives its response.
This abstract method must be implemented by the ProxyReader plugin (e.g. Pcsc, Nfc). The implementation must handle the case where the SE response is 61xy and execute the appropriate get response command.
apduIn | byte buffer containing the ingoing data |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implements keyple::core::seproxy::plugin::AbstractLocalReader.
|
overridevirtual |
Defined in the keyple::core::seproxy::plugin::local::SmartRemovalReader interface, this method is called by the monitoring thread to check SE absence
Implements keyple::core::seproxy::plugin::SmartRemovalReader.
|
overridevirtual |
This method is called by the monitoring thread to check SE presence
Implements keyple::core::seproxy::plugin::SmartInsertionReader.
|
protected |