2023-09-21 02:09:00 -07:00
|
|
|
#ifndef _ISO7816_T0_APDU_H_
|
|
|
|
#define _ISO7816_T0_APDU_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2024-06-01 11:45:27 -05:00
|
|
|
#include "iso7816_atr.h"
|
|
|
|
#include "core/common_defines.h"
|
2023-09-21 02:09:00 -07:00
|
|
|
|
|
|
|
struct ISO7816_Command_APDU {
|
|
|
|
//header
|
|
|
|
uint8_t CLA;
|
2023-10-09 11:48:37 -07:00
|
|
|
uint8_t INS;
|
2023-09-21 02:09:00 -07:00
|
|
|
uint8_t P1;
|
|
|
|
uint8_t P2;
|
|
|
|
|
|
|
|
//body
|
2023-10-09 11:48:37 -07:00
|
|
|
uint8_t Lc;
|
|
|
|
uint8_t Le;
|
2023-12-01 13:16:48 +04:00
|
|
|
} FURI_PACKED;
|
2023-09-21 02:09:00 -07:00
|
|
|
|
|
|
|
struct ISO7816_Response_APDU {
|
|
|
|
uint8_t SW1;
|
2023-10-09 11:48:37 -07:00
|
|
|
uint8_t SW2;
|
2023-12-01 13:16:48 +04:00
|
|
|
} FURI_PACKED;
|
2023-09-21 02:09:00 -07:00
|
|
|
|
2024-06-01 11:45:27 -05:00
|
|
|
void iso7816_answer_to_reset(Iso7816Atr* atr);
|
2023-09-21 02:09:00 -07:00
|
|
|
void iso7816_read_command_apdu(
|
|
|
|
struct ISO7816_Command_APDU* command,
|
|
|
|
const uint8_t* dataBuffer,
|
|
|
|
uint32_t dataLen);
|
|
|
|
void iso7816_write_response_apdu(
|
|
|
|
const struct ISO7816_Response_APDU* response,
|
2024-06-01 11:45:27 -05:00
|
|
|
uint8_t* readerToPcDataBlock,
|
|
|
|
uint32_t* readerToPcDataBlockLen,
|
|
|
|
uint8_t* responseDataBuffer,
|
|
|
|
uint32_t responseDataLen);
|
2023-09-21 02:09:00 -07:00
|
|
|
#endif //_ISO7816_T0_APDU_H_
|