diff options
author | Daniel Tomas <dtomas.nxp@gmail.com> | 2011-07-21 18:29:47 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-07-21 18:29:47 -0700 |
commit | d8b82bee73cd01e236637f7d316965da3c5ff923 (patch) | |
tree | a83247a714428a7f391112a1f718e590c95185dc /src | |
parent | 0ca6912acf53a4081b9312d3b628a87f81dadc52 (diff) | |
parent | 34caeca8a5ec2aedade68a77393d0aff03f9bd72 (diff) | |
download | external_libnfc-nxp-d8b82bee73cd01e236637f7d316965da3c5ff923.zip external_libnfc-nxp-d8b82bee73cd01e236637f7d316965da3c5ff923.tar.gz external_libnfc-nxp-d8b82bee73cd01e236637f7d316965da3c5ff923.tar.bz2 |
am 34caeca8: Patch to support multiple connection on Multiple protocol TAG
* commit '34caeca8a5ec2aedade68a77393d0aff03f9bd72':
Patch to support multiple connection on Multiple protocol TAG
Diffstat (limited to 'src')
-rw-r--r-- | src/phLibNfc.c | 1 | ||||
-rw-r--r-- | src/phLibNfc_Internal.h | 3 | ||||
-rw-r--r-- | src/phLibNfc_initiator.c | 8 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/phLibNfc.c b/src/phLibNfc.c index db6fd26..71225ba 100644 --- a/src/phLibNfc.c +++ b/src/phLibNfc.c @@ -580,6 +580,7 @@ NFCSTATUS phLibNfc_Mgt_Reset(void *pContext) } /* No device is connected */ gpphLibContext->Connected_handle = 0x00; + gpphLibContext->Prev_Connected_handle = 0x00; gpphLibContext->ReleaseType = NFC_INVALID_RELEASE_TYPE; gpphLibContext->eLibNfcCfgMode = NFC_DISCOVERY_STOP; /*Lib Nfc Stack is initilized and in idle state*/ diff --git a/src/phLibNfc_Internal.h b/src/phLibNfc_Internal.h index 10018ec..304ac22 100644 --- a/src/phLibNfc_Internal.h +++ b/src/phLibNfc_Internal.h @@ -221,6 +221,9 @@ typedef struct phLibNfc_LibContext uint32_t Connected_handle, Discov_handle[MAX_REMOTE_DEVICES]; + /* To store the previous connected handle in case of Multiple protocol tags */ + uint32_t Prev_Connected_handle; + /*Call back function pointers */ phLibNfc_eDiscoveryConfigMode_t eLibNfcCfgMode; diff --git a/src/phLibNfc_initiator.c b/src/phLibNfc_initiator.c index 340af78..2a03c05 100644 --- a/src/phLibNfc_initiator.c +++ b/src/phLibNfc_initiator.c @@ -548,6 +548,9 @@ phLibNfc_RemoteDev_ReConnect ( gpphLibContext->CBInfo.pClientConCntx = pContext; gpphLibContext->status.GenCb_pending_status = TRUE; gpphLibContext->LibNfcState.next_state = eLibNfcHalStateConnect; + + gpphLibContext->Prev_Connected_handle = gpphLibContext->Connected_handle; + gpphLibContext->Connected_handle = hRemoteDevice; } else if (NFCSTATUS_INVALID_REMOTE_DEVICE == PHNFCSTATUS(ret_val)) @@ -633,6 +636,7 @@ NFCSTATUS phLibNfc_RemoteDev_Connect( gpphLibContext->CBInfo.pClientConCntx = pContext; gpphLibContext->status.GenCb_pending_status=TRUE; gpphLibContext->LibNfcState.next_state = eLibNfcHalStateConnect; + gpphLibContext->Prev_Connected_handle = gpphLibContext->Connected_handle; gpphLibContext->Connected_handle = hRemoteDevice; } else if(PHNFCSTATUS(RetVal) == NFCSTATUS_INVALID_REMOTE_DEVICE) @@ -757,6 +761,7 @@ STATIC void phLibNfc_RemoteDev_Connect_Cb( /* If remote device is invalid return as TARGET LOST to upper layer*/ /* If error code is other than SUCCESS return NFCSTATUS_TARGET_LOST */ Connect_status = NFCSTATUS_TARGET_LOST; + gpphLibContext->Connected_handle = gpphLibContext->Prev_Connected_handle ; } gpphLibContext->ndef_cntx.is_ndef = CHK_NDEF_NOT_DONE; /* Update the Current Sate*/ @@ -896,6 +901,9 @@ STATIC void phLibNfc_RemoteDev_Disconnect_cb( gpphLibContext->LastTrancvSuccess = FALSE; /*Reset Connected handle */ gpphLibContext->Connected_handle=0x0000; + /*Reset previous Connected handle */ + gpphLibContext->Prev_Connected_handle = 0x0000; + if(gpphLibContext->sSeContext.eActivatedMode == phLibNfc_SE_ActModeWired) { gpphLibContext->sSeContext.eActivatedMode = phLibNfc_SE_ActModeDefault; |