1 /* 2 * Copyright (C) 2015 NXP Semiconductors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef ICHANNEL_H_ 18 #define ICHANNEL_H_ 19 20 #include "data_types.h" 21 typedef struct IChannel 22 { 23 /******************************************************************************* 24 ** 25 ** Function: Open 26 ** 27 ** Description: Initialize the channel. 28 ** 29 ** Returns: True if ok. 30 ** 31 *******************************************************************************/ 32 INT16 (*open)(); 33 /******************************************************************************* 34 ** 35 ** Function: close 36 ** 37 ** Description: Close the channel. 38 ** 39 ** Returns: True if ok. 40 ** 41 *******************************************************************************/ 42 bool (*close)(INT16 mHandle); 43 44 /******************************************************************************* 45 ** 46 ** Function: transceive 47 ** 48 ** Description: Send data to the secure element; read it's response. 49 ** xmitBuffer: Data to transmit. 50 ** xmitBufferSize: Length of data. 51 ** recvBuffer: Buffer to receive response. 52 ** recvBufferMaxSize: Maximum size of buffer. 53 ** recvBufferActualSize: Actual length of response. 54 ** timeoutMillisec: timeout in millisecond 55 ** 56 ** Returns: True if ok. 57 ** 58 *******************************************************************************/ 59 bool (*transceive) (UINT8* xmitBuffer, INT32 xmitBufferSize, UINT8* recvBuffer, 60 INT32 recvBufferMaxSize, INT32& recvBufferActualSize, INT32 timeoutMillisec); 61 62 /******************************************************************************* 63 ** 64 ** Function: doeSE_Reset 65 ** 66 ** Description: Power OFF and ON to eSE 67 ** 68 ** Returns: None. 69 ** 70 *******************************************************************************/ 71 72 void (*doeSE_Reset)(); 73 /******************************************************************************* 74 ** 75 ** Function: doeSE_JcopDownLoadReset 76 ** 77 ** Description: Power OFF and ON to eSE during JCOP Update 78 ** 79 ** Returns: None. 80 ** 81 *******************************************************************************/ 82 83 void (*doeSE_JcopDownLoadReset)(); 84 85 }IChannel_t; 86 87 88 #endif /* ICHANNEL_H_ */ 89