22#include "IllegalArgumentException.h"
28using namespace keyple::core::util;
29using namespace keyple::core::util::cpp::exception;
32const int CmdSamReadCeilings::MAX_CEILING_NUMB = 26;
33const int CmdSamReadCeilings::MAX_CEILING_REC_NUMB = 3;
35const std::map<const int, const std::shared_ptr<StatusProperties>>
36 CmdSamReadCeilings::STATUS_TABLE = initStatusTable();
49 if (index < 0 || index > MAX_CEILING_REC_NUMB) {
50 throw IllegalArgumentException(
"Record Number must be between 1 and " +
51 std::to_string(MAX_CEILING_REC_NUMB) +
56 p2 =
static_cast<uint8_t
>(0xB0 + index);
60 if (index < 0 || index > MAX_CEILING_NUMB) {
61 throw IllegalArgumentException(
"Counter Number must be between 0 and " +
62 std::to_string(MAX_CEILING_NUMB) +
66 p1 =
static_cast<uint8_t
>(index);
71 std::make_shared<ApduRequestAdapter>(
75const std::map<const int, const std::shared_ptr<StatusProperties>>
76 CmdSamReadCeilings::initStatusTable()
78 std::map<const int, const std::shared_ptr<StatusProperties>> m =
82 std::make_shared<StatusProperties>(
"An event counter cannot be incremented.",
85 std::make_shared<StatusProperties>(
"Incorrect P1 or P2.",
86 typeid(CalypsoSamIllegalParameterException))});
88 std::make_shared<StatusProperties>(
"Correct execution with warning: data not signed.",
99const std::map<const int, const std::shared_ptr<StatusProperties>>&
virtual const std::shared_ptr< ApduResponseApi > getApduResponse() const final
virtual bool isSuccessful() const final
virtual void setApduRequest(const std::shared_ptr< ApduRequestAdapter > apduRequest) final
static const std::map< const int, const std::shared_ptr< StatusProperties > > STATUS_TABLE
uint8_t getInstructionByte() const override
static const CalypsoSamCommand READ_CEILINGS
const std::vector< uint8_t > getCeilingsData() const
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
CmdSamReadCeilings(const CalypsoSam::ProductType productType, const CeilingsOperationType operationType, const int index)
static uint8_t getClassByte(const ProductType productType)
CalypsoSam::ProductType ProductType