diff options
author | Martijn Coenen <martijn.coenen@nxp.com> | 2011-02-18 15:39:50 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-02-18 15:39:50 -0800 |
commit | 323956234e513e9200e2ec2b44dee3a37e937094 (patch) | |
tree | 9e1e6c4e45bcb42e754ae7837b9da79a2d285960 | |
parent | 7f475e47862231e0de830700dd4b56bd3b03e569 (diff) | |
parent | a61bf7e2cb6cf80f1deea680613423a477ac4fb8 (diff) | |
download | external_libnfc-nxp-323956234e513e9200e2ec2b44dee3a37e937094.zip external_libnfc-nxp-323956234e513e9200e2ec2b44dee3a37e937094.tar.gz external_libnfc-nxp-323956234e513e9200e2ec2b44dee3a37e937094.tar.bz2 |
am a61bf7e2: Narrow down NFCSTATUS_TARGET_LOST responses from libNFC.
* commit 'a61bf7e2cb6cf80f1deea680613423a477ac4fb8':
Narrow down NFCSTATUS_TARGET_LOST responses from libNFC.
-rw-r--r-- | src/phLibNfc_initiator.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/phLibNfc_initiator.c b/src/phLibNfc_initiator.c index d93d5f6..340af78 100644 --- a/src/phLibNfc_initiator.c +++ b/src/phLibNfc_initiator.c @@ -55,7 +55,7 @@ *************************** Global Variables ********************************** */ - +#define PN544_IO_TIMEOUT_RESPONSE 0x89 /* *************************** Static Function Declaration *********************** @@ -1154,10 +1154,17 @@ void phLibNfc_RemoteDev_Transceive_Cb(void *context, phLibNfc_Reconnect_Mifare_Cb, (void *)gpphLibContext); } - else + else if ((PHNFCSTATUS(status) == PN544_IO_TIMEOUT_RESPONSE) || + (PHNFCSTATUS(status) == NFCSTATUS_RF_TIMEOUT)) { + // 0x89, 0x09 HCI response values from PN544 indicate timeout trans_status = NFCSTATUS_TARGET_LOST; } + else + { + // PN544 did get some reply from tag, just not valid + trans_status = NFCSTATUS_FAILED; + } /*Update the state machine */ phLibNfc_UpdateCurState(status,gpphLibContext); gpphLibContext->LibNfcState.next_state = eLibNfcHalStateConnect; |