Keyple Plugin PC/SC C++ Library - 2.5.2
Component of the Keyple C++ middleware
PcscPluginFactoryAdapter.cpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional *
5 * information regarding copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the *
8 * terms of the Eclipse Public License 2.0 which is available at *
9 * http://www.eclipse.org/legal/epl-2.0 *
10 * *
11 * SPDX-License-Identifier: EPL-2.0 *
12 ******************************************************************************/
13
14#include "keyple/plugin/pcsc/PcscPluginFactoryAdapter.hpp"
15
16#include "keyple/core/common/CommonApiProperties.hpp"
17#include "keyple/core/plugin/PluginApiProperties.hpp"
18#include "keyple/plugin/pcsc/PcscPluginAdapter.hpp"
19#include "keyple/plugin/pcsc/PcscPluginFactory.hpp"
20
21namespace keyple {
22namespace plugin {
23namespace pcsc {
24
25using keyple::core::common::CommonApiProperties_VERSION;
26using keyple::core::plugin::PluginApiProperties_VERSION;
27
28const std::string PcscPluginFactoryAdapter::PLUGIN_NAME = "PcscPlugin";
29
30PcscPluginFactoryAdapter::PcscPluginFactoryAdapter(
31 const std::shared_ptr<Pattern> contactlessReaderIdentificationFilterPattern,
32 const std::map<std::string, std::string>& protocolRulesMap,
33 const int cardMonitoringCycleDuration)
34: mProtocolRulesMap(protocolRulesMap)
35, mContactlessReaderIdentificationFilterPattern(
36 contactlessReaderIdentificationFilterPattern)
37, mCardMonitoringCycleDuration(cardMonitoringCycleDuration)
38{
39}
40
41const std::string
42PcscPluginFactoryAdapter::getPluginApiVersion() const
43{
44 return PluginApiProperties_VERSION;
45}
46
47const std::string
48PcscPluginFactoryAdapter::getCommonApiVersion() const
49{
50 return CommonApiProperties_VERSION;
51}
52
53const std::string&
54PcscPluginFactoryAdapter::getPluginName() const
55{
56 return PLUGIN_NAME;
57}
58
59std::shared_ptr<PluginSpi>
60PcscPluginFactoryAdapter::getPlugin()
61{
62 std::shared_ptr<PcscPluginAdapter> plugin
63 = PcscPluginAdapter::getInstance();
64
65 plugin
66 ->setContactlessReaderIdentificationFilterPattern(
67 mContactlessReaderIdentificationFilterPattern)
68 .addProtocolRulesMap(mProtocolRulesMap)
69 .setCardMonitoringCycleDuration(mCardMonitoringCycleDuration);
70
71 return plugin;
72}
73
74} /* namespace pcsc */
75} /* namespace plugin */
76} /* namespace keyple */
Definition: Card.cpp:20