Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
ApduRequestAdapter.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2022 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional information regarding *
5 * copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the terms of the Eclipse *
8 * Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 *
9 * *
10 * SPDX-License-Identifier: EPL-2.0 *
11 **************************************************************************************************/
12
13#pragma once
14
15#include <memory>
16#include <ostream>
17#include <vector>
18
19/* Calypsonet Terminal Card */
20#include "ApduRequestSpi.h"
21
22/* Keyple Card Calypso */
24
25namespace keyple {
26namespace card {
27namespace calypso {
28
29using namespace calypsonet::terminal::card::spi;
30
46class KEYPLECARDCALYPSO_API ApduRequestAdapter final : public ApduRequestSpi {
47public:
56 ApduRequestAdapter(const std::vector<uint8_t>& apdu);
57
67 ApduRequestAdapter& addSuccessfulStatusWord(const int successfulStatusWord);
68
74 const std::vector<int>& getSuccessfulStatusWords() const override;
75
86 ApduRequestAdapter& setInfo(const std::string& info);
87
93 const std::string& getInfo() const override;
94
100 const std::vector<uint8_t>& getApdu() const override;
101
105 friend std::ostream& operator<<(std::ostream& os,
106 const std::shared_ptr<ApduRequestAdapter> ara);
107
108private:
112 static const int DEFAULT_SUCCESSFUL_CODE;
113
117 const std::vector<uint8_t> mApdu;
118
122 std::vector<int> mSuccessfulStatusWords;
123
127 std::string mInfo;
128};
129
130}
131}
132}
#define KEYPLECARDCALYPSO_API
std::ostream & operator<<(std::ostream &os, const std::shared_ptr< ApduRequestAdapter > ara)