summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunil Jogi <sunil.jogi@nxp.com>2011-11-23 15:06:27 -0800
committerMartijn Coenen <maco@google.com>2012-04-02 10:34:02 -0700
commiteb6da80b266a263350769a0e5629f4089aad32bb (patch)
tree711d3f93c263d67a91e85e88e7427b1d540320b3 /src
parentcadb46ba3abc0250999257e95b5e2c80ef3dd474 (diff)
downloadexternal_libnfc-nxp-eb6da80b266a263350769a0e5629f4089aad32bb.zip
external_libnfc-nxp-eb6da80b266a263350769a0e5629f4089aad32bb.tar.gz
external_libnfc-nxp-eb6da80b266a263350769a0e5629f4089aad32bb.tar.bz2
Patch to support MIFARE with SAK 0x01
Change-Id: Ifb1389d428855c2eea99390790af13f28571097a
Diffstat (limited to 'src')
-rw-r--r--src/phFriNfc_NdefMap.c3
-rw-r--r--src/phFriNfc_SmtCrdFmt.c3
-rw-r--r--src/phHal4Nfc_ADD.c1
-rw-r--r--src/phLibNfc_initiator.c3
-rw-r--r--src/phLibNfc_ndef_raw.c3
5 files changed, 9 insertions, 4 deletions
diff --git a/src/phFriNfc_NdefMap.c b/src/phFriNfc_NdefMap.c
index bd82e7a..7e195f2 100644
--- a/src/phFriNfc_NdefMap.c
+++ b/src/phFriNfc_NdefMap.c
@@ -778,7 +778,8 @@ NFCSTATUS phFriNfc_NdefMap_ChkNdef( phFriNfc_NdefMap_t *NdefMap)
#endif /* PH_FRINFC_MAP_MIFAREUL_DISABLED*/
}
else if ((0x08 == (sak & 0x18)) ||
- (0x18 == (sak & 0x18)))
+ (0x18 == (sak & 0x18)) ||
+ (0x01 == sak))
{
/* The SAK/Sel_Res says the card is of the type
Mifare Standard */
diff --git a/src/phFriNfc_SmtCrdFmt.c b/src/phFriNfc_SmtCrdFmt.c
index 0e250b9..fce302f 100644
--- a/src/phFriNfc_SmtCrdFmt.c
+++ b/src/phFriNfc_SmtCrdFmt.c
@@ -306,7 +306,8 @@ NFCSTATUS phFriNfc_NdefSmtCrd_Format( phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt,
#endif /* #ifndef PH_FRINFC_FMT_MIFAREUL_DISABLED */
}
else if((0x08 == (sak & 0x18)) ||
- (0x18 == (sak & 0x18)))
+ (0x18 == (sak & 0x18)) ||
+ (0x01 == sak))
{
#ifndef PH_FRINFC_FMT_MIFARESTD_DISABLED
NdefSmtCrdFmt->CardType = (uint8_t)
diff --git a/src/phHal4Nfc_ADD.c b/src/phHal4Nfc_ADD.c
index 5751219..0a3303c 100644
--- a/src/phHal4Nfc_ADD.c
+++ b/src/phHal4Nfc_ADD.c
@@ -468,6 +468,7 @@ void phHal4Nfc_TargetDiscoveryComplete(
/*Check for Mifare Supported*/
switch( Sak )
{
+ case 0x01: // 1K Classic
case 0x09: // Mini
case 0x08: // 1K
case 0x18: // 4K
diff --git a/src/phLibNfc_initiator.c b/src/phLibNfc_initiator.c
index 0f71606..6bd48b8 100644
--- a/src/phLibNfc_initiator.c
+++ b/src/phLibNfc_initiator.c
@@ -163,7 +163,8 @@ void phLibNfc_NotificationRegister_Resp_Cb (
}
if((TRUE == gpphLibContext->RegNtfType.MifareStd)&&
- (((sak_byte & 0x18)==0x08)||((sak_byte & 0x18)==0x18)))
+ (((sak_byte & 0x18)==0x08)||((sak_byte & 0x18)==0x18) ||
+ (sak_byte == 0x01)))
{
/*Copy the tag related info*/
gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo=
diff --git a/src/phLibNfc_ndef_raw.c b/src/phLibNfc_ndef_raw.c
index c39364e..d3c3e6a 100644
--- a/src/phLibNfc_ndef_raw.c
+++ b/src/phLibNfc_ndef_raw.c
@@ -314,7 +314,8 @@ void phLibNfc_Ndef_Read_Cb(void* Context,NFCSTATUS status)
ps_rem_dev_info = (phHal_sRemoteDevInformation_t *)
gpphLibContext->Connected_handle;
if ((phHal_eMifare_PICC == ps_rem_dev_info->RemDevType) &&
- (0x08 == (ps_rem_dev_info->RemoteDevInfo.Iso14443A_Info.Sak & 0x08)))
+ (0x08 == (ps_rem_dev_info->RemoteDevInfo.Iso14443A_Info.Sak & 0x08)) ||
+ (0x01 == ps_rem_dev_info->RemoteDevInfo.Iso14443A_Info.Sak))
{
/* card type is mifare 1k/4k, then reconnect */