summaryrefslogtreecommitdiffstats
path: root/src/phLibNfc_ndef_raw.c
diff options
context:
space:
mode:
authorMartijn Coenen <martijn.coenen@nxp.com>2011-01-13 10:49:03 +0100
committerNick Pelly <npelly@google.com>2011-01-18 11:17:30 -0800
commita6243755a9b438bfbfe0be331ece55953f8cf9eb (patch)
tree4797ff8929bca87c03d2a62ca1224f76eb74862e /src/phLibNfc_ndef_raw.c
parent72854a2c28b99f9ab6aa60c906d5b3c1a36b04d7 (diff)
downloadexternal_libnfc-nxp-a6243755a9b438bfbfe0be331ece55953f8cf9eb.zip
external_libnfc-nxp-a6243755a9b438bfbfe0be331ece55953f8cf9eb.tar.gz
external_libnfc-nxp-a6243755a9b438bfbfe0be331ece55953f8cf9eb.tar.bz2
Implement makeReadOnly() for dynamic T1T/T2T.
The NFC Forum Type 1 Tag and Type 2 Tag specification allows for tags with a dynamic memory layout. Support for making tags with the dynamic layout readonly has been added in this patch. Change-Id: I5bc8912d80f448fdea95e1ee21631c0f186ad79a
Diffstat (limited to 'src/phLibNfc_ndef_raw.c')
-rw-r--r--src/phLibNfc_ndef_raw.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/phLibNfc_ndef_raw.c b/src/phLibNfc_ndef_raw.c
index 6b7bfe5..1da598a 100644
--- a/src/phLibNfc_ndef_raw.c
+++ b/src/phLibNfc_ndef_raw.c
@@ -300,8 +300,8 @@ void phLibNfc_Ndef_Read_Cb(void* Context,NFCSTATUS status)
{
gpphLibContext->status.GenCb_pending_status = FALSE;
if (gpphLibContext->psBufferedAuth != NULL && gpphLibContext->ndef_cntx.psNdefMap != NULL) {
- gpphLibContext->psBufferedAuth->addr = (uint8_t)
- gpphLibContext->ndef_cntx.psNdefMap->StdMifareContainer.currentBlock;
+ gpphLibContext->psBufferedAuth->addr = (uint8_t)
+ gpphLibContext->ndef_cntx.psNdefMap->StdMifareContainer.currentBlock;
}
if(NFCSTATUS_FAILED == status )
@@ -580,10 +580,15 @@ void phLibNfc_Ndef_Write_Cb(void* Context,NFCSTATUS status)
gpphLibContext->ndef_cntx.NdefLength)
{
status = NFCSTATUS_NOT_ENOUGH_MEMORY;
- }
- }
- else
- {
+ }
+ else
+ {
+ pLibNfc_Ctxt->ndef_cntx.NdefActualSize =
+ pLibNfc_Ctxt->ndef_cntx.psUpperNdefMsg->length;
+ }
+ }
+ else
+ {
gpphLibContext->LastTrancvSuccess = FALSE;
status = NFCSTATUS_FAILED;;
}
@@ -1437,6 +1442,9 @@ phLibNfc_ConvertToReadOnlyNdef (
case phHal_eJewel_PICC:
{
+// MC: Got the feedback this was #if 0'd because it was resetting the lock bits
+// read in check NDEF, and these should not be reset here already.
+#if 0
static uint16_t data_cnt = 0;
/* Resets the component instance */
@@ -1449,6 +1457,7 @@ phLibNfc_ConvertToReadOnlyNdef (
gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
&(gpphLibContext->ndef_cntx.NdefSendRecvLen),
&(data_cnt));
+#endif /* #if 0 */
for (fun_id = 0; fun_id < PH_FRINFC_NDEFMAP_CR; fun_id++)