BALTECH SDK wrapper functions reference
iso78.h
Go to the documentation of this file.
1 
12 #ifndef __BRP_BALTECH_SDK_CMDS_ISO78_H__
13 #define __BRP_BALTECH_SDK_CMDS_ISO78_H__
14 #include "../typedefs.h"
18 #define BRP_Iso78_ErrInvalidSlot BRP_ERR_STATUS(0x4000, 0x02)
19 
22 #define BRP_Iso78_ErrAbort BRP_ERR_STATUS(0x4000, 0x10)
23 
26 #define BRP_Iso78_ErrProtNotSupported BRP_ERR_STATUS(0x4000, 0x20)
27 
30 #define BRP_Iso78_ErrCom BRP_ERR_STATUS(0x4000, 0x21)
31 
34 #define BRP_Iso78_ErrHw BRP_ERR_STATUS(0x4000, 0x22)
35 
38 #define BRP_Iso78_ErrInvalid7816Cmd BRP_ERR_STATUS(0x4000, 0x31)
39 #ifdef BALTECH_SDK_INTERNAL
40 typedef struct {
41  brp_protocol protocol;
42  unsigned SlotIndex;
43 } brp_Iso78_SelectSlot_t;
53 #ifdef BRP_SUPPORT_LEGACY_METHODS
54 brp_errcode brp_Iso78_SelectSlot(brp_protocol protocol, unsigned _input_SlotIndex);
55 #else
56 brp_errcode brp_Iso78_SelectSlot(brp_Iso78_SelectSlot_t params);
57 #endif
58 typedef struct {
59  brp_protocol protocol;
60  brp_buf* ATR;
61  size_t* ATR_len;
62  brp_mempool *mempool;
63 } brp_Iso78_OpenSamLegacy_t;
75 #ifdef BRP_SUPPORT_LEGACY_METHODS
76 brp_errcode brp_Iso78_OpenSamLegacy(brp_protocol protocol, brp_buf* ATR, size_t* ATR_len, brp_mempool *mempool);
77 #else
78 brp_errcode brp_Iso78_OpenSamLegacy(brp_Iso78_OpenSamLegacy_t params);
79 #endif
80 typedef struct {
81  brp_protocol protocol;
82 } brp_Iso78_CloseSamLegacy_t;
89 #ifdef BRP_SUPPORT_LEGACY_METHODS
90 brp_errcode brp_Iso78_CloseSamLegacy(brp_protocol protocol);
91 #else
92 brp_errcode brp_Iso78_CloseSamLegacy(brp_Iso78_CloseSamLegacy_t params);
93 #endif
94 typedef struct {
95  brp_protocol protocol;
96  brp_buf SendData;
97  size_t SendData_len;
98  brp_buf* RecvData;
99  size_t* RecvData_len;
100  brp_mempool *mempool;
101 } brp_Iso78_ExchangeApduLegacy_t;
113 #ifdef BRP_SUPPORT_LEGACY_METHODS
114 brp_errcode brp_Iso78_ExchangeApduLegacy(brp_protocol protocol, brp_buf _input_SendData, size_t _input_SendData_len, brp_buf* RecvData, size_t* RecvData_len, brp_mempool *mempool);
115 #else
116 brp_errcode brp_Iso78_ExchangeApduLegacy(brp_Iso78_ExchangeApduLegacy_t params);
117 #endif
118 #endif // BALTECH_SDK_INTERNAL
119 typedef struct {
122  unsigned* SamHandle;
124  size_t* ATR_len;
140 #ifdef BRP_SUPPORT_LEGACY_METHODS
141 brp_errcode brp_Iso78_OpenSam(brp_protocol protocol, brp_Iso78_OpenSam_LID _input_LID, unsigned* SamHandle, brp_buf* ATR, size_t* ATR_len, brp_mempool *mempool);
142 #else
144 #endif
145 typedef struct {
147  unsigned SamHandle;
156 #ifdef BRP_SUPPORT_LEGACY_METHODS
157 brp_errcode brp_Iso78_CloseSam(brp_protocol protocol, unsigned _input_SamHandle);
158 #else
160 #endif
161 typedef struct {
163  unsigned SamHandle;
165  size_t SendData_len;
167  size_t* RecvData_len;
182 #ifdef BRP_SUPPORT_LEGACY_METHODS
183 brp_errcode brp_Iso78_ExchangeApdu(brp_protocol protocol, unsigned _input_SamHandle, brp_buf _input_SendData, size_t _input_SendData_len, brp_buf* RecvData, size_t* RecvData_len, brp_mempool *mempool);
184 #else
186 #endif
187 #endif
188 
brp_Iso78_OpenSam_LID
Logical SAM-ID (LID)
Definition: typedefs.h:5118
brp_protocol protocol
Definition: iso78.h:146
unsigned SamHandle
Definition: iso78.h:147
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23
brp_buf * RecvData
Definition: iso78.h:166
brp_protocol protocol
Definition: iso78.h:162
size_t * ATR_len
Definition: iso78.h:124
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol.
Definition: protocol.h:34
brp_errcode brp_Iso78_ExchangeApdu(brp_Iso78_ExchangeApdu_t params)
This command sends an APDU command on the currently selected and opened SAM module using a logical ID...
brp_errcode brp_Iso78_OpenSam(brp_Iso78_OpenSam_t params)
This command sets up a communication channel to a Secure Access Module (SAM) inserted into the reader...
brp_errcode brp_Iso78_CloseSam(brp_Iso78_CloseSam_t params)
This command closes a communication channel previously opened via the Iso78.OpenSam command...
brp_Iso78_OpenSam_LID LID
Definition: iso78.h:121
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:29
brp_buf * ATR
Definition: iso78.h:123
unsigned * SamHandle
Definition: iso78.h:122
size_t * RecvData_len
Definition: iso78.h:167
brp_protocol protocol
Definition: iso78.h:120
brp_mempool * mempool
Definition: iso78.h:168
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61
brp_mempool * mempool
Definition: iso78.h:125