31using namespace keyple::core::util;
34const std::map<const int, const std::shared_ptr<StatusProperties>>
35 CmdCardUpdateRecord::STATUS_TABLE = initStatusTable();
39 const uint8_t recordNumber,
40 const std::vector<uint8_t>& newRecordData)
43 mRecordNumber(recordNumber),
46 const uint8_t cla = calypsoCard->getCardClass().getValue();
47 const uint8_t p2 = (sfi == 0) ? 0x04 : sfi * 8 + 4;
51 std::make_shared<ApduRequestAdapter>(
59 std::stringstream extraInfo;
60 extraInfo <<
"SFI:" << sfi <<
"h, "
61 <<
"REC:" << recordNumber;
78const std::map<const int, const std::shared_ptr<StatusProperties>>
79 CmdCardUpdateRecord::initStatusTable()
81 std::map<const int, const std::shared_ptr<StatusProperties>> m =
85 std::make_shared<StatusProperties>(
"Too many modifications in session.",
88 std::make_shared<StatusProperties>(
"Lc value not supported.",
89 typeid(CardDataAccessException))});
91 std::make_shared<StatusProperties>(
"Command forbidden on cyclic files when the " \
92 "record exists and is not record 01h and on " \
94 typeid(CardDataAccessException))});
96 std::make_shared<StatusProperties>(
"Security conditions not fulfilled (no session, " \
97 "wrong key, encryption required).",
98 typeid(CardSecurityContextException))});
100 std::make_shared<StatusProperties>(
"Access forbidden (Never access mode, DF is " \
101 "invalidated, etc..).",
102 typeid(CardAccessForbiddenException))});
104 std::make_shared<StatusProperties>(
"Command not allowed (no current EF).",
105 typeid(CardDataAccessException))});
107 std::make_shared<StatusProperties>(
"Record is not found (record index is 0 or " \
109 typeid(CardDataAccessException))});
111 std::make_shared<StatusProperties>(
"P2 value not supported.",
112 typeid(CardIllegalParameterException))});
117const std::map<const int, const std::shared_ptr<StatusProperties>>&
static const std::map< const int, const std::shared_ptr< StatusProperties > > STATUS_TABLE
virtual void addSubName(const std::string &subName) final
virtual void setApduRequest(const std::shared_ptr< ApduRequestAdapter > apduRequest) final
void parseApduResponse(const std::shared_ptr< ApduResponseApi > apduResponse) override
std::shared_ptr< CalypsoCardAdapter > getCalypsoCard() const
static const CalypsoCardCommand UPDATE_RECORD
uint8_t getInstructionByte() const
bool isSessionBufferUsed() const override
void parseApduResponse(const std::shared_ptr< ApduResponseApi > apduResponse) override
CmdCardUpdateRecord(const std::shared_ptr< CalypsoCardAdapter > calypsoCard, const uint8_t sfi, const uint8_t recordNumber, const std::vector< uint8_t > &newRecordData)
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override