Keyple Card Calypso C++ Library 2.2.2
Reference Terminal Reader API for C++
CmdCardSvGet.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 <cstdint>
16#include <map>
17#include <memory>
18#include <vector>
19
20/* Calypsonet Terminal Calypso */
21#include "SvDebitLogRecord.h"
22#include "SvLoadLogRecord.h"
23#include "SvOperation.h"
24
25/* Keyple Card Calypso */
26#include "AbstractApduCommand.h"
27#include "AbstractCardCommand.h"
28#include "CalypsoCardClass.h"
29
30/* Keyple Core Util */
31#include "LoggerFactory.h"
32
33namespace keyple {
34namespace card {
35namespace calypso {
36
37using namespace calypsonet::terminal::calypso::card;
38using namespace calypsonet::terminal::calypso::transaction;
39using namespace keyple::core::util::cpp;
40
42
49class CmdCardSvGet final : public AbstractCardCommand {
50public:
61 CmdCardSvGet(const CalypsoCardClass calypsoCardClass,
62 const SvOperation svOperation,
63 const bool useExtendedMode);
64
71 bool isSessionBufferUsed() const override;
72
78 CmdCardSvGet& setApduResponse(const std::shared_ptr<ApduResponseApi> apduResponse) override;
79
87 const std::vector<uint8_t>& getSvGetCommandHeader() const;
88
96 uint8_t getCurrentKVC() const;
97
105 int getTransactionNumber() const;
106
114 const std::vector<uint8_t>& getPreviousSignatureLo() const;
115
123 const std::vector<uint8_t>& getChallengeOut() const;
124
132 int getBalance() const;
133
142 const std::shared_ptr<SvLoadLogRecord> getLoadLog() const;
143
152 const std::shared_ptr<SvDebitLogRecord> getDebitLog() const;
153
159 const std::map<const int, const std::shared_ptr<StatusProperties>>& getStatusTable() const
160 override;
161
162private:
166 const std::unique_ptr<Logger> mLogger = LoggerFactory::getLogger(typeid(CmdCardSvGet));
167
171 static const CalypsoCardCommand mCommand;
172
176 static const std::map<const int, const std::shared_ptr<StatusProperties>> STATUS_TABLE;
177
181 std::vector<uint8_t> mHeader;
182
186 uint8_t mCurrentKVC;
187
191 int mTransactionNumber;
192
196 std::vector<uint8_t> mPreviousSignatureLo;
197
201 std::vector<uint8_t> mChallengeOut;
202
206 int mBalance;
207
211 std::shared_ptr<SvLoadLogRecord> mLoadLog;
212
216 std::shared_ptr<SvDebitLogRecord> mDebitLog;
217
221 static const std::map<const int, const std::shared_ptr<StatusProperties>> initStatusTable();
222};
223
224}
225}
226}
const std::shared_ptr< SvLoadLogRecord > getLoadLog() const
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
CmdCardSvGet(const CalypsoCardClass calypsoCardClass, const SvOperation svOperation, const bool useExtendedMode)
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