• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright 2018-2022 NXP
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 #ifndef _PHNXPESEPROTO7816_3_H_
19 #define _PHNXPESEPROTO7816_3_H_
20 #include <ese_config.h>
21 #include <phNxpEseDataMgr.h>
22 #include <phNxpEseFeatures.h>
23 #include <phNxpEse_Internal.h>
24 
25 /**
26  * \addtogroup ISO7816-3_protocol_lib
27  * \brief 7816-3 PROTOCOL STACK
28  * @{ */
29 
30 /********************* Definitions and structures *****************************/
31 
32 /*!
33  * \brief S-Frame types used in 7816-3 protocol stack
34  */
35 typedef enum sFrameTypes {
36   RESYNCH_REQ = 0x00, /*!< Re-synchronisation request between host and ESE */
37   RESYNCH_RSP = 0x20, /*!< Re-synchronisation response between host and ESE */
38   IFS_REQ = 0x01,     /*!< IFSC size request */
39   IFS_RES = 0x21,     /*!< IFSC size response */
40   ABORT_REQ = 0x02,   /*!< Abort request */
41   ABORT_RES = 0x22,   /*!< Abort response */
42   WTX_REQ = 0x03,     /*!< WTX request */
43   WTX_RSP = 0x23,     /*!< WTX response */
44   INTF_RESET_REQ = 0x04,    /*!< Interface reset request */
45   INTF_RESET_RSP = 0x24,    /*!< Interface reset response */
46   PROP_END_APDU_REQ = 0x05, /*!< Proprietary Enf of APDU request */
47   PROP_END_APDU_RSP = 0x25, /*!< Proprietary Enf of APDU response */
48   HARD_RESET_REQ = 0x06,    /*!< Chip reset request */
49   HARD_RESET_RSP = 0x26,    /*!< Chip reset request */
50   ATR_REQ = 0x07,           /*!< ATR request */
51   ATR_RSP = 0x27,           /*!< ATR response */
52   INVALID_REQ_RES           /*!< Invalid request */
53 } sFrameTypes_t;
54 
55 /*!
56  * \brief R-Frame types used in 7816-3 protocol stack
57  */
58 typedef enum rFrameTypes {
59   RACK = 0x01, /*!< R-frame Acknowledgement frame indicator */
60   RNACK = 0x02 /*!< R-frame Negative-Acknowledgement frame indicator */
61 } rFrameTypes_t;
62 
63 /*!
64  * \brief R-Frame error types used 7816-3 protocol stack
65  */
66 typedef enum rFrameErrorTypes {
67   NO_ERROR,         /*!< R-frame received with success */
68   PARITY_ERROR,     /*!< R-frame received with parity error */
69   OTHER_ERROR,      /*!< R-frame received with Other error */
70   SOF_MISSED_ERROR, /*!< R-frame received with frame missing error */
71   UNDEFINED_ERROR   /*!< R-frame received with some undefined error */
72 } rFrameErrorTypes_t;
73 
74 /*!
75  * \brief Frame types used in 7816-3 protocol stack
76  */
77 typedef enum phNxpEseProto7816_FrameTypes {
78   IFRAME,  /*!< Frame type: I-frame */
79   SFRAME,  /*!< Frame type: S-frame */
80   RFRAME,  /*!< Frame type: R-frame */
81   INVALID, /*!< Frame type: Invalid */
82   UNKNOWN  /*!< Frame type: Unknown */
83 } phNxpEseProto7816_FrameTypes_t;
84 
85 /*!
86  * \brief 7816-3 protocol stack states
87  */
88 typedef enum phNxpEseProto7816_State {
89   PH_NXP_ESE_PROTO_7816_IDLE,       /*!< 7816-3 protocol state: IDLE */
90   PH_NXP_ESE_PROTO_7816_TRANSCEIVE, /*!< 7816-3 protocol state: TRANSCEIVE going
91                                        on */
92   PH_NXP_ESE_PROTO_7816_DEINIT /*!< 7816-3 protocol state: DeInit going on */
93 } phNxpEseProto7816_State_t;
94 
95 /*!
96  * \brief 7816-3 protocol transceive states
97  */
98 typedef enum phNxpEseProto7816_TransceiveStates {
99   IDLE_STATE,  /*!< 7816-3 protocol transceive state: IDLE */
100   SEND_IFRAME, /*!< 7816-3 protocol transceive state: I-frame to be sent */
101   SEND_R_NACK, /*!< 7816-3 protocol transceive state: R-NACK frame to be sent */
102   SEND_R_ACK,  /*!< 7816-3 protocol transceive state: R-ACK frame to be sent */
103   SEND_S_RSYNC,    /*!< 7816-3 protocol transceive state: S-frame
104                       re-synchronisation command to be sent */
105   SEND_S_INTF_RST, /*!< 7816-3 protocol transceive state: S-frame interface
106                       reset command to be sent */
107   SEND_S_EOS,      /*!< 7816-3 protocol transceive state: S-frame end of session
108                       command to be sent */
109   SEND_S_HRD_RST,  /*!< 7816-3 protocol transceive state: S-frame
110                          chip/hard reset command to be sent */
111   SEND_S_WTX_REQ,  /*!< 7816-3 protocol transceive state: S-frame WTX command to
112                       be sent */
113   SEND_S_WTX_RSP, /*!< 7816-3 protocol transceive state: S-frame WTX response to
114                     be sent */
115   SEND_S_IFS_ADJ, /*!< 7816-3 protocol transceive state: S-frame IFS adjustment
116                    */
117   SEND_S_ATR_REQ, /*!< 7816-3 protocol transceive state: S-frame ATR request */
118 } phNxpEseProto7816_TransceiveStates_t;
119 
120 /*!
121  * \brief reset type used in 7816-3 stack
122  */
123 typedef enum phNxpEseProto7816_ResetType {
124   RESET_TYPE_NONE,
125   RESET_TYPE_RECOVERY
126 } phNxpEseProto7816_ResetType_t;
127 
128 /*!
129  * \brief I-frame information structure for ISO 7816-3
130  *
131  * This structure holds the  information of I-frame used for sending
132  * and receiving the frame packet.
133  *
134  */
135 typedef struct iFrameInfo {
136   bool isChained;  /*!< I-frame: Indicates if more frames to follow in the same
137                         data packet or not */
138   uint8_t* p_data; /*!< I-frame: Actual data (Information field (INF)) */
139 
140   uint8_t seqNo; /*!< I-frame: Sequence number of the I-frame */
141 
142   uint32_t maxDataLenIFSC; /*!< I-frame: Maximum data length to be allowed in a
143                           single I-frame */
144   uint32_t defaultDataLenIFSC; /*!< I-frame: Maximum data length to be allowed
145                           in a single I-frame */
146   uint32_t currentDataLenIFS;  /*!< I-frame: Current data length agreed
147                            between PCD and Card to be allowed in a
148                            single I-frame */
149 
150   uint32_t dataOffset;   /*!< I-frame: Offset to the actual data(INF) for the
151                             current frame of the packet */
152   uint32_t totalDataLen; /*!< I-frame: Total data left in the packet, used to
153                             set the chained flag/calculating offset */
154   uint32_t sendDataLen;  /*!< I-frame: the length of the I-frame actual data */
155 } iFrameInfo_t;
156 
157 /*!
158  * \brief S-frame information structure for ISO 7816-3
159  *
160  * This structure holds the  information of S-frame used for sending
161  * and receiving the frame packet.
162  *
163  */
164 typedef struct sFrameInfo {
165   sFrameTypes_t sFrameType; /*!< S-frame: Type of S-frame cmd/rsp */
166   uint8_t* p_data; /*!< S-frame: Actual data (Information field (INF)) */
167   uint8_t len;     /*!< S-frame: the length of the I-frame actual data */
168 } sFrameInfo_t;
169 
170 /*!
171  * \brief R-frame information structure for ISO 7816-3
172  *
173  * This structure holds the  information of R-frame used for sending
174  * and receiving the frame packet.
175  *
176  */
177 typedef struct rFrameInfo {
178   uint8_t seqNo; /*!< R-frame: Sequence number of the expected I-frame */
179   rFrameErrorTypes_t errCode; /*!< R-frame: Error type */
180 } rFrameInfo_t;
181 
182 /*!
183  * \brief ATRInfo: ISO7816 ATR Information bytes
184  *
185  * This structure holds ATR information bytes
186  *
187  */
188 typedef struct phNxpEseProto7816_ATR_Info {
189   uint8_t len;         /*!< ATR: ATR length in bytes */
190   uint8_t vendorID[5]; /*!< ATR: VendorID according to ISO7816-5 */
191   uint8_t dll_IC;      /*!< ATR: Data Link Layer - Interface Character */
192   uint8_t bgt[2];      /*!< ATR: Minimum guard time in milliseconds for
193                      T=1 blocks sent in opposite directions */
194   uint8_t
195       bwt[2];              /*!< ATR: Maximum allowed command processing
196                          time in milliseconds before card has sent either
197                          command response or S(WTX) requesting processing time extension */
198   uint8_t maxFreq[2];      /*!< ATR: Max supported  clock frequency in kHz  */
199   uint8_t checksum;        /*!< ATR: Checksum (0 = LRC / 1 = CRC) */
200   uint8_t defaultIFSC;     /*!< ATR: Default IFS size */
201   uint8_t numChannels;     /*!< ATR: Number of logical connections supported */
202   uint8_t maxIFSC[2];      /*!< ATR: Maximum size of IFS supported */
203   uint8_t capabilities[2]; /*!< ATR: Bitmap to indicate various features
204                         supported by SE Bit-1: SE Data Available Line supported.
205                         Bit-2: SE Data available polarity. 1 - Data available
206                         GPIO will be pulled HIGH when SE response is ready Bit
207                         3: SE chip reset S-blk command supported Bit-4: Extended
208                         frame length feature supported Bit-5: Support for more
209                         than one logical channel Bit 6 to 16: Reserved for
210                         future use
211                         */
212 } phNxpEseProto7816_ATR_Info_t;
213 
214 typedef struct phNxpEseProto7816_ATR_Info2 {
215   uint8_t channelNo; /*!< ATR: Current ongoing channel no */
216   uint8_t osType;    /*!< ATR: Indicates OS Type
217                        JCOP_OS    = 0x01
218                        UPDATER_OS = 0x02 */
219 } phNxpEseProto7816_ATR_Info2_t;
220 
221 /*!
222  * \brief Next/Last Tx information structure holding transceive data
223  *
224  * This structure holds the information of the next/last sent
225  * I-frame/R-frame/S-frame depending on the frame type
226  *
227  */
228 typedef struct phNxpEseProto7816_NextTx_Info {
229   iFrameInfo_t
230       IframeInfo; /*!< Information of the I-frame to be send next or the last
231                      sent I-frame depending on the frame type */
232   rFrameInfo_t
233       RframeInfo; /*!< Information of the R-frame to be send next or the last
234                      sent R-frame depending on the frame type */
235   sFrameInfo_t
236       SframeInfo; /*!< Information of the S-frame to be send next or the last
237                      sent S-frame depending on the frame type */
238   phNxpEseProto7816_FrameTypes_t
239       FrameType; /*!< Frame (I/R/S frames) type to be sent next */
240 } phNxpEseProto7816_NextTx_Info_t;
241 
242 /*!
243  * \brief Last sent Tx transceive data
244  *
245  * This structure holds the information of the last sent
246  * I-frame/R-frame/S-frame
247  *
248  */
249 typedef phNxpEseProto7816_NextTx_Info_t phNxpEseProto7816_LastTx_Info_t;
250 
251 /*!
252  * \brief Last Rx information structure holding transceive data
253  *
254  * This structure holds the information of the next/last sent
255  * I-frame/R-frame/S-frame
256  *
257  */
258 typedef struct phNxpEseRx_Cntx {
259   iFrameInfo_t lastRcvdIframeInfo; /*!< I-frame: Last received frame */
260   rFrameInfo_t lastRcvdRframeInfo; /*!< R-frame: Last received frame */
261   sFrameInfo_t lastRcvdSframeInfo; /*!< S-frame: Last received frame */
262   phNxpEseProto7816_FrameTypes_t
263       lastRcvdFrameType; /*!< Last received frame type */
264 } phNxpEseRx_Cntx_t;
265 
266 /*!
267  * \brief Proprietary: Secure timer value updates
268  *
269  * This structure holds the secure timer value
270  *
271  */
272 typedef struct phNxpEseProto7816SecureTimer {
273   unsigned int secureTimer1;
274   unsigned int secureTimer2;
275   unsigned int secureTimer3;
276 } phNxpEseProto7816SecureTimer_t;
277 
278 /*!
279  * \brief  structure to hold the interface reset parameters
280  * secure timer(only for PN8xT products) and atr info.
281  *
282  */
283 typedef struct phNxpEseProto7816_IntfResetParams {
284   phNxpEseProto7816SecureTimer_t* pSecureTimerParam;
285   phNxpEse_data* pAtrData;
286 } phNxpEseProto7816_IntfResetParams_t;
287 /*!
288  * \brief 7816-3 protocol stack context structure
289  *
290  * This structure holds the complete information of the
291  * 7816-3 protocol stack context
292  *
293  */
294 typedef struct phNxpEseProto7816 {
295   phNxpEseProto7816_LastTx_Info_t
296       phNxpEseLastTx_Cntx; /*!< Last transmitted frame information */
297   phNxpEseProto7816_NextTx_Info_t
298       phNxpEseNextTx_Cntx;           /*!< Next frame to be transmitted */
299   phNxpEseRx_Cntx_t phNxpEseRx_Cntx; /*!< Last received frame information */
300   phNxpEseProto7816_TransceiveStates_t
301       phNxpEseProto7816_nextTransceiveState; /*!< Next Transceive state. It
302                                                 determines the next
303                                                                                                         action to be done from host */
304   phNxpEseProto7816_State_t
305       phNxpEseProto7816_CurrentState; /*!< Current protocol stack state */
306   uint8_t recoveryCounter; /*!< Keeps track of number of error recovery done.
307                               Stack exits after it reaches max. count  */
308   unsigned long int wtx_counter_limit; /*!< Max. WTX counter limit */
309   unsigned long int wtx_counter;       /*!< WTX count tracker */
310   uint8_t timeoutCounter; /*!< Keeps track of number of timeout happened. Stack
311                              exits after it reaches max. count  */
312   phNxpEseProto7816_FrameTypes_t
313       lastSentNonErrorframeType; /*!< Copy of the last sent non-error frame
314                                     type: R-ACK, S-frame, I-frame */
315   unsigned long int rnack_retry_limit;
316   unsigned long int rnack_retry_counter;
317   unsigned long int
318       wtx_ntf_limit; /*!< Wtx count interval to notify service registered*/
319   phNxpEseProto7816SecureTimer_t secureTimerParams;
320   unsigned long int reset_type;
321   uint32_t currentIFSDSize;
322   phNxpEseProto7816_ATR_Info_t atrInfo;
323   phNxpEseProto7816_ATR_Info2_t extndAtrInfo;
324 } phNxpEseProto7816_t;
325 
326 /*!
327  * \brief 7816-3 protocol stack init params
328  *
329  * This structure holds the parameters to be passed to open 7816-3 protocol
330  *stack instance
331  *
332  */
333 typedef struct phNxpEseProto7816InitParam {
334   unsigned long int wtx_counter_limit; /*!< WTX count limit */
335   bool interfaceReset;                 /*!< INTF reset required or not>*/
336   unsigned long int rnack_retry_limit;
337   phNxpEseProto7816SecureTimer_t*
338       pSecureTimerParams; /*!< Secure timer value updated here >*/
339   unsigned long int
340       wtx_ntf_limit; /*!< Wtx count interval to notify service registered*/
341 } phNxpEseProto7816InitParam_t;
342 
343 /*!
344  * \brief 7816-3 protocol PCB bit level structure
345  *
346  * This structure holds the bit level information of PCB byte
347  * as per 7816-3 protocol
348  *
349  */
350 typedef struct phNxpEseProto7816_PCB_bits {
351   uint8_t lsb : 1;  /*!< PCB: lsb */
352   uint8_t bit2 : 1; /*!< PCB: bit2 */
353   uint8_t bit3 : 1; /*!< PCB: bit3 */
354   uint8_t bit4 : 1; /*!< PCB: bit4 */
355   uint8_t bit5 : 1; /*!< PCB: bit5 */
356   uint8_t bit6 : 1; /*!< PCB: bit6 */
357   uint8_t bit7 : 1; /*!< PCB: bit7 */
358   uint8_t msb : 1;  /*!< PCB: msb */
359 } phNxpEseProto7816_PCB_bits_t;
360 
361 /*!
362  * \brief Max. size of the frame that can be sent
363  */
364 #define IFSC_SIZE_SEND 254
365 /*!
366  * \brief Delay to be used before sending the next frame, after error reported
367  * by ESE
368  */
369 #define DELAY_ERROR_RECOVERY_1_MS 1000
370 
371 #define GET_DELAY_ERROR_RECOVERY()           \
372   ((GET_CHIP_OS_VERSION() != OS_VERSION_4_0) \
373        ? (10 * DELAY_ERROR_RECOVERY_1_MS)    \
374        : (3.5 * DELAY_ERROR_RECOVERY_1_MS))
375 /*!
376  * \brief 7816-3 protocol frame
377  * header length
378  */
379 #define PH_PROTO_7816_HEADER_LEN 0x03
380 /*!
381  * \brief 7816-3 protocol ext.frame header length
382  */
383 #define PH_PROTO_7816_EXT_HEADER_LEN 0x05
384 /*!
385  * \brief 7816-3 protocol frame CRC length
386  */
387 #define PH_PROTO_7816_CRC_LEN 0x01
388 /*!
389  * \brief 7816-3 Chaining flag bit for masking
390  */
391 #define PH_PROTO_7816_CHAINING 0x20
392 /*!
393  * \brief 7816-3 PCB byte offset
394  */
395 #define PH_PROPTO_7816_PCB_OFFSET 0x01
396 /*!
397  * \brief 7816-3 frame length offset
398  */
399 #define PH_PROPTO_7816_FRAME_LENGTH_OFFSET 0x02
400 /*!
401  * \brief 7816-3 S-frame timer 1
402  */
403 #define PH_PROPTO_7816_SFRAME_TIMER1 0xF1
404 /*!
405  * \brief 7816-3 S-frame timer 2
406  */
407 #define PH_PROPTO_7816_SFRAME_TIMER2 0xF2
408 /*!
409  * \brief 7816-3 S-frame timer 3
410  */
411 #define PH_PROPTO_7816_SFRAME_TIMER3 0xF3
412 
413 /*!
414  * \brief 7816-3 S-block request command mask
415  */
416 #define PH_PROTO_7816_S_BLOCK_REQ 0xC0
417 /*!
418  * \brief 7816-3 S-block response mask
419  */
420 #define PH_PROTO_7816_S_BLOCK_RSP 0xE0
421 /*!
422  * \brief 7816-3 S-block reset command mask
423  */
424 #define PH_PROTO_7816_S_RESET 0x04
425 /*!
426  * \brief 7816-3 S-block End of APDU cmd mask
427  */
428 #define PH_PROTO_7816_S_END_OF_APDU 0x05
429 /*!
430  * \brief 7816-3 S-block WTX mask
431  */
432 #define PH_PROTO_7816_S_WTX 0x03
433 /*!
434  * \brief 7816-3 S-block re-sync mask
435  */
436 #define PH_PROTO_7816_S_RESYNCH 0x00
437 /*!
438  * \brief 7816-3 S-block hard reset cmd mask
439  */
440 #define PH_PROTO_7816_S_HRD_RST_CMD 0x06
441 /*!
442  * \brief 7816-3 protocol max. error retry counter
443  */
444 #define PH_PROTO_7816_FRAME_RETRY 01
445 /*!
446  * \brief 7816-3 protocol max. error retry counter based on OS version
447  */
448 #define GET_FRAME_RETRY_COUNT()              \
449   ((GET_CHIP_OS_VERSION() != OS_VERSION_4_0) \
450        ? (3 * PH_PROTO_7816_FRAME_RETRY)     \
451        : (10 * PH_PROTO_7816_FRAME_RETRY))
452 
453 /*!
454  * \brief 7816-3 protocol max. WTX default count
455  */
456 #define PH_PROTO_WTX_DEFAULT_COUNT 500
457 /*!
458  * \brief 7816-3 protocol max. timeout retry count
459  */
460 #define PH_PROTO_7816_TIMEOUT_RETRY_COUNT 1
461 /*!
462  * \brief 7816-3 to represent magic number zero
463  */
464 #define PH_PROTO_7816_VALUE_ZERO 0x00
465 /*!
466  * \brief 7816-3 to represent magic number one
467  */
468 #define PH_PROTO_7816_VALUE_ONE 0x01
469 /*!
470  * \brief 7816-3 for max retry for CRC error
471  */
472 #define MAX_RNACK_RETRY_LIMIT 0x02
473 /*!
474  * \brief APIs exposed from the 7816-3 protocol layer
475  */
476 #define EXTENDED_FRAME_MARKER 0xFF
477 /*!
478  * \brief APIs exposed from the 7816-3 protocol layer
479  */
480 #define PH_PROTO_CLOSE_ALL_SESSION_INF 0x01
481 /*!
482  * \brief APIs exposed from the 7816-3 protocol layer
483  */
484 #define PH_PROTO_CLOSE_ALL_SESSION_LEN 0x01
485 /*!
486  * \brief APIs exposed from the 7816-3 protocol layer
487  */
488 #define PH_PROTO_ATR_RSP_VENDOR_ID_LEN 0x05
489 /*!
490  * \brief APIs exposed from the 7816-3 protocol layer
491  */
492 #define PH_SE_OS_VERSION_10 0x10
493 /*!
494  * \brief APIs exposed from the 7816-3 protocol layer
495  */
496 #define PH_SE_OS_VERSION_11 0x11
497 /*!
498  * \brief OS version on SE for SN220
499  */
500 #define PH_SE_OS_VERSION_20 0x20
501 /*!
502  * \brief OS version on SE for SN220
503  */
504 #define PH_SE_OS_VERSION_21 0x21
505 /*!
506  * \brief Default wait extension notification interval
507  */
508 #define PH_DEFAULT_WTX_NTF_LIMIT 0x03
509 /*!
510  * \delay for hard reset response
511  */
512 #define HARD_RESET_RES_DELAY 4000
513 
514 /**
515  * \ingroup ISO7816-3_protocol_lib
516  * \brief This function is used to reset just the current interface
517  *
518  * \param[in]      secureTimerParams - secure timer instance
519  *
520  */
521 ESESTATUS phNxpEseProto7816_IntfReset(
522     phNxpEseProto7816SecureTimer_t* secureTimerParams);
523 
524 /**
525  * \ingroup ISO7816-3_protocol_lib
526  * \brief This function is used to close the 7816 protocol stack instance
527  *
528  * \param[in]      secureTimerParams - secure timer instance
529  *
530  */
531 ESESTATUS phNxpEseProto7816_Close(
532     phNxpEseProto7816SecureTimer_t* secureTimerParams);
533 
534 /**
535  * \ingroup ISO7816-3_protocol_lib
536  * \brief This function is used to open the 7816 protocol stack instance
537  *
538  * \param[in]      initParam: Initialization params
539  *
540  */
541 ESESTATUS phNxpEseProto7816_Open(phNxpEseProto7816InitParam_t initParam);
542 
543 /**
544  * \ingroup ISO7816-3_protocol_lib
545  * \brief This function is used to
546  *                  1. Send the raw data received from application after
547  *computing LRC
548  *                  2. Receive the response data from ESE, decode, process
549  *and
550  *                     store the data.
551  *                  3. Get the final complete data and sent back to application
552  *
553  * \param[in]       pCmd: Command to ESE
554  * \param[out]     pRsp: Response from ESE
555  *
556  *
557  */
558 ESESTATUS phNxpEseProto7816_Transceive(phNxpEse_data* pCmd,
559                                        phNxpEse_data* pRsp);
560 
561 /**
562  * \ingroup ISO7816-3_protocol_lib
563  * \brief This function is used to reset the 7816 protocol stack instance
564  *
565  *
566  *
567  */
568 ESESTATUS phNxpEseProto7816_Reset(void);
569 
570 /**
571  * \ingroup ISO7816-3_protocol_lib
572  * \brief This function is used to set the max T=1 data send size
573  *
574  * \param[in]   IFS_Size: Max. size of the I-frame
575  *
576  */
577 ESESTATUS phNxpEseProto7816_SetIfs(uint16_t IFS_Size);
578 /**
579  * \ingroup ISO7816-3_protocol_lib
580  * \brief This function is used to set the endpoint
581  *
582  * \param[in]  uEndPoint:   END_POINT_ESE = 0 (eSE services), END_POINT_EUICC
583  * =1(UICC services)
584  *
585  */
586 ESESTATUS phNxpEseProto7816_SetEndPoint(uint8_t uEndPoint);
587 /**
588  * \ingroup ISO7816-3_protocol_lib
589  * \brief This function is used to reset the endpoint
590  *
591  * \param[in]  uEndPoint:   END_POINT_ESE = 0 (eSE services), END_POINT_EUICC
592  * =1(UICC services)
593  *
594  */
595 ESESTATUS phNxpEseProto7816_ResetEndPoint(uint8_t uEndPoint);
596 /**
597  * \ingroup ISO7816-3_protocol_lib
598  * \brief This function is used to get ATR bytes for the application
599  *
600  * \param[out] pATRRsp: Response ATR bytes from ESE
601  *
602  */
603 ESESTATUS phNxpEseProto7816_getAtr(phNxpEse_data* pATRRsp);
604 
605 /**
606  * \ingroup ISO7816-3_protocol_lib
607  * \brief This function is used to get the max T=1 data send size
608  *
609  * \retval Current IFS adjusted value wrt card.
610  *
611  */
612 uint16_t phNxpEseProto7816_GetIfs(void);
613 
614 /**
615  * \ingroup ISO7816-3_protocol_lib
616  * \brief This function is used to get OS mode(JCOP/OSU)
617  *
618  * \retval OS mode(JCOP/OSU).
619  *
620  */
621 phNxpEseProto7816_OsType_t phNxpEseProto7816_GetOsMode(void);
622 /**
623  * \ingroup ISO7816-3_protocol_lib
624  * \brief This function is used to check eSE is alive/responding
625  *
626  *
627  *
628  */
629 ESESTATUS phNxpEseProto7816_CloseAllSessions(void);
630 /** @} */
631 #endif /* _PHNXPESEPROTO7816_3_H_ */
632