Keyple Service C++ Library - 3.3.5
Component of the Keyple C++ middleware
IsoCardSelectorAdapter.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/core/service/IsoCardSelectorAdapter.hpp"
15
16#include <string>
17#include <vector>
18
19#include "keyple/core/util/HexUtil.hpp"
20
21namespace keyple {
22namespace core {
23namespace service {
24
25using keyple::core::util::HexUtil;
26
27const std::string&
28IsoCardSelectorAdapter::getLogicalProtocolName() const
29{
30 return mLogicalProtocolName;
31}
32
33const std::string&
34IsoCardSelectorAdapter::getPowerOnDataRegex() const
35{
36 return mPowerOnDataRegex;
37}
38
39const std::vector<uint8_t>
40IsoCardSelectorAdapter::getAid() const
41{
42 return mAid;
43}
44
45FileOccurrence
46IsoCardSelectorAdapter::getFileOccurrence() const
47{
48 return mFileOccurrence;
49}
50
51FileControlInformation
52IsoCardSelectorAdapter::getFileControlInformation() const
53{
54 return mFileControlInformation;
55}
56
57IsoCardSelector&
58IsoCardSelectorAdapter::filterByDfName(const std::vector<uint8_t>& aid)
59{
60 mAid = aid;
61
62 return *this;
63}
64
65IsoCardSelector&
66IsoCardSelectorAdapter::filterByDfName(const std::string& aid)
67{
68 mAid = HexUtil::toByteArray(aid);
69
70 return *this;
71}
72
73IsoCardSelector&
74IsoCardSelectorAdapter::setFileOccurrence(const FileOccurrence fileOccurrence)
75{
76 mFileOccurrence = fileOccurrence;
77
78 return *this;
79}
80
81IsoCardSelector&
82IsoCardSelectorAdapter::setFileControlInformation(
83 const FileControlInformation fileControlInformation)
84{
85 mFileControlInformation = fileControlInformation;
86
87 return *this;
88}
89
90IsoCardSelector&
91IsoCardSelectorAdapter::filterByCardProtocol(
92 const std::string& logicalProtocolName)
93{
94 mLogicalProtocolName = logicalProtocolName;
95
96 return *this;
97}
98
99IsoCardSelector&
100IsoCardSelectorAdapter::filterByPowerOnData(const std::string& powerOnDataRegex)
101{
102 mPowerOnDataRegex = powerOnDataRegex;
103
104 return *this;
105}
106
107} /* namespace service */
108} /* namespace core */
109} /* namespace keyple */