Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
CmdCardSvGet.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2021 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 <cstdint>
16#include <map>
17#include <memory>
18#include <vector>
19
20/* Calypsonet Terminal Calypso */
21#include "CalypsoCard.h"
22#include "SvDebitLogRecord.h"
23#include "SvLoadLogRecord.h"
24#include "SvOperation.h"
25
26/* Keyple Card Calypso */
27#include "AbstractApduCommand.h"
28#include "AbstractCardCommand.h"
29#include "CalypsoCardClass.h"
30
31/* Keyple Core Util */
32#include "LoggerFactory.h"
33
34namespace keyple {
35namespace card {
36namespace calypso {
37
38using namespace calypsonet::terminal::calypso::card;
39using namespace calypsonet::terminal::calypso::transaction;
40using namespace keyple::core::util::cpp;
41
43
50class CmdCardSvGet final : public AbstractCardCommand {
51public:
62 CmdCardSvGet(const CalypsoCardClass calypsoCardClass,
63 const std::shared_ptr<CalypsoCard> calypsoCard,
64 const SvOperation svOperation);
65
72 bool isSessionBufferUsed() const override;
73
79 CmdCardSvGet& setApduResponse(const std::shared_ptr<ApduResponseApi> apduResponse) override;
80
88 const std::vector<uint8_t>& getSvGetCommandHeader() const;
89
97 uint8_t getCurrentKVC() const;
98
106 int getTransactionNumber() const;
107
115 const std::vector<uint8_t>& getPreviousSignatureLo() const;
116
124 const std::vector<uint8_t>& getChallengeOut() const;
125
133 int getBalance() const;
134
143 const std::shared_ptr<SvLoadLogRecord> getLoadLog() const;
144
153 const std::shared_ptr<SvDebitLogRecord> getDebitLog() const;
154
160 const std::map<const int, const std::shared_ptr<StatusProperties>>& getStatusTable() const
161 override;
162
163private:
167 const std::unique_ptr<Logger> mLogger = LoggerFactory::getLogger(typeid(CmdCardSvGet));
168
172 static const CalypsoCardCommand mCommand;
173
177 static const std::map<const int, const std::shared_ptr<StatusProperties>> STATUS_TABLE;
178
182 std::vector<uint8_t> mHeader;
183
187 uint8_t mCurrentKVC;
188
192 int mTransactionNumber;
193
197 std::vector<uint8_t> mPreviousSignatureLo;
198
202 std::vector<uint8_t> mChallengeOut;
203
207 int mBalance;
208
212 std::shared_ptr<SvLoadLogRecord> mLoadLog;
213
217 std::shared_ptr<SvDebitLogRecord> mDebitLog;
218
222 static const std::map<const int, const std::shared_ptr<StatusProperties>> initStatusTable();
223};
224
225}
226}
227}
const std::shared_ptr< SvLoadLogRecord > getLoadLog() const
CmdCardSvGet(const CalypsoCardClass calypsoCardClass, const std::shared_ptr< CalypsoCard > calypsoCard, const SvOperation svOperation)
bool isSessionBufferUsed() const override
const std::shared_ptr< SvDebitLogRecord > getDebitLog() const
const std::vector< uint8_t > & getChallengeOut() const
const std::vector< uint8_t > & getSvGetCommandHeader() const
const std::vector< uint8_t > & getPreviousSignatureLo() const
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
CmdCardSvGet & setApduResponse(const std::shared_ptr< ApduResponseApi > apduResponse) override
AbstractApduCommand::StatusProperties StatusProperties