1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2017 Merlok
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // ISO7816 core functionality
9 //-----------------------------------------------------------------------------
11 #ifndef ISO7816CORE_H__
12 #define ISO7816CORE_H__
18 #define APDU_RES_LEN 260
19 #define APDU_AID_LEN 50
30 } Iso7816CommandChannel
;
32 void SetAPDULogging(bool logging
);
33 bool GetAPDULogging(void);
35 void SetISODEPState(isodep_state_t state
);
36 isodep_state_t
GetISODEPState(void);
39 int Iso7816Connect(Iso7816CommandChannel channel
);
42 int Iso7816Exchange(Iso7816CommandChannel channel
, bool leave_field_on
, sAPDU apdu
, uint8_t *result
, size_t max_result_len
,
43 size_t *result_len
, uint16_t *sw
);
45 int Iso7816ExchangeEx(Iso7816CommandChannel channel
, bool activate_field
, bool leave_field_on
, sAPDU apdu
, bool include_le
,
46 uint16_t le
, uint8_t *result
, size_t max_result_len
, size_t *result_len
, uint16_t *sw
);
49 int Iso7816Select(Iso7816CommandChannel channel
, bool activate_field
, bool leave_field_on
, uint8_t *aid
, size_t aid_len
,
50 uint8_t *result
, size_t max_result_len
, size_t *result_len
, uint16_t *sw
);