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 SlotIndex);
55 #else
56 brp_errcode brp_Iso78_SelectSlot(brp_Iso78_SelectSlot_t params);
57 #endif
58 #endif // BALTECH_SDK_INTERNAL
59 #ifdef BALTECH_SDK_INTERNAL
60 typedef struct {
61  brp_protocol protocol;
62  brp_buf* ATR;
63  size_t* ATR_len;
64  brp_mempool *mempool;
65 } brp_Iso78_OpenSamLegacy_t;
77 #ifdef BRP_SUPPORT_LEGACY_METHODS
78 brp_errcode brp_Iso78_OpenSamLegacy(brp_protocol protocol, brp_buf* ATR, size_t* ATR_len, brp_mempool *mempool);
79 #else
80 brp_errcode brp_Iso78_OpenSamLegacy(brp_Iso78_OpenSamLegacy_t params);
81 #endif
82 #endif // BALTECH_SDK_INTERNAL
83 #ifdef BALTECH_SDK_INTERNAL
84 typedef struct {
85  brp_protocol protocol;
86 } brp_Iso78_CloseSamLegacy_t;
93 #ifdef BRP_SUPPORT_LEGACY_METHODS
94 brp_errcode brp_Iso78_CloseSamLegacy(brp_protocol protocol);
95 #else
96 brp_errcode brp_Iso78_CloseSamLegacy(brp_Iso78_CloseSamLegacy_t params);
97 #endif
98 #endif // BALTECH_SDK_INTERNAL
99 #ifdef BALTECH_SDK_INTERNAL
100 typedef struct {
101  brp_protocol protocol;
102  brp_buf SendData;
103  size_t SendData_len;
104  brp_buf* RecvData;
105  size_t* RecvData_len;
106  brp_mempool *mempool;
107 } brp_Iso78_ExchangeApduLegacy_t;
119 #ifdef BRP_SUPPORT_LEGACY_METHODS
120 brp_errcode brp_Iso78_ExchangeApduLegacy(brp_protocol protocol, brp_buf SendData, size_t SendData_len, brp_buf* RecvData, size_t* RecvData_len, brp_mempool *mempool);
121 #else
122 brp_errcode brp_Iso78_ExchangeApduLegacy(brp_Iso78_ExchangeApduLegacy_t params);
123 #endif
124 #endif // BALTECH_SDK_INTERNAL
125 typedef struct {
128  unsigned* SamHandle;
130  size_t* ATR_len;
146 #ifdef BRP_SUPPORT_LEGACY_METHODS
147 brp_errcode brp_Iso78_OpenSam(brp_protocol protocol, brp_Iso78_OpenSam_LID LID, unsigned* SamHandle, brp_buf* ATR, size_t* ATR_len, brp_mempool *mempool);
148 #else
150 #endif
151 typedef struct {
153  unsigned SamHandle;
162 #ifdef BRP_SUPPORT_LEGACY_METHODS
163 brp_errcode brp_Iso78_CloseSam(brp_protocol protocol, unsigned SamHandle);
164 #else
166 #endif
167 typedef struct {
169  unsigned SamHandle;
171  size_t SendData_len;
173  size_t* RecvData_len;
188 #ifdef BRP_SUPPORT_LEGACY_METHODS
189 brp_errcode brp_Iso78_ExchangeApdu(brp_protocol protocol, unsigned SamHandle, brp_buf SendData, size_t SendData_len, brp_buf* RecvData, size_t* RecvData_len, brp_mempool *mempool);
190 #else
192 #endif
193 #endif
194 
brp_Iso78_OpenSam_LID
Logical SAM-ID (LID)
Definition: typedefs.h:1706
brp_protocol protocol
Definition: iso78.h:152
unsigned SamHandle
Definition: iso78.h:153
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:172
brp_protocol protocol
Definition: iso78.h:168
size_t * ATR_len
Definition: iso78.h:130
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 brp_Iso78_OpenSam() command...
brp_Iso78_OpenSam_LID LID
Definition: iso78.h:127
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:29
brp_buf * ATR
Definition: iso78.h:129
unsigned * SamHandle
Definition: iso78.h:128
size_t * RecvData_len
Definition: iso78.h:173
brp_protocol protocol
Definition: iso78.h:126
brp_mempool * mempool
Definition: iso78.h:174
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61
brp_mempool * mempool
Definition: iso78.h:131