Home | History | Annotate | Download | only in src
      1 /*
      2  * Copyright (C) 2010 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 /*!
     18  * \file  phLibNfc_SE.h
     19  *
     20  * Project: NFC-FRI 1.1
     21  *
     22  * $Workfile:: phLibNfc_1.1.h  $
     23  * $Modtime::         $
     24  * $Author: ing07299 $
     25  * $Revision: 1.14 $
     26  *
     27  */
     28 #ifndef PHLIBNFC_SE_H
     29 #define PHLIBNFC_SE_H
     30 
     31 #define LIBNFC_SE_INVALID_HANDLE 0
     32 #define LIBNFC_SE_SUPPORTED      2
     33 #define LIBNFC_SE_BASE_HANDLE    0xABCDEF
     34 
     35 #define LIBNFC_SE_SMARTMX_INDEX  0
     36 #define LIBNFC_SE_UICC_INDEX     1
     37 
     38 #define PAUSE_PHASE     0x0824  /*Indicates the Pause phase duration*/
     39 #define EMULATION_PHASE 0x5161  /*Indicates the Emulation phase duration*/
     40 
     41 typedef struct phLibNfc_SeCallbackInfo
     42 {
     43     /* SE set mode callback and its context */
     44     pphLibNfc_SE_SetModeRspCb_t         pSEsetModeCb;
     45     void                                *pSEsetModeCtxt;
     46     /* Store SE discovery notification callback and its context */
     47     pphLibNfc_SE_NotificationCb_t       pSeListenerNtfCb;
     48     void                                *pSeListenerCtxt;
     49 
     50 }phLibNfc_SECallbackInfo_t;
     51 
     52 /*SE State */
     53 typedef enum {
     54             phLibNfc_eSeInvalid   = 0x00,
     55             phLibNfc_eSeInit,
     56             phLibNfc_eSeReady,
     57             phLibNfc_eSeVirtual,
     58             phLibNfc_eSeWired
     59 }phLibNfc_SeState_t;
     60 
     61 
     62 /* Context for secured element */
     63 typedef struct phLibNfc_SeCtxt
     64 {
     65 
     66     /* UICC Status in Virtual Mode */
     67     uint8_t                         uUiccActivate;
     68 
     69     /* SMX Status in Virtual Mode */
     70     uint8_t                         uSmxActivate;
     71 
     72     /* Count of the Secure Elements Present */
     73     uint8_t                         uSeCount;
     74 
     75     /* Se Temp handle */
     76     phLibNfc_Handle                 hSetemp;
     77 
     78     /*Current SE state*/
     79     phLibNfc_SeState_t              eSE_State;
     80 
     81     /*Current SE Mode */
     82 
     83     phLibNfc_eSE_ActivationMode     eActivatedMode;
     84 
     85     /* SE callback information */
     86     phLibNfc_SECallbackInfo_t       sSeCallabackInfo;
     87 
     88 }phLibNfc_SeCtxt_t;
     89 
     90 extern phLibNfc_SE_List_t sSecuredElementInfo[PHLIBNFC_MAXNO_OF_SE];
     91 
     92 
     93 
     94 #endif
     95 
     96 
     97