summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2012-11-28 14:45:57 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-28 14:45:58 -0800
commit54222dd9925b48b9d124a1f73302866cb5256788 (patch)
tree6c2f59e67b5ba4bd2a128d51ee9d60a5e0a6d8ff
parent31cfc51c6d32ae1a6acbacede3b749dacc6cc940 (diff)
parent35f614f9db6e01ed6d07eda5fba5d647839d50a3 (diff)
downloadexternal_libnfc-nxp-54222dd9925b48b9d124a1f73302866cb5256788.zip
external_libnfc-nxp-54222dd9925b48b9d124a1f73302866cb5256788.tar.gz
external_libnfc-nxp-54222dd9925b48b9d124a1f73302866cb5256788.tar.bz2
Merge "NDEF Type 3 tag reading with padding bytes" into jb-mr1.1-dev
-rw-r--r--src/phFriNfc_FelicaMap.c14
1 files changed, 13 insertions, 1 deletions
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;