34using namespace keyple::core::util;
35using namespace keyple::core::util::cpp;
37const std::map<const int, const std::shared_ptr<StatusProperties>>
38 CmdCardReadBinary::STATUS_TABLE = initStatusTable();
48 const uint8_t msb = ((offset & 0xFF00) >> 8);
49 const uint8_t lsb = (offset & 0xFF);
55 const uint8_t p1 = msb > 0 ? msb : 0x80 + mSfi;
59 std::make_shared<ApduRequestAdapter>(
61 calypsoCard->getCardClass().getValue(),
65 static_cast<uint8_t
>(length))));
67 std::stringstream extraInfo;
68 extraInfo <<
"SFI:" << sfi <<
"h, "
69 <<
"OFFSET:" << offset <<
", "
70 <<
"LENGTH:" << length;
79 getCalypsoCard()->setContent(mSfi, 1, apduResponse->getDataOut(), mOffset);
92const std::map<const int, const std::shared_ptr<StatusProperties>>
93 CmdCardReadBinary::initStatusTable()
95 std::map<const int, const std::shared_ptr<StatusProperties>> m =
99 std::make_shared<StatusProperties>(
"Incorrect EF type: not a Binary EF.",
102 std::make_shared<StatusProperties>(
"Security conditions not fulfilled (PIN code " \
103 "not presented, encryption required).",
104 typeid(CardSecurityContextException))});
106 std::make_shared<StatusProperties>(
"Access forbidden (Never access mode).",
107 typeid(CardAccessForbiddenException))});
109 std::make_shared<StatusProperties>(
"Incorrect file type: the Current File is not " \
110 "an EF. Supersedes 6981h.",
111 typeid(CardDataAccessException))});
113 std::make_shared<StatusProperties>(
"File not found",
114 typeid(CardDataAccessException))});
116 std::make_shared<StatusProperties>(
"Offset not in the file (offset overflow).",
117 typeid(CardDataAccessException))});
119 std::make_shared<StatusProperties>(
"P1 value not supported.",
120 typeid(CardIllegalParameterException))});
125const 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
const CalypsoCardCommand & getCommandRef() const override
std::shared_ptr< CalypsoCardAdapter > getCalypsoCard() const
bool isSessionBufferUsed() const override
void parseApduResponse(const std::shared_ptr< ApduResponseApi > apduResponse) override
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
CmdCardReadBinary(const std::shared_ptr< CalypsoCardAdapter > calypsoCard, const uint8_t sfi, const int offset, const int length)