summaryrefslogtreecommitdiffstats
path: root/src/phLibNfc_initiator.c
diff options
context:
space:
mode:
authorDaniel Tomas <dtomas.nxp@gmail.com>2011-06-29 10:54:30 +0200
committerNick Pelly <npelly@google.com>2011-07-14 10:09:37 -0700
commit34caeca8a5ec2aedade68a77393d0aff03f9bd72 (patch)
tree45efc14fc76e3f42e2d3c74cca54cb552dc67714 /src/phLibNfc_initiator.c
parenta0cd2ea15e2c664f523303703dd5aafc9351e833 (diff)
downloadexternal_libnfc-nxp-34caeca8a5ec2aedade68a77393d0aff03f9bd72.zip
external_libnfc-nxp-34caeca8a5ec2aedade68a77393d0aff03f9bd72.tar.gz
external_libnfc-nxp-34caeca8a5ec2aedade68a77393d0aff03f9bd72.tar.bz2
Patch to support multiple connection on Multiple protocol TAG
Change-Id: I0f09869458ebbc6d77363338975754335569b6a6
Diffstat (limited to 'src/phLibNfc_initiator.c')
-rw-r--r--src/phLibNfc_initiator.c8
1 files changed, 8 insertions, 0 deletions
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;