From eb6da80b266a263350769a0e5629f4089aad32bb Mon Sep 17 00:00:00 2001 From: Sunil Jogi Date: Wed, 23 Nov 2011 15:06:27 -0800 Subject: Patch to support MIFARE with SAK 0x01 Change-Id: Ifb1389d428855c2eea99390790af13f28571097a --- src/phFriNfc_NdefMap.c | 3 ++- src/phFriNfc_SmtCrdFmt.c | 3 ++- src/phHal4Nfc_ADD.c | 1 + src/phLibNfc_initiator.c | 3 ++- src/phLibNfc_ndef_raw.c | 3 ++- 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 */ -- cgit v1.1