diff options
author | Martijn Coenen <martijn.coenen@nxp.com> | 2010-12-16 16:54:00 +0100 |
---|---|---|
committer | Jeff Hamilton <jham@android.com> | 2010-12-16 14:02:04 -0600 |
commit | d75796b759f9baac8facf22f1b6c6bcfbc51161e (patch) | |
tree | cd2557b01e06ddedcfb7eed87e727b0b7a103a9d /src/phHal4Nfc_Reader.c | |
parent | 04f25b3ab4ed13edb3ffc8e7354bca9f7bc60b44 (diff) | |
download | external_libnfc-nxp-d75796b759f9baac8facf22f1b6c6bcfbc51161e.zip external_libnfc-nxp-d75796b759f9baac8facf22f1b6c6bcfbc51161e.tar.gz external_libnfc-nxp-d75796b759f9baac8facf22f1b6c6bcfbc51161e.tar.bz2 |
Add support for connecting to different handles on the same tag.
This is needed for proper multi-protocol tag support.
(Before this required a restart of the polling loop).
Change-Id: If61da437cda40d82bdbacf5a01ea4c585c7a5be9
Diffstat (limited to 'src/phHal4Nfc_Reader.c')
-rw-r--r-- | src/phHal4Nfc_Reader.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/phHal4Nfc_Reader.c b/src/phHal4Nfc_Reader.c index d74e5e9..b767858 100644 --- a/src/phHal4Nfc_Reader.c +++ b/src/phHal4Nfc_Reader.c @@ -188,6 +188,42 @@ NFCSTATUS phHal4Nfc_Connect( ); Hal4Ctxt->Hal4NextState = eHal4StateTargetActivate; } +#ifdef RECONNECT_SUPPORT + else if (psRemoteDevInfo != + Hal4Ctxt->sTgtConnectInfo.psConnectedDevice) + { + phHal_sRemoteDevInformation_t *ps_store_connected_device = + Hal4Ctxt->sTgtConnectInfo.psConnectedDevice; + + RemoteDevCount = Hal4Ctxt->psADDCtxtInfo->nbr_of_devices; + + while (0 != RemoteDevCount) + { + RemoteDevCount--; + /*Check if handle provided by upper layer matches with any + remote device in the list*/ + if(psRemoteDevInfo == (Hal4Ctxt->rem_dev_list[RemoteDevCount])) + { + break; + } + }/*End of while*/ + + if (ps_store_connected_device == + Hal4Ctxt->sTgtConnectInfo.psConnectedDevice) + { + RetStatus = phHciNfc_Reactivate (Hal4Ctxt->psHciHandle, + (void *)psHwReference, + psRemoteDevInfo); + + if (NFCSTATUS_PENDING == RetStatus) + { + Hal4Ctxt->sTgtConnectInfo.psConnectedDevice = + Hal4Ctxt->rem_dev_list[RemoteDevCount]; + Hal4Ctxt->Hal4NextState = eHal4StateTargetActivate; + } + } + } +#endif /* #ifdef RECONNECT_SUPPORT */ else if(NULL == Hal4Ctxt->sTgtConnectInfo.psConnectedDevice) { /*Wrong state to issue connect*/ |