unleashed-firmware/applications/debug/ccid_test/iso7816_response.h
Filipe Paz Rodrigues 1510d8773b
CCID: Improve request and response data handling (#3741)
* CCID: Improve request and response data handling
  - Add iso7816_set_response function: serves a helpers to set SW1 and SW2 values
  - improved iso7816_read_response_apdu by correctly parsing Lc and Le values
  - add client script to make testing easier
* lint and rename
* Format
* Review changes: pragma once, typedef
* Move command/response data and datalen into respective structures
* Remove conditional for Lc=0
* Fix comment: Le
* Make PVS happy and fix spelling

Co-authored-by: あく <alleteam@gmail.com>
2024-07-06 12:08:44 +01:00

12 lines
No EOL
439 B
C

#pragma once
#define ISO7816_RESPONSE_OK 0x9000
#define ISO7816_RESPONSE_WRONG_LENGTH 0x6700
#define ISO7816_RESPONSE_WRONG_PARAMETERS_P1_P2 0x6A00
#define ISO7816_RESPONSE_WRONG_LE 0x6C00
#define ISO7816_RESPONSE_INSTRUCTION_NOT_SUPPORTED 0x6D00
#define ISO7816_RESPONSE_CLASS_NOT_SUPPORTED 0x6E00
#define ISO7816_RESPONSE_INTERNAL_EXCEPTION 0x6F00
void iso7816_set_response(ISO7816_Response_APDU* responseAPDU, uint16_t responseCode);