24 #ifndef __DESFIRE_ISO7816_SUPPORT_H__ 25 #define __DESFIRE_ISO7816_SUPPORT_H__ 30 #define Iso7816CLA(cmdCode) \ 31 (cmdCode == DESFIRE_ISO7816_CLA) 33 #define ISO7816_PROLOGUE_SIZE (2) 34 #define ISO7816_STATUS_RESPONSE_SIZE (0x02) 35 #define ISO7816_EF_NOT_SPECIFIED (0xff) 36 #define ISO7816_EFID_NUMBER_MAX (0x0f) 37 #define ISO7816_MAX_FILE_SIZE (0xfd) 38 #define ISO7816_READ_ALL_BYTES_SIZE (0x00) 39 #define ISO7816_CMD_NO_ERROR (0x00) 40 #define ISO7816_ERROR_SW1 (0x6a) 41 #define ISO7816_ERROR_SW1_INS_UNSUPPORTED (0x6d) 42 #define ISO7816_ERROR_SW1_ACCESS (0x69) 43 #define ISO7816_ERROR_SW1_FSE (0x62) 44 #define ISO7816_ERROR_SW1_WRONG_FSPARAMS (0x6b) 45 #define ISO7816_ERROR_SW2_INCORRECT_P1P2 (0x86) 46 #define ISO7816_ERROR_SW2_UNSUPPORTED (0x81) 47 #define ISO7816_ERROR_SW2_FUNC_UNSUPPORTED (0x81) 48 #define ISO7816_ERROR_SW2_INS_UNSUPPORTED (0x00) 49 #define ISO7816_SELECT_ERROR_SW2_FUNC_UNSUPPORTED (0x81) 50 #define ISO7816_SELECT_ERROR_SW2_NOFILE (0x82) 51 #define ISO7816_ERROR_SW2_FILE_NOMEM (0x84) 52 #define ISO7816_GET_CHALLENGE_ERROR_SW2_UNSUPPORTED (0x81) 53 #define ISO7816_ERROR_SW2_INCOMPATFS (0x81) 54 #define ISO7816_ERROR_SW2_SECURITY (0x82) 55 #define ISO7816_ERROR_SW2_NOEF (0x86) 56 #define ISO7816_ERROR_SW2_WRONG_FSPARAMS (0x00) 57 #define ISO7816_ERROR_SW2_EOF (0x82) 59 #define AppendSW12Bytes(sw1, sw2) \ 60 ((uint16_t) ((sw1 << 8) | (sw2 & 0xff))) 71 ISO7816_UNSUPPORTED_MODE,
74 ISO7816_FILE_FIRST_RECORD,
75 ISO7816_FILE_LAST_RECORD,
76 ISO7816_FILE_NEXT_RECORD,
77 ISO7816_FILE_PREV_RECORD,
78 } Iso7816WrappedParams_t;
80 extern Iso7816WrappedParams_t Iso7816P1Data;
81 extern Iso7816WrappedParams_t Iso7816P2Data;
82 extern bool Iso7816FileSelected;
83 extern uint8_t Iso7816FileOffset;
84 extern uint8_t Iso7816EfIdNumber;
86 bool IsWrappedISO7816CommandType(uint8_t *Buffer, uint16_t ByteCount);
87 uint16_t SetIso7816WrappedParametersType(uint8_t *Buffer, uint16_t ByteCount);