22#include "ByteArrayUtil.h"
23#include "IllegalArgumentException.h"
29using namespace keyple::core::util;
30using namespace keyple::core::util::cpp::exception;
34const std::map<const int, const std::shared_ptr<StatusProperties>>
35 CmdSamReadCeilings::STATUS_TABLE = initStatusTable();
41 mCeilingsOperationType(ceilingsOperationType),
43 target : (target - 1) * 9)
58 p2 =
static_cast<uint8_t
>(0xB0 + target);
62 std::make_shared<ApduRequestAdapter>(
66const std::map<const int, const std::shared_ptr<StatusProperties>>
67 CmdSamReadCeilings::initStatusTable()
69 std::map<const int, const std::shared_ptr<StatusProperties>> m =
73 std::make_shared<StatusProperties>(
"An event counter cannot be incremented.",
76 std::make_shared<StatusProperties>(
"Incorrect P1 or P2.",
77 typeid(CalypsoSamIllegalParameterException))});
79 std::make_shared<StatusProperties>(
"Correct execution with warning: data not signed.",
85const std::map<const int, const std::shared_ptr<StatusProperties>>&
95 const std::vector<uint8_t> dataOut = apduResponse->getDataOut();
100 ByteArrayUtil::extractInt(dataOut, 9, 3,
false));
104 for (
int i = 0; i < 9; i++) {
107 mFirstEventCeilingNumber + i,
108 ByteArrayUtil::extractInt(dataOut, 8 + (3 * i), 3,
false));
virtual void setApduRequest(const std::shared_ptr< ApduRequestAdapter > apduRequest) final
static const std::map< const int, const std::shared_ptr< StatusProperties > > STATUS_TABLE
const std::shared_ptr< CalypsoSamAdapter > getCalypsoSam() const
void parseApduResponse(const std::shared_ptr< ApduResponseApi > apduResponse) override
uint8_t getInstructionByte() const override
static const CalypsoSamCommand READ_CEILINGS
CmdSamReadCeilings(std::shared_ptr< CalypsoSamAdapter > calypsoSam, const CeilingsOperationType ceilingsOperationType, const int target)
void parseApduResponse(std::shared_ptr< ApduResponseApi > apduResponse) override
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
static uint8_t getClassByte(const ProductType productType)