First add
[adaptation/devices/nfc-plugin-nxp.git] / src / phLibNfc_SE.h
1 /*\r
2  * Copyright (C) 2010 NXP Semiconductors\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 /*!\r
18  * \file  phLibNfc_SE.h\r
19  *\r
20  * Project: NFC-FRI 1.1\r
21  *\r
22  * $Workfile:: phLibNfc_1.1.h  $\r
23  * $Modtime::         $\r
24  * $Author: ing07299 $\r
25  * $Revision: 1.14 $\r
26  *\r
27  */\r
28 #ifndef PHLIBNFC_SE_H\r
29 #define PHLIBNFC_SE_H\r
30 \r
31 #define LIBNFC_SE_INVALID_HANDLE 0\r
32 #define LIBNFC_SE_SUPPORTED      2\r
33 #define LIBNFC_SE_BASE_HANDLE    0xABCDEF\r
34 \r
35 #define LIBNFC_SE_SMARTMX_INDEX  0\r
36 #define LIBNFC_SE_UICC_INDEX     1\r
37 \r
38 #define PAUSE_PHASE     0x0824  /*Indicates the Pause phase duration*/\r
39 #define EMULATION_PHASE 0x5161  /*Indicates the Emulation phase duration*/\r
40 \r
41 typedef struct phLibNfc_SeCallbackInfo\r
42 {\r
43     /* SE set mode callback and its context */\r
44     pphLibNfc_SE_SetModeRspCb_t         pSEsetModeCb;\r
45     void                                *pSEsetModeCtxt; \r
46     /* Store SE discovery notification callback and its context */\r
47     pphLibNfc_SE_NotificationCb_t       pSeListenerNtfCb;\r
48     void                                *pSeListenerCtxt;\r
49 \r
50 }phLibNfc_SECallbackInfo_t;\r
51 \r
52 /*SE State */\r
53 typedef enum {\r
54             phLibNfc_eSeInvalid   = 0x00,\r
55             phLibNfc_eSeInit,\r
56             phLibNfc_eSeReady,\r
57             phLibNfc_eSeVirtual,\r
58             phLibNfc_eSeWired\r
59 }phLibNfc_SeState_t;\r
60 \r
61 \r
62 /* Context for secured element */\r
63 typedef struct phLibNfc_SeCtxt\r
64 {\r
65 \r
66     /* UICC Status in Virtual Mode */\r
67     uint8_t                         uUiccActivate;   \r
68 \r
69     /* SMX Status in Virtual Mode */\r
70     uint8_t                         uSmxActivate;\r
71 \r
72     /* Count of the Secure Elements Present */\r
73     uint8_t                         uSeCount;\r
74     \r
75     /* Se Temp handle */\r
76     phLibNfc_Handle                 hSetemp;\r
77 \r
78     /*Current SE state*/\r
79     phLibNfc_SeState_t              eSE_State;\r
80 \r
81     /*Current SE Mode */\r
82 \r
83     phLibNfc_eSE_ActivationMode     eActivatedMode;\r
84 \r
85     /* SE callback information */\r
86     phLibNfc_SECallbackInfo_t       sSeCallabackInfo;\r
87 \r
88 }phLibNfc_SeCtxt_t;\r
89 \r
90 extern phLibNfc_SE_List_t sSecuredElementInfo[PHLIBNFC_MAXNO_OF_SE];\r
91 \r
92 \r
93 \r
94 #endif\r
95 \r
96 \r