Keyple Card Calypso C++ Library 2.2.5.6
Reference Terminal Reader API for C++
CmdCardIncreaseOrDecrease.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2023 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/* Keyple Card Calypso */
21#include "AbstractApduCommand.h"
22#include "AbstractCardCommand.h"
23#include "CalypsoCardAdapter.h"
24#include "CalypsoCardClass.h"
25
26/* Keyple Core Util */
27#include "LoggerFactory.h"
28
29namespace keyple {
30namespace card {
31namespace calypso {
32
33using namespace keyple::core::util::cpp;
34
36
44public:
58 CmdCardIncreaseOrDecrease(const bool isDecreaseCommand,
59 const std::shared_ptr<CalypsoCardAdapter> calypsoCard,
60 const uint8_t sfi,
61 const uint8_t counterValue,
62 const int incDecValue);
63
69 void parseApduResponse(const std::shared_ptr<ApduResponseApi> apduResponse) override;
70
77 bool isSessionBufferUsed() const override;
78
85 uint8_t getSfi() const;
86
93 uint8_t getCounterNumber() const;
94
101 int getIncDecValue() const;
102
110 void setComputedData(const std::vector<uint8_t>& data);
111
117 const std::map<const int, const std::shared_ptr<StatusProperties>>& getStatusTable() const
118 override;
119
120
121private:
125 static const int SW_POSTPONED_DATA;
126
130 const std::unique_ptr<Logger> mLogger =
131 LoggerFactory::getLogger(typeid(CmdCardIncreaseOrDecrease));
132
136 static const std::map<const int, const std::shared_ptr<StatusProperties>> STATUS_TABLE;
137
141 const uint8_t mSfi;
142
146 const uint8_t mCounterNumber;
147
151 const int mIncDecValue;
152
156 std::vector<uint8_t> mComputedData;
157
161 static const std::map<const int, const std::shared_ptr<StatusProperties>> initStatusTable();
162};
163
164}
165}
166}
void setComputedData(const std::vector< uint8_t > &data)
void parseApduResponse(const std::shared_ptr< ApduResponseApi > apduResponse) override
CmdCardIncreaseOrDecrease(const bool isDecreaseCommand, const std::shared_ptr< CalypsoCardAdapter > calypsoCard, const uint8_t sfi, const uint8_t counterValue, const int incDecValue)
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
AbstractApduCommand::StatusProperties StatusProperties