summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinc/phNfcConfig.h2
-rw-r--r--src/phFriNfc_FelicaMap.c14
2 files changed, 14 insertions, 2 deletions
diff --git a/inc/phNfcConfig.h b/inc/phNfcConfig.h
index 0c94dc0..8e44c2e 100755
--- a/inc/phNfcConfig.h
+++ b/inc/phNfcConfig.h
@@ -172,7 +172,7 @@
#ifndef NXP_ISO_XCHG_TIMEOUT
-#define NXP_ISO_XCHG_TIMEOUT 0x1AU
+#define NXP_ISO_XCHG_TIMEOUT 0x1BU
#endif
#ifndef NXP_MIFARE_XCHG_TIMEOUT
diff --git a/src/phFriNfc_FelicaMap.c b/src/phFriNfc_FelicaMap.c
index 8a810f9..39b98d9 100644
--- a/src/phFriNfc_FelicaMap.c
+++ b/src/phFriNfc_FelicaMap.c
@@ -631,6 +631,7 @@ static NFCSTATUS phFriNfc_Felica_HChkApduBuff_Size( phFriNfc_NdefMap_t *NdefMap)
NFCSTATUS status = NFCSTATUS_PENDING;
uint8_t ResetFlag = FALSE;
uint32_t Nbc = 0;
+ uint32_t DataLen = 0;
Nbc = phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC);
@@ -733,7 +734,18 @@ static NFCSTATUS phFriNfc_Felica_HChkApduBuff_Size( phFriNfc_NdefMap_t *NdefMap)
}
if ( ResetFlag == TRUE)
{
- *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex;
+ PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0],
+ NdefMap->FelicaAttrInfo.LenBytes[1],
+ NdefMap->FelicaAttrInfo.LenBytes[2],
+ DataLen);
+ if (NdefMap->ApduBuffIndex > DataLen)
+ {
+ *NdefMap->NumOfBytesRead = DataLen;
+ }
+ else
+ {
+ *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex;
+ }
/*Reset the index, internal buffer counters back to zero*/
NdefMap->ApduBuffIndex = 0;
NdefMap->Felica.Rd_NoBytesToCopy=0;