diff options
-rw-r--r-- | src/phLibNfc.h | 6 | ||||
-rw-r--r-- | src/phLibNfc_SE.c | 36 |
2 files changed, 32 insertions, 10 deletions
diff --git a/src/phLibNfc.h b/src/phLibNfc.h index 0ef7522..c09815a 100644 --- a/src/phLibNfc.h +++ b/src/phLibNfc.h @@ -168,9 +168,11 @@ typedef enum element*/ phLibNfc_eSE_EvtTypeTransaction=0x02, /**<Indicates external reader trying to access secure element */ - phLibNfc_eSE_EvtConnectivity /**<This event notifies the terminal host that it shall + phLibNfc_eSE_EvtConnectivity, /**<This event notifies the terminal host that it shall send a connectivity event from UICC as defined in - ETSI TS 102 622 V7.4.0 */ + ETSI TS 102 622 V7.4.0 */ + phLibNfc_eSE_EvtFieldOn, // consider using phLibNfc_eSE_EvtConnectivity + phLibNfc_eSE_EvtFieldOff, } phLibNfc_eSE_EvtType_t; /** diff --git a/src/phLibNfc_SE.c b/src/phLibNfc_SE.c index 42334d8..958f0d1 100644 --- a/src/phLibNfc_SE.c +++ b/src/phLibNfc_SE.c @@ -213,8 +213,8 @@ STATIC void phLibNfc_SeNotification(void *context, &Se_Trans_Info, status); break; - } - case NFC_EVT_CONNECTIVITY: + } + case NFC_EVT_CONNECTIVITY: { (*pLibContext->sSeContext.sSeCallabackInfo.pSeListenerNtfCb)( pLibContext->sSeContext.sSeCallabackInfo.pSeListenerCtxt, @@ -223,17 +223,37 @@ STATIC void phLibNfc_SeNotification(void *context, &Se_Trans_Info, status); break; - } - case NFC_EVT_START_OF_TRANSACTION: // PLG ++ - - (*pLibContext->sSeContext.sSeCallabackInfo.pSeListenerNtfCb)( + } + case NFC_EVT_START_OF_TRANSACTION: + { + (*pLibContext->sSeContext.sSeCallabackInfo.pSeListenerNtfCb)( pLibContext->sSeContext.sSeCallabackInfo.pSeListenerCtxt, phLibNfc_eSE_EvtTypeTransaction, pSeInfo->hSecureElement, &Se_Trans_Info, status); - - break; // PLG -- + break; + } + case NFC_EVT_FIELD_ON: + { + (*pLibContext->sSeContext.sSeCallabackInfo.pSeListenerNtfCb)( + pLibContext->sSeContext.sSeCallabackInfo.pSeListenerCtxt, + phLibNfc_eSE_EvtFieldOn, + pSeInfo->hSecureElement, + &Se_Trans_Info, + status); + break; + } + case NFC_EVT_FIELD_OFF: + { + (*pLibContext->sSeContext.sSeCallabackInfo.pSeListenerNtfCb)( + pLibContext->sSeContext.sSeCallabackInfo.pSeListenerCtxt, + phLibNfc_eSE_EvtFieldOff, + pSeInfo->hSecureElement, + &Se_Trans_Info, + status); + break; + } default: { break; |