diff options
author | Jan Brands <jan.r.brands@nxp.com> | 2010-11-30 23:23:23 +0100 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2010-12-05 13:14:46 -0800 |
commit | 794aa72f7bd1e5b1fb51efb957cb925c7cfed746 (patch) | |
tree | 07b8cad50382ddc53715d84bea5f65b8f364c80c /src/phFriNfc_DesfireMap.h | |
parent | 3043b52934292173592f27dcbb054321001a3017 (diff) | |
download | libnfc-nxp-794aa72f7bd1e5b1fb51efb957cb925c7cfed746.tar.gz |
This patch allows type 4 tag v2 ndef to be detected properly.
Same as Change-Id: I414e7864bdc654c3b9e1b459832bb8e95ea9c51a
Change-Id: I0a0119349419bb4f1031ab683e40dd3be7b26f5f
Diffstat (limited to 'src/phFriNfc_DesfireMap.h')
-rw-r--r-- | src/phFriNfc_DesfireMap.h | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/src/phFriNfc_DesfireMap.h b/src/phFriNfc_DesfireMap.h index 6731b86..0432ab5 100644 --- a/src/phFriNfc_DesfireMap.h +++ b/src/phFriNfc_DesfireMap.h @@ -20,10 +20,10 @@ * * Project: NFC-FRI * - * $Date: Thu Jul 23 13:45:06 2009 $ - * $Author: ing07336 $ - * $Revision: 1.4 $ - * $Aliases: NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $ + * $Date: Tue Jul 27 08:58:21 2010 $ + * $Author: ing02260 $ + * $Revision: 1.5 $ + * $Aliases: $ * */ @@ -31,8 +31,10 @@ #define PHFRINFC_DESFIREMAP_H #include <phFriNfc.h> -#if !defined PH_HAL4_ENABLE +#ifdef PH_HAL4_ENABLE #include <phHal4Nfc.h> +#else +#include <phHalNfc.h> #endif #include <phNfcTypes.h> #include <phNfcStatus.h> @@ -50,7 +52,7 @@ #define PH_FRINFC_NDEFMAP_DESF_NDEF_CHK_OP 4 /*!< Desfire Operation Flag is Check Ndef */ #define PH_FRINFC_NDEFMAP_DESF_GET_LEN_OP 5 #define PH_FRINFC_NDEFMAP_DESF_SET_LEN_OP 6 -#define PH_FRINFC_NDEFMAP_DESF_RESP_OFFSET 2 /*!< Two Status Flag at the end of the +#define PH_FRINFC_NDEFMAP_DESF_RESP_OFFSET 2 /*!< Two Status Flag at the end of the Receive buffer*/ #define PH_FRINFC_NDEFMAP_DESF_CAPDU_SMARTTAG_PKT_SIZE 12 /*!< Send Length for Smart Tag function*/ #define PH_FRINFC_NDEFMAP_DESF_CAPDU_SELECT_FILE_PKT_SIZE 7 /*!< Send Length for Select File function */ @@ -61,9 +63,11 @@ * */ /*@{*/ - +#ifdef DESFIRE_EV1 + #define PH_FRINFC_NDEFMAP_DESF_STATE_SELECT_SMART_TAG_EV1 4 /*!< Selection of Smart Tag is going on for Desfire EV1 */ +#endif /* #ifdef DESFIRE_EV1 */ #define PH_FRINFC_NDEFMAP_DESF_STATE_SELECT_SMART_TAG 5 /*!< Selection of Smart Tag is going on */ -#define PH_FRINFC_NDEFMAP_DESF_STATE_SELECT_FILE 6 /*!< Selecting a file to read/write */ +#define PH_FRINFC_NDEFMAP_DESF_STATE_SELECT_FILE 6 /*!< Selecting a file to read/write */ #define PH_FRINFC_NDEFMAP_DESF_STATE_READ_CAP_CONT 7 /*!< Reading a capability container */ #define PH_FRINFC_NDEFMAP_DESF_STATE_READ_BIN 8 /*!< Reading from the card */ #define PH_FRINFC_NDEFMAP_DESF_STATE_UPDATE_BIN_BEGIN 60 /*!< Writing to the card */ @@ -77,45 +81,45 @@ /* Following Constants are used to navigate the Capability Container(CC)*/ /*!< Following two indexes represents the CCLEN in CC*/ -#define PH_FRINFC_NDEFMAP_DESF_CCLEN_BYTE_FIRST_INDEX 0 -#define PH_FRINFC_NDEFMAP_DESF_CCLEN_BYTE_SECOND_INDEX 1 +#define PH_FRINFC_NDEFMAP_DESF_CCLEN_BYTE_FIRST_INDEX 0 +#define PH_FRINFC_NDEFMAP_DESF_CCLEN_BYTE_SECOND_INDEX 1 /*!< Specifies the index of the Mapping Version in CC */ -#define PH_FRINFC_NDEFMAP_DESF_VER_INDEX 2 +#define PH_FRINFC_NDEFMAP_DESF_VER_INDEX 2 /*!< Following two indexes represents the MLe bytes in CC*/ -#define PH_FRINFC_NDEFMAP_DESF_MLE_BYTE_FIRST_INDEX 3 -#define PH_FRINFC_NDEFMAP_DESF_MLE_BYTE_SECOND_INDEX 4 +#define PH_FRINFC_NDEFMAP_DESF_MLE_BYTE_FIRST_INDEX 3 +#define PH_FRINFC_NDEFMAP_DESF_MLE_BYTE_SECOND_INDEX 4 /*!< Following two indexes represents the MLc bytes in CC*/ -#define PH_FRINFC_NDEFMAP_DESF_MLC_BYTE_FIRST_INDEX 5 -#define PH_FRINFC_NDEFMAP_DESF_MLC_BYTE_SECOND_INDEX 6 +#define PH_FRINFC_NDEFMAP_DESF_MLC_BYTE_FIRST_INDEX 5 +#define PH_FRINFC_NDEFMAP_DESF_MLC_BYTE_SECOND_INDEX 6 /*!< Specifies the index of the TLV in CC */ -#define PH_FRINFC_NDEFMAP_DESF_TLV_INDEX 7 +#define PH_FRINFC_NDEFMAP_DESF_TLV_INDEX 7 /*!< Specifies the index of the TLV length in CC */ -#define PH_FRINFC_NDEFMAP_DESF_TLV_LEN_INDEX 8 +#define PH_FRINFC_NDEFMAP_DESF_TLV_LEN_INDEX 8 /*!< Following two indexes represents the NDEF file identifier in CC*/ -#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILEID_BYTE_FIRST_INDEX 9 -#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILEID_BYTE_SECOND_INDEX 10 +#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILEID_BYTE_FIRST_INDEX 9 +#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILEID_BYTE_SECOND_INDEX 10 /*!< Following two indexes represents the NDEF file size in CC */ -#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILESZ_BYTE_FIRST_INDEX 11 -#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILESZ_BYTE_SECOND_INDEX 12 +#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILESZ_BYTE_FIRST_INDEX 11 +#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILESZ_BYTE_SECOND_INDEX 12 /*!< Specifies the index of the NDEF file READ access byte in CC */ -#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILERD_ACCESS_INDEX 13 +#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILERD_ACCESS_INDEX 13 /*!< Specifies the index of the NDEF file WRITE access byte in CC */ -#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILEWR_ACCESS_INDEX 14 +#define PH_FRINFC_NDEFMAP_DESF_NDEF_FILEWR_ACCESS_INDEX 14 /* Macros to find Maximum NDEF File Size*/ #define PH_NFCFRI_NDEFMAP_DESF_NDEF_FILE_SIZE (NdefMap->DesfireCapContainer.NdefFileSize - 2) /* Specifies the size of the NLEN Bytes*/ -#define PH_FRINFC_NDEFMAP_DESF_NLEN_SIZE_IN_BYTES 2 +#define PH_FRINFC_NDEFMAP_DESF_NLEN_SIZE_IN_BYTES 2 /* Following constants are used with buffer index's*/ @@ -124,8 +128,8 @@ /* Following constants are used for SW1 SW2 status codes*/ -#define PH_FRINFC_NDEFMAP_DESF_RAPDU_SW1_BYTE 0x90 -#define PH_FRINFC_NDEFMAP_DESF_RAPDU_SW2_BYTE 0x00 +#define PH_FRINFC_NDEFMAP_DESF_RAPDU_SW1_BYTE 0x90 +#define PH_FRINFC_NDEFMAP_DESF_RAPDU_SW2_BYTE 0x00 /* Following constatnts for shift bytes*/ @@ -135,7 +139,7 @@ #define PH_FRINFC_DESF_GET_VER_CMD 0x60 #define PH_FRINFC_DESF_NATIVE_CLASS_BYTE 0x90 #define PH_FRINFC_DESF_NATIVE_OFFSET_P1 0x00 -#define PH_FRINFC_DESF_NATIVE_OFFSET_P2 0x00 +#define PH_FRINFC_DESF_NATIVE_OFFSET_P2 0x00 #define PH_FRINFC_DESF_NATIVE_GETVER_RESP 0xAF /*! * \name NDEF Mapping - states of the Finite State machine @@ -153,7 +157,7 @@ typedef enum typedef enum { - PH_FRINFC_DESF_IDX_0, + PH_FRINFC_DESF_IDX_0, PH_FRINFC_DESF_IDX_1, PH_FRINFC_DESF_IDX_2, PH_FRINFC_DESF_IDX_3, @@ -214,7 +218,7 @@ typedef enum * If the caller sets the value to \ref PH_FRINFC_NDEFMAP_SEEK_CUR, the component shall * start reading from the last offset set (continue where it has stopped before). * If set to \ref PH_FRINFC_NDEFMAP_SEEK_BEGIN, the component shall start reading - * from the begining of the card (restarted) + * from the begining of the card (restarted) * * \retval NFCSTATUS_PENDING The action has been successfully triggered. * \retval NFCSTATUS_INVALID_DEVICE_REQUEST If Previous Operation is Write Ndef and Offset @@ -256,7 +260,7 @@ NFCSTATUS phFriNfc_Desfire_RdNdef( phFriNfc_NdefMap_t *NdefMap, * If the caller sets the value to \ref PH_FRINFC_NDEFMAP_SEEK_CUR, the component shall * start writing from the last offset set (continue where it has stopped before). * If set to \ref PH_FRINFC_NDEFMAP_SEEK_BEGIN, the component shall start writing - * from the begining of the card (restarted) + * from the begining of the card (restarted) * * \retval NFCSTATUS_PENDING The action has been successfully triggered. * \retval NFCSTATUS_INVALID_DEVICE_REQUEST If Previous Operation is Write Ndef and Offset @@ -310,7 +314,7 @@ NFCSTATUS phFriNfc_Desfire_ChkNdef( phFriNfc_NdefMap_t *NdefMap); * ready to be processed. * */ - + void phFriNfc_Desfire_Process( void *Context, NFCSTATUS Status); |