summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authordoug yeager <doug@simplytapp.com>2012-08-23 10:27:28 -0500
committerdoug yeager <doug@simplytapp.com>2012-08-28 10:03:02 -0500
commit55f43da8fa1a5ac7e9e88f81381a80345fa3ac50 (patch)
tree1d98c808147e9c5c1cbb84077049c0d634d53636 /inc
parent42fef9f8aa6d0878cb3f2c050c637afa7f8d8abd (diff)
downloadexternal_libnfc-nxp-55f43da8fa1a5ac7e9e88f81381a80345fa3ac50.zip
external_libnfc-nxp-55f43da8fa1a5ac7e9e88f81381a80345fa3ac50.tar.gz
external_libnfc-nxp-55f43da8fa1a5ac7e9e88f81381a80345fa3ac50.tar.bz2
card emulation patch port to JB
Change-Id: I86657f9c547840de33c35df4912b5f282d4fe459
Diffstat (limited to 'inc')
-rwxr-xr-x[-rw-r--r--]inc/phNfcConfig.h50
-rwxr-xr-x[-rw-r--r--]inc/phNfcInterface.h92
-rwxr-xr-x[-rw-r--r--]inc/phNfcTypes.h329
3 files changed, 251 insertions, 220 deletions
diff --git a/inc/phNfcConfig.h b/inc/phNfcConfig.h
index 6bc050c..0c94dc0 100644..100755
--- a/inc/phNfcConfig.h
+++ b/inc/phNfcConfig.h
@@ -124,14 +124,14 @@
/**< Indicates PN544 Power Modes Configuration for the NFC Device,
- 0x00U -> PN544 stays in active bat mode
+ 0x00U -> PN544 stays in active bat mode
(except when generating RF field)
- 0x01U -> PN544 goes in standby when possible otherwise
+ 0x01U -> PN544 goes in standby when possible otherwise
stays in active bat mode
- 0x02U -> PN544 goes in idle mode as soon as it can
+ 0x02U -> PN544 goes in idle mode as soon as it can
(otherwise it is in active bat except when generating RF field)
- 0x03U -> PN544 goes in standby when possible otherwise goes in idle mode
- as soon as it can (otherwise it is in active bat except when
+ 0x03U -> PN544 goes in standby when possible otherwise goes in idle mode
+ as soon as it can (otherwise it is in active bat except when
generating RF field)
*/
@@ -150,7 +150,7 @@
/**< Max number of remote devices supported */
#ifndef MAX_REMOTE_DEVICES
-#define MAX_REMOTE_DEVICES 0x0A
+#define MAX_REMOTE_DEVICES 0x0A
#endif
/**< System Event Notification
@@ -198,30 +198,30 @@
/**< Presence check interval in milliseconds */
#ifndef PRESENCE_CHECK_INTERVAL
#define PRESENCE_CHECK_INTERVAL 500U
-#endif
+#endif
-/** Resolution value for the timer, here the
+/** Resolution value for the timer, here the
timer resolution is 500 milliseconds */
#ifndef TIMER_RESOLUTION
#define TIMER_RESOLUTION 500U
-#endif
+#endif
/* Kindly note that the below Timeout values should be
* in Multiples of the value provided to TIMER_RESOLUTION
*/
-/**< Defines guard time out value for LLC timer,
+/**< Defines guard time out value for LLC timer,
1000 is in milliseconds */
#ifndef LINK_GUARD_TIMEOUT
#define LINK_GUARD_TIMEOUT 1000U
-#endif
+#endif
-/**< Defines connection time out value for LLC timer,
+/**< Defines connection time out value for LLC timer,
1000 is in milliseconds */
#ifndef LINK_CONNECTION_TIMEOUT
#define LINK_CONNECTION_TIMEOUT 1000U
-#endif
+#endif
/**< Defines ACK time out value for LLC timer,
150 is in milliseconds */
@@ -239,7 +239,7 @@
#endif
-/**< Define to configure the Active Mode Polling Guard Time-out
+/**< Define to configure the Active Mode Polling Guard Time-out
*/
#ifndef DEV_MGMT_ACT_GRD_TO_DEFAULT
@@ -275,7 +275,7 @@
#ifndef HOST_CE_A_SAK_DEFAULT
#define HOST_CE_A_SAK_DEFAULT 0x20U
-#endif
+#endif
#ifndef NXP_CE_A_ATQA_HIGH
#define NXP_CE_A_ATQA_HIGH 0x00U
@@ -288,11 +288,11 @@
#ifndef NXP_UICC_CE_RIGHTS
#define NXP_UICC_CE_RIGHTS 0x0FU
-#endif
+#endif
#ifndef NXP_UICC_RD_RIGHTS
#define NXP_UICC_RD_RIGHTS 0x00U
-#endif
+#endif
/*
@@ -302,7 +302,7 @@
*/
#define ES_HW_VER 32
-
+
/*
*****************************************************************
*************** FEATURE SPECIFIC MACROS *************************
@@ -319,7 +319,7 @@
#endif
#if (NXP_SMX == 1)
-#define NXP_HAL_ENABLE_SMX
+#define NXP_HAL_ENABLE_SMX
#endif
/**< Macro to Enable the Host Session
@@ -373,7 +373,17 @@
#define RECONNECT_SUPPORT
/**< Macro to Enable the Card Emulation Feature */
-/* #define HOST_EMULATION */
+#define HOST_EMULATION
+
+//this ifdef can be removed when this is not a patch that is being
+//administered after a new release of Android. it is required that
+//the new pipes for A and B emu get created for the CE patch ON THE NFC CHIP
+//if this patch is adminstered AFTER the phone has been already updated with
+//a release, it is possible that the create A/B pipe code could never
+//get executed, so we are forcing it every time. this can be removed
+//for a main build with a new OS release, or any time this build has run at
+//least once on a device
+#define FIRST_CE_PATCH
#define NXP_HAL_VERIFY_EEPROM_CRC 0x01U
diff --git a/inc/phNfcInterface.h b/inc/phNfcInterface.h
index fdae2ed..3a2d9c4 100644..100755
--- a/inc/phNfcInterface.h
+++ b/inc/phNfcInterface.h
@@ -75,27 +75,31 @@
#define NFC_NOTIFY_DEINIT_COMPLETED 0x02
#define NFC_NOTIFY_DEINIT_FAILED 0xF2
-#define NFC_NOTIFY_EVENT 0x70
+#define NFC_NOTIFY_EVENT 0x70
#define NFC_NOTIFY_DEVICE_ACTIVATED 0x82
#define NFC_NOTIFY_DEVICE_DEACTIVATED 0x83
#define NFC_NOTIFY_SEND_COMPLETED 0x03
+#define NFC_NOTIFY_SEND_CE_A_COMPLETED 0x76
+#define NFC_NOTIFY_SEND_CE_B_COMPLETED 0x77
#define NFC_NOTIFY_SEND_ERROR 0xF3
#define NFC_NOTIFY_RECV_COMPLETED 0x04
#define NFC_NOTIFY_RECV_ERROR 0xF4
-#define NFC_NOTIFY_RECV_EVENT 0x74
+#define NFC_NOTIFY_RECV_EVENT 0x74
+#define NFC_NOTIFY_CE_A_RECV_EVENT 0x75
+#define NFC_NOTIFY_CE_B_RECV_EVENT 0x78
#define NFC_NOTIFY_RECV_CANCELLED 0x34
#define NFC_NOTIFY_TRANSCEIVE_COMPLETED 0x05
#define NFC_NOTIFY_TRANSCEIVE_ERROR 0xF5
#define NFC_NOTIFY_POLL_ENABLED 0x06
-#define NFC_NOTIFY_POLL_RESTARTED 0x16
+#define NFC_NOTIFY_POLL_RESTARTED 0x16
#define NFC_NOTIFY_POLL_DISABLED 0x26
-#define NFC_NOTIFY_CONFIG_SUCCESS 0x36
-#define NFC_NOTIFY_CONFIG_ERROR 0xF6
+#define NFC_NOTIFY_CONFIG_SUCCESS 0x36
+#define NFC_NOTIFY_CONFIG_ERROR 0xF6
#define NFC_NOTIFY_TARGET_DISCOVERED 0x10
#define NFC_NOTIFY_DISCOVERY_ERROR 0xFA
@@ -107,9 +111,9 @@
#define NFC_NOTIFY_TARGET_DISCONNECTED 0x15
#define NFC_NOTIFY_DISCONNECT_FAILED 0xFD
-#define NFC_NOTIFY_TRANSACTION 0x07
+#define NFC_NOTIFY_TRANSACTION 0x07
-#define NFC_NOTIFY_RESULT 0x08
+#define NFC_NOTIFY_RESULT 0x08
#define NFC_NOTIFY_DEVICE_ERROR 0xFEU
#define NFC_NOTIFY_ERROR 0xFFU
@@ -149,16 +153,16 @@ enum phNfcIF_eExecution{
typedef enum phNfc_eModeType{
- MODE_ON = 0x00U, /**< Switches the particular feature ON*/
- MODE_OFF /**< Switches the particular feature OFF*/
+ MODE_ON = 0x00U, /**< Switches the particular feature ON*/
+ MODE_OFF /**< Switches the particular feature OFF*/
}phNfc_eModeType_t;
/**
* State Structure to hold the State Information
*
- * This structure holds the state Information of a specified
+ * This structure holds the state Information of a specified
* Layer .
- *
+ *
*/
typedef struct phNfc_sState
@@ -173,31 +177,31 @@ typedef struct phNfc_sState
/**
- * Transaction Completion Information Structure
+ * Transaction Completion Information Structure
*
- * This structure holds the completion callback information of the
- * transaction passed from the lower layer to the upper layer
+ * This structure holds the completion callback information of the
+ * transaction passed from the lower layer to the upper layer
* along with the completion callback.
*/
typedef struct phNfc_sTransactionInfo
{
- /* Returns the status of the Transaction Completion routine */
+ /* Returns the status of the Transaction Completion routine */
NFCSTATUS status;
- /* Indicates the Type of the Transaction */
- uint8_t type;
- /* To contain more Transaction Notification specific info */
- void *info;
- /* The data response from the Transaction */
+ /* Indicates the Type of the Transaction */
+ uint8_t type;
+ /* To contain more Transaction Notification specific info */
+ void *info;
+ /* The data response from the Transaction */
uint8_t *buffer;
- /* The size of the data response from the Transaction */
+ /* The size of the data response from the Transaction */
uint16_t length;
}phNfc_sTransactionInfo_t;
/**
- * Notification Information Structure
+ * Notification Information Structure
*
- * This structure holds the notification callback information passed from
+ * This structure holds the notification callback information passed from
* the lower layer to the upper layer along with the notification callback.
*/
@@ -206,29 +210,29 @@ typedef struct phNfc_sCompletionInfo
/* Returns the status of the completion routine */
NFCSTATUS status;
- /* Indicates the Type of the Information
- * associated with the completion
- */
- uint8_t type;
+ /* Indicates the Type of the Information
+ * associated with the completion
+ */
+ uint8_t type;
- /* To contain more completion specific info */
+ /* To contain more completion specific info */
void *info;
}phNfc_sCompletionInfo_t;
/**
- * Notification Information
- *
+ * Notification Information
+ *
*/
typedef struct phNfc_sNotificationInfo
{
- /* Returns the status of the Notification routine */
- NFCSTATUS status;
- /* Indicates the Type of the Notification */
- phHal_eNotificationType_t type;
- /* To contain more Notification specific info */
- void *info;
+ /* Returns the status of the Notification routine */
+ NFCSTATUS status;
+ /* Indicates the Type of the Notification */
+ phHal_eNotificationType_t type;
+ /* To contain more Notification specific info */
+ void *info;
}phNfc_sNotificationInfo_t;
@@ -298,8 +302,8 @@ typedef NFCSTATUS (*pphNfcIF_Interface_t) (
/**
* Data Transaction between the lower layer interface
*
- * Sends or Receives the given amount of data to the lower layer.
- * The call returns immediately and the registered callback is
+ * Sends or Receives the given amount of data to the lower layer.
+ * The call returns immediately and the registered callback is
* called when all data has been written.
* <p>
*
@@ -351,11 +355,11 @@ typedef struct phNfc_sLowerIF
typedef struct phNfcIF_sCallBack
{
- /**<Holds context info to be sent to lower layer*/
+ /**<Holds context info to be sent to lower layer*/
void *pif_ctxt;
- /**<Callback notifies occurrance of event in Lower Interface*/
+ /**<Callback notifies occurrance of event in Lower Interface*/
pphNfcIF_Notification_CB_t notify;
- /**<asynchronous Interface Transaction Completion callback*/
+ /**<asynchronous Interface Transaction Completion callback*/
pphNfcIF_Transact_Completion_CB_t send_complete;
pphNfcIF_Transact_Completion_CB_t receive_complete;
@@ -371,11 +375,11 @@ typedef struct phNfcIF_sCallBack
typedef struct phNfcIF_sReference
{
- /**<Generic Interface structure with the Lower Layer*/
+ /**<Generic Interface structure with the Lower Layer*/
phNfc_sLowerIF_t *plower_if;
- /**<pointer to the data to be sent*/
+ /**<pointer to the data to be sent*/
uint8_t *tx_data;
- /**<pointer to the data to be received*/
+ /**<pointer to the data to be received*/
uint8_t *rx_data;
}phNfcIF_sReference_t, *pphNfcIF_sReference_t;
diff --git a/inc/phNfcTypes.h b/inc/phNfcTypes.h
index 914ae07..f698ddb 100644..100755
--- a/inc/phNfcTypes.h
+++ b/inc/phNfcTypes.h
@@ -101,23 +101,23 @@ typedef unsigned long uint32_t; /**< \ingroup grp_nfc_common
#endif /* _WIN32 */
#ifndef TRUE
-#define TRUE (0x01) /**< \ingroup grp_nfc_common
+#define TRUE (0x01) /**< \ingroup grp_nfc_common
Logical True Value */
#endif
#ifndef FALSE
-#define FALSE (0x00) /**< \ingroup grp_nfc_common
+#define FALSE (0x00) /**< \ingroup grp_nfc_common
Logical False Value */
#endif
-typedef uint8_t utf8_t; /**< \ingroup grp_nfc_common
+typedef uint8_t utf8_t; /**< \ingroup grp_nfc_common
UTF8 Character String */
-typedef uint8_t bool_t; /**< \ingroup grp_nfc_common
- boolean data type */
+typedef uint8_t bool_t; /**< \ingroup grp_nfc_common
+ boolean data type */
typedef uint16_t NFCSTATUS; /**< \ingroup grp_nfc_common
- NFC return values
+ NFC return values
\ref phNfcStatus.h for different status
values */
@@ -126,7 +126,7 @@ typedef uint16_t NFCSTATUS; /**< \ingroup grp_nfc_common
#endif
/* This Macro to be used to resolve Unused and unreference
- * compiler warnings.
+ * compiler warnings.
*/
#define PHNFC_UNUSED_VARIABLE(x) for((x)=(x);(x)!=(x);)
@@ -165,7 +165,7 @@ typedef uint16_t NFCSTATUS; /**< \ingroup grp_nfc_common
#define PHHAL_ATQA_LENGTH 0x02U /**< ATQA length */
#define PHHAL_MAX_UID_LENGTH 0x0AU /**< Maximum UID length expected */
-#define PHHAL_MAX_ATR_LENGTH 0x30U /**< Maximum ATR_RES (General Bytes)
+#define PHHAL_MAX_ATR_LENGTH 0x30U /**< Maximum ATR_RES (General Bytes)
* length expected */
#define PHHAL_ATQB_LENGTH 0x0BU /**< ATQB length */
@@ -180,7 +180,7 @@ typedef uint16_t NFCSTATUS; /**< \ingroup grp_nfc_common
ISO15693 Tag */
#define VENDOR_NAME_LEN 0x14U
-#define MAX_TRANSFER_UNIT 0x21U
+#define MAX_TRANSFER_UNIT 0x21U
#define SESSIONID_SIZE 0x08U
#define MAX_AID_LEN 0x10U
#define MAX_UICC_PARAM_LEN 0xFFU
@@ -212,9 +212,9 @@ typedef uint16_t NFCSTATUS; /**< \ingroup grp_nfc_common
/**
* Data Buffer Structure to hold the Data Buffer
*
- * This structure holds the Data in the Buffer of the specified
+ * This structure holds the Data in the Buffer of the specified
* size.
- *
+ *
*/
typedef struct phNfc_sData_t
{
@@ -226,7 +226,7 @@ typedef struct phNfc_sData_t
* \brief Possible Hardware Configuration exposed to upper layer.
* Typically this should be at least the communication link (Ex:"COM1","COM2")
* the controller is connected to.
- */
+ */
typedef struct phLibNfc_sConfig_t
{
/** Device node of the controller */
@@ -255,29 +255,29 @@ typedef struct phLibNfc_Message_t
* Deferred message. This message type will be posted to the client application thread
* to notify that a deferred call must be invoked.
*/
-#define PH_LIBNFC_DEFERREDCALL_MSG (0x311)
+#define PH_LIBNFC_DEFERREDCALL_MSG (0x311)
/**
*\brief Deferred call declaration.
- * This type of API is called from ClientApplication ( main thread) to notify
+ * This type of API is called from ClientApplication ( main thread) to notify
* specific callback.
*/
typedef void (*pphLibNfc_DeferredCallback_t) (void*);
/**
*\brief Deferred parameter declaration.
- * This type of data is passed as parameter from ClientApplication (main thread) to the
+ * This type of data is passed as parameter from ClientApplication (main thread) to the
* callback.
*/
typedef void *pphLibNfc_DeferredParameter_t;
/**
*\brief Deferred message specific info declaration.
- * This type of information is packed as message data when \ref PH_LIBNFC_DEFERREDCALL_MSG
+ * This type of information is packed as message data when \ref PH_LIBNFC_DEFERREDCALL_MSG
* type message is posted to message handler thread.
- */
+ */
typedef struct phLibNfc_DeferredCall_t
{
- pphLibNfc_DeferredCallback_t pCallback;/**< pointer to Deferred callback */
- pphLibNfc_DeferredParameter_t pParameter;/**< pointer to Deferred parameter */
+ pphLibNfc_DeferredCallback_t pCallback;/**< pointer to Deferred callback */
+ pphLibNfc_DeferredParameter_t pParameter;/**< pointer to Deferred parameter */
} phLibNfc_DeferredCall_t;
@@ -293,7 +293,7 @@ typedef struct phLibNfc_DeferredCall_t
*/
typedef struct phNfc_sSupProtocol_t
{
- unsigned int MifareUL : 1; /**< Protocol Mifare Ultra Light or
+ unsigned int MifareUL : 1; /**< Protocol Mifare Ultra Light or
any NFC Forum Type-2 tags */
unsigned int MifareStd : 1; /**< Protocol Mifare Standard. */
unsigned int ISO14443_4A : 1; /**< Protocol ISO14443-4 Type A. */
@@ -312,11 +312,11 @@ typedef struct phNfc_sSupProtocol_t
* \brief Information related to the NFC Device
*
* The <em> Device Information Structure </em> holds information
- * related to the NFC IC read during initialization time.
+ * related to the NFC IC read during initialization time.
* It allows the caller firware, hardware version, the model id,
- * HCI verison supported and vendor name. Refer to the NFC Device
+ * HCI verison supported and vendor name. Refer to the NFC Device
* User Manual on how to interpret each of the values. In addition
- * it also contains capabilities of the NFC Device such as the
+ * it also contains capabilities of the NFC Device such as the
* protocols supported in Reader and emulation mode
*
*/
@@ -337,10 +337,10 @@ typedef struct phNfc_sDeviceCapabilities_t
Vendor name (Null terminated string)*/
uint8_t full_version[NXP_FULL_VERSION_LEN];
- phNfc_sSupProtocol_t ReaderSupProtocol; /**< Supported protocols
+ phNfc_sSupProtocol_t ReaderSupProtocol; /**< Supported protocols
(Bitmapped) in Reader mode. */
phNfc_sSupProtocol_t EmulationSupProtocol; /**< Supported protocols
- (Bitmapped) in Emulation
+ (Bitmapped) in Emulation
mode. */
char firmware_update_info; /** */
} phNfc_sDeviceCapabilities_t;
@@ -361,79 +361,79 @@ typedef struct phNfc_sDeviceCapabilities_t
typedef enum phNfc_eMifareCmdList_t
{
phNfc_eMifareRaw = 0x00U, /**< This command performs raw transcations .
- Format of the phLibNfc_sTransceiveInfo_t
- content in this case shall be as below:
- • cmd: filed shall set to phHal_eMifareRaw .
+ Format of the phLibNfc_sTransceiveInfo_t
+ content in this case shall be as below:
+ • cmd: filed shall set to phHal_eMifareRaw .
• addr : doesn't carry any significance.
- • sSendData : Shall contain formatted raw buffer
- based on MIFARE commands type used.
- Formatted buffer shall follow below
+ • sSendData : Shall contain formatted raw buffer
+ based on MIFARE commands type used.
+ Formatted buffer shall follow below
formating scheme.
-
+
CmdType+ Block No + CommandSpecific data + 2 byte CRC
- Ex: With Write 4 byte command on block 8 looks as
- " 0xA2,0x08,0x01,0x02,0x03,0x04,CRC1,CRC2
- Note : For MIFARE Std card we recommend use MIFARE
+ Ex: With Write 4 byte command on block 8 looks as
+ " 0xA2,0x08,0x01,0x02,0x03,0x04,CRC1,CRC2
+ Note : For MIFARE Std card we recommend use MIFARE
commands directly.
*/
phNfc_eMifareAuthentA = 0x60U, /**< Mifare Standard:\n
This command performs an authentication with KEY A for a sector.\n
- Format of the phLibNfc_sTransceiveInfo_t content in this case is :
- • cmd: field shall set to phHal_eMifareAuthentA .
- • addr : indicates MIFARE block address.
+ Format of the phLibNfc_sTransceiveInfo_t content in this case is :
+ • cmd: field shall set to phHal_eMifareAuthentA .
+ • addr : indicates MIFARE block address.
Ex: 0x08 indicates block 8 needs to be authenticated.
- • sSendData : Shall contain authentication key values.
- sSendData ,buffer shall contain authentication
- key values 01 02 03 04 05 06 authenticates
- block 08 with the key 0x01[..]06. If this
- command fails, then user needs to reactivate
- the remote Mifare card.
+ • sSendData : Shall contain authentication key values.
+ sSendData ,buffer shall contain authentication
+ key values 01 02 03 04 05 06 authenticates
+ block 08 with the key 0x01[..]06. If this
+ command fails, then user needs to reactivate
+ the remote Mifare card.
*/
phNfc_eMifareAuthentB = 0x61U, /**< Mifare Standard:\n
This command performs an authentication with KEY B for a sector.\n
- Format of the phLibNfc_sTransceiveInfo_t content in this case is :
- • cmd: field shall set to phHal_eMifareAuthentB .
- • addr : indicates MIFARE block address.
+ Format of the phLibNfc_sTransceiveInfo_t content in this case is :
+ • cmd: field shall set to phHal_eMifareAuthentB .
+ • addr : indicates MIFARE block address.
Ex: 0x08 indicates block 8 needs to be authenticated.
- • sSendData : Shall contain authentication key values.
- sSendData ,buffer shall contain authentication
- key values 01 02 03 04 05 06 authenticates
- block 08 with the key 0x01[..]06. If this
- command fails, then user needs to reactivate
- the remote Mifare card.
+ • sSendData : Shall contain authentication key values.
+ sSendData ,buffer shall contain authentication
+ key values 01 02 03 04 05 06 authenticates
+ block 08 with the key 0x01[..]06. If this
+ command fails, then user needs to reactivate
+ the remote Mifare card.
*/
phNfc_eMifareRead16 = 0x30U, /**< Mifare Standard and Ultra Light:\n
Read 16 Bytes from a Mifare Standard block or 4 Mifare Ultra Light pages.\n
- Format of the phLibNfc_sTransceiveInfo_t content in this case is :
- • cmd: field shall set to phHal_eMifareRead16 .
- • addr : memory adress to read.
- • sRecvData : Shall contain buffer of size 16
- to read the data into.
+ Format of the phLibNfc_sTransceiveInfo_t content in this case is :
+ • cmd: field shall set to phHal_eMifareRead16 .
+ • addr : memory adress to read.
+ • sRecvData : Shall contain buffer of size 16
+ to read the data into.
- If this command fails, the user needs to reactivate the
+ If this command fails, the user needs to reactivate the
the remote Mifare card
*/
phNfc_eMifareRead = 0x30U,
phNfc_eMifareWrite16 = 0xA0U, /**< Mifare Standard and Ultra Light:\n
Write 16 Bytes to a Mifare Standard block or 4 Mifare Ultra Light pages.\n
- Format of the phLibNfc_sTransceiveInfo_t content in this case is :
- • cmd: field shall set to phHal_eMifareWrite16 .
- • addr : starting memory adress to write from.
+ Format of the phLibNfc_sTransceiveInfo_t content in this case is :
+ • cmd: field shall set to phHal_eMifareWrite16 .
+ • addr : starting memory adress to write from.
• sSendData : Shall contain buffer of size 16 containing
- the data bytes to be written.
-
- If this command fails, the user needs to reactivate the
+ the data bytes to be written.
+
+ If this command fails, the user needs to reactivate the
the remote Mifare card
*/
phNfc_eMifareWrite4 = 0xA2U, /**< Mifare Ultra Light:\n
Write 4 bytes.\n
- Format of the phLibNfc_sTransceiveInfo_t content in this case is :
- • cmd: field shall set to phHal_eMifareWrite4 .
- • addr : starting memory adress to write from.
+ Format of the phLibNfc_sTransceiveInfo_t content in this case is :
+ • cmd: field shall set to phHal_eMifareWrite4 .
+ • addr : starting memory adress to write from.
• sSendData : Shall contain buffer of size 4 containing
- the data bytes to be written.
+ the data bytes to be written.
- If this command fails, the user needs to reactivate the
+ If this command fails, the user needs to reactivate the
the remote Mifare card
*/
phNfc_eMifareInc = 0xC1U, /**< Increment. */
@@ -456,7 +456,7 @@ typedef enum phNfc_eMifareCmdList_t
typedef enum phNfc_eIso14443_4_CmdList_t
{
phNfc_eIso14443_4_Raw = 0x00U /**< ISO 14443-4 Exchange command:\n
- - This command sends the data buffer directly
+ - This command sends the data buffer directly
to the remote device */
} phNfc_eIso14443_4_CmdList_t;
@@ -472,7 +472,7 @@ typedef enum phNfc_eIso14443_4_CmdList_t
typedef enum phNfc_eNfcIP1CmdList_t
{
phNfc_eNfcIP1_Raw = 0x00U /**< NfcIP Exchange command:\n
- - This command sends the data buffer directly
+ - This command sends the data buffer directly
to the remote device */
}phNfc_eNfcIP1CmdList_t;
@@ -488,11 +488,11 @@ typedef enum phNfc_eIso15693_CmdList_t
{
#if 0
phNfc_eIso15693_Raw = 0x00U, /**< ISO 15693 Exchange Raw command:\n
- - This command sends the data buffer directly
+ - This command sends the data buffer directly
to the remote device */
#endif
phNfc_eIso15693_Cmd = 0x20U, /**< ISO 15693 Exchange command:\n
- - This command is used to access the card
+ - This command is used to access the card
to the remote device */
phNfc_eIso15693_Invalid = 0xFFU /**< Invalid Command */
} phNfc_eIso15693_CmdList_t;
@@ -508,7 +508,7 @@ typedef enum phNfc_eIso15693_CmdList_t
typedef enum phNfc_eFelicaCmdList_t
{
phNfc_eFelica_Raw = 0xF0U, /**< Felica Raw command:\n
- - This command sends the data buffer directly
+ - This command sends the data buffer directly
to the remote device */
phNfc_eFelica_Check = 0x00, /**< Felica Check command:\n
- This command checks the data from the Felica
@@ -530,7 +530,7 @@ typedef enum phNfc_eFelicaCmdList_t
typedef enum phNfc_eJewelCmdList_t
{
phNfc_eJewel_Raw = 0x00U, /**< Jewel command:\n
- - This command sends the data buffer directly
+ - This command sends the data buffer directly
to the remote device */
phNfc_eJewel_Invalid = 0xFFU /**< Invalid jewel command */
}phNfc_eJewelCmdList_t;
@@ -538,10 +538,10 @@ typedef enum phNfc_eJewelCmdList_t
/** \ingroup grp_hal_nfci
*
-* \brief Remote Device Reader A RF Gate Information Container
+* \brief Remote Device Reader A RF Gate Information Container
*
* The <em> Reader A structure </em> includes the available information
-* related to the discovered ISO14443A remote device. This information
+* related to the discovered ISO14443A remote device. This information
* is updated for every device discovery.
* \note None.
*
@@ -550,11 +550,11 @@ typedef struct phNfc_sIso14443AInfo_t
{
uint8_t Uid[PHHAL_MAX_UID_LENGTH]; /**< UID information of the TYPE A
Tag Discovered */
- uint8_t UidLength; /**< UID information length, shall not be greater
+ uint8_t UidLength; /**< UID information length, shall not be greater
than PHHAL_MAX_UID_LENGTH i.e., 10 */
- uint8_t AppData[PHHAL_MAX_ATR_LENGTH]; /**< Application data information of the
- tag discovered (= Historical bytes for
- type A) */
+ uint8_t AppData[PHHAL_MAX_ATR_LENGTH]; /**< Application data information of the
+ tag discovered (= Historical bytes for
+ type A) */
uint8_t AppDataLength; /**< Application data length */
uint8_t Sak; /**< SAK informationof the TYPE A
Tag Discovered */
@@ -562,23 +562,23 @@ typedef struct phNfc_sIso14443AInfo_t
Tag Discovered */
uint8_t MaxDataRate; /**< Maximum data rate supported by the TYPE A
Tag Discovered */
- uint8_t Fwi_Sfgt; /**< Frame waiting time and start up frame guard
- time as defined in ISO/IEC 14443-4[7] for
+ uint8_t Fwi_Sfgt; /**< Frame waiting time and start up frame guard
+ time as defined in ISO/IEC 14443-4[7] for
type A */
} phNfc_sIso14443AInfo_t;
/** \ingroup grp_hal_nfci
*
-* \brief Remote Device Reader B RF Gate Information Container
+* \brief Remote Device Reader B RF Gate Information Container
*
* The <em> Reader B structure </em> includes the available information
-* related to the discovered ISO14443B remote device. This information
+* related to the discovered ISO14443B remote device. This information
* is updated for every device discovery.
* \note None.
*
*/
-typedef struct phNfc_sIso14443BInfo_t
+typedef struct phNfc_sIso14443BInfo_t
{
union phNfc_uAtqBInfo
{
@@ -594,8 +594,8 @@ typedef struct phNfc_sIso14443BInfo_t
uint8_t AtqRes[PHHAL_ATQB_LENGTH]; /**< ATQB Response Information of TYPE B
Tag Discovered */
} AtqB;
- uint8_t HiLayerResp[PHHAL_MAX_ATR_LENGTH]; /**< Higher Layer Response information
- in answer to ATRRIB Command for Type B */
+ uint8_t HiLayerResp[PHHAL_MAX_ATR_LENGTH]; /**< Higher Layer Response information
+ in answer to ATRRIB Command for Type B */
uint8_t HiLayerRespLength; /**< Higher Layer Response length */
uint8_t Afi; /**< Application Family Identifier of TYPE B
Tag Discovered */
@@ -603,13 +603,29 @@ typedef struct phNfc_sIso14443BInfo_t
Tag Discovered */
} phNfc_sIso14443BInfo_t;
+/** \ingroup grp_hal_nfci
+*
+* \brief Remote Device 14443-4 Card RF Gate Information Container
+*
+* The <em> Card 14443-4 structure </em> includes the available information
+* related to the discovered ISO14443-4 PCD remote device. This information
+* is updated for every device discovery.
+* \note None.
+*
+*/
+typedef struct phNfc_sIso14443_4_PCD_Info_t
+{
+ uint8_t *buffer; /**< Data submitted to the emulated card*/
+ uint16_t length; /**< Data length*/
+} phNfc_sIso14443_4_PCD_Info_t;
+
/** \ingroup grp_hal_nfci
*
-* \brief Remote Device Reader B prime RF Gate Information Container
+* \brief Remote Device Reader B prime RF Gate Information Container
*
*/
-typedef struct phNfc_sIso14443BPrimeInfo_t
+typedef struct phNfc_sIso14443BPrimeInfo_t
{
/* TODO: This will be updated later */
void *BPrimeCtxt;
@@ -618,19 +634,19 @@ typedef struct phNfc_sIso14443BPrimeInfo_t
/** \ingroup grp_hal_nfci
*
-* \brief Remote Device Jewel Reader RF Gate Information Container
+* \brief Remote Device Jewel Reader RF Gate Information Container
*
* The <em> Jewel Reader structure </em> includes the available information
-* related to the discovered Jewel remote device. This information
+* related to the discovered Jewel remote device. This information
* is updated for every device discovery.
* \note None.
*
*/
-typedef struct phNfc_sJewelInfo_t
+typedef struct phNfc_sJewelInfo_t
{
uint8_t Uid[PHHAL_MAX_UID_LENGTH]; /**< UID information of the TYPE A
Tag Discovered */
- uint8_t UidLength; /**< UID information length, shall not be greater
+ uint8_t UidLength; /**< UID information length, shall not be greater
than PHHAL_MAX_UID_LENGTH i.e., 10 */
uint8_t HeaderRom0; /**< Header Rom byte zero */
uint8_t HeaderRom1; /**< Header Rom byte one */
@@ -640,10 +656,10 @@ typedef struct phNfc_sJewelInfo_t
/** \ingroup grp_hal_nfci
*
-* \brief Remote Device Felica Reader RF Gate Information Container
+* \brief Remote Device Felica Reader RF Gate Information Container
*
* The <em> Felica Reader structure </em> includes the available information
-* related to the discovered Felica remote device. This information
+* related to the discovered Felica remote device. This information
* is updated for every device discovery.
* \note None.
*
@@ -651,7 +667,7 @@ typedef struct phNfc_sJewelInfo_t
typedef struct phNfc_sFelicaInfo_t
{
uint8_t IDm[(PHHAL_FEL_ID_LEN + 2)]; /**< Current ID of Felica tag */
- uint8_t IDmLength; /**< IDm length, shall not be greater
+ uint8_t IDmLength; /**< IDm length, shall not be greater
than PHHAL_FEL_ID_LEN i.e., 8 */
uint8_t PMm[PHHAL_FEL_PM_LEN]; /**< Current PM of Felica tag */
uint8_t SystemCode[PHHAL_FEL_SYS_CODE_LEN]; /**< System code of Felica tag */
@@ -660,10 +676,10 @@ typedef struct phNfc_sFelicaInfo_t
/** \ingroup grp_hal_nfci
*
-* \brief Remote Device Reader 15693 RF Gate Information Container
+* \brief Remote Device Reader 15693 RF Gate Information Container
*
* The <em> Reader A structure </em> includes the available information
-* related to the discovered ISO15693 remote device. This information
+* related to the discovered ISO15693 remote device. This information
* is updated for every device discovery.
* \note None.
*
@@ -673,7 +689,7 @@ typedef struct phNfc_sIso15693Info_t
{
uint8_t Uid[PHHAL_15693_UID_LENGTH]; /**< UID information of the 15693
Tag Discovered */
- uint8_t UidLength; /**< UID information length, shall not be greater
+ uint8_t UidLength; /**< UID information length, shall not be greater
than PHHAL_15693_UID_LENGTH i.e., 8 */
uint8_t Dsfid; /**< DSF information of the 15693
Tag Discovered */
@@ -688,7 +704,7 @@ typedef struct phNfc_sIso15693Info_t
*
* \brief NFC Data Rate Supported between the Reader and the Target
*
-* The <em> \ref phHalNfc_eDataRate enum </em> lists all the Data Rate
+* The <em> \ref phHalNfc_eDataRate enum </em> lists all the Data Rate
* values to be used to determine the rate at which the data is transmitted
* to the target.
*
@@ -698,41 +714,41 @@ typedef struct phNfc_sIso15693Info_t
/** \ingroup grp_hal_nfci
*
-* \brief NFCIP1 Data rates
+* \brief NFCIP1 Data rates
*
*/
typedef enum phNfc_eDataRate_t{
- phNfc_eDataRate_106 = 0x00U,
- phNfc_eDataRate_212,
- phNfc_eDataRate_424,
- /* phNfc_eDataRate_848,
- phNfc_eDataRate_1696,
- phNfc_eDataRate_3392,
+ phNfc_eDataRate_106 = 0x00U,
+ phNfc_eDataRate_212,
+ phNfc_eDataRate_424,
+ /* phNfc_eDataRate_848,
+ phNfc_eDataRate_1696,
+ phNfc_eDataRate_3392,
phNfc_eDataRate_6784,*/
- phNfc_eDataRate_RFU
+ phNfc_eDataRate_RFU
} phNfc_eDataRate_t;
/** \ingroup grp_hal_nfci
*
-* \brief NFCIP1 Gate Information Container
+* \brief NFCIP1 Gate Information Container
*
* The <em> NFCIP1 structure </em> includes the available information
-* related to the discovered NFCIP1 remote device. This information
+* related to the discovered NFCIP1 remote device. This information
* is updated for every device discovery.
* \note None.
*
*/
-typedef struct phNfc_sNfcIPInfo_t
+typedef struct phNfc_sNfcIPInfo_t
{
- /* Contains the random NFCID3I conveyed with the ATR_REQ.
- always 10 bytes length
+ /* Contains the random NFCID3I conveyed with the ATR_REQ.
+ always 10 bytes length
or contains the random NFCID3T conveyed with the ATR_RES.
always 10 bytes length */
- uint8_t NFCID[PHHAL_MAX_UID_LENGTH];
+ uint8_t NFCID[PHHAL_MAX_UID_LENGTH];
uint8_t NFCID_Length;
/* ATR_RES = General bytes length, Max length = 48 bytes */
- uint8_t ATRInfo[PHHAL_MAX_ATR_LENGTH];
+ uint8_t ATRInfo[PHHAL_MAX_ATR_LENGTH];
uint8_t ATRInfo_Length;
/**< SAK information of the tag discovered */
uint8_t SelRes;
@@ -740,7 +756,7 @@ typedef struct phNfc_sNfcIPInfo_t
uint8_t SenseRes[PHHAL_ATQA_LENGTH];
/**< Is Detection Mode of the NFCIP Target Active */
uint8_t Nfcip_Active;
- /**< Maximum frame length supported by the NFCIP device */
+ /**< Maximum frame length supported by the NFCIP device */
uint16_t MaxFrameLength;
/**< Data rate supported by the NFCIP device */
phNfc_eDataRate_t Nfcip_Datarate;
@@ -767,6 +783,7 @@ typedef union phNfc_uRemoteDevInfo_t
phNfc_sFelicaInfo_t Felica_Info;
phNfc_sJewelInfo_t Jewel_Info;
phNfc_sIso15693Info_t Iso15693_Info;
+ phNfc_sIso14443_4_PCD_Info_t Iso14443_4_PCD_Info;
} phNfc_uRemoteDevInfo_t;
@@ -776,7 +793,7 @@ typedef union phNfc_uRemoteDevInfo_t
*
* The <em> RF Device Type List </em> is used to identify the type of
* remote device that is discovered/connected. There seperate
-* types to identify a Remote Reader (denoted by _PCD) and
+* types to identify a Remote Reader (denoted by _PCD) and
* Remote Tag (denoted by _PICC)
* \note None.
*
@@ -810,8 +827,8 @@ typedef enum phNfc_eRFDevType_t
phNfc_eISO15693_PICC,
/* NFC-IP1 Device Types */
- phNfc_eNfcIP1_Target,
- phNfc_eNfcIP1_Initiator,
+ phNfc_eNfcIP1_Target,
+ phNfc_eNfcIP1_Initiator,
/* Other Sources */
phNfc_eInvalid_DevType
@@ -860,18 +877,18 @@ typedef union phNfc_uCommand_t
* Device detected by the polling function .\n
* It lists parameters common to all supported remote devices.
*
- * \note
+ * \note
*
* \sa \ref phHal4Nfc_ConfigureDiscovery and \ref phHal4Nfc_Connect
*
*/
typedef struct phNfc_sRemoteDevInformation_t
{
- uint8_t SessionOpened; /**< [out] Boolean
+ uint8_t SessionOpened; /**< [out] Boolean
* Flag indicating the validity of
* the handle of the remote device. */
- phNfc_eRemDevType_t RemDevType; /**< [out] Remote device type which says that remote
- is Reader A or Reader B or NFCIP or Felica or
+ phNfc_eRemDevType_t RemDevType; /**< [out] Remote device type which says that remote
+ is Reader A or Reader B or NFCIP or Felica or
Reader B Prime or Jewel*/
phNfc_uRemoteDevInfo_t RemoteDevInfo; /**< Union of available Remote Device.
* \ref phNfc_uRemoteDevInfo_t Information. */
@@ -884,10 +901,10 @@ typedef struct phNfc_sRemoteDevInformation_t
/** \ingroup grp_hal_common
*
- * \brief Transceive Information Data Structure for sending commands/response
+ * \brief Transceive Information Data Structure for sending commands/response
* to the remote device
*
- * The <em> Transceive Information Data Structure </em> is used to pass the
+ * The <em> Transceive Information Data Structure </em> is used to pass the
* Command, Address (only required for MIFARE) and the send and receive data
* data structure (buffer and length) for communication with remote device
*
@@ -913,8 +930,8 @@ typedef struct phNfc_sTransceiveInfo_t
* \brief Poll Device Information for conifiguring the discovery wheel
Reader and Card Emulation Phases
*
-* The <em> \ref phNfc_sPollDevInfo_t enum </em> is used to enable/disable
-* phases of the discovery wheel related to specific reader types and
+* The <em> \ref phNfc_sPollDevInfo_t enum </em> is used to enable/disable
+* phases of the discovery wheel related to specific reader types and
* card emulation phase
* \note Enabling specific Reader technology when NFCIP1 speed is set in the
* phNfc_sADD_Cfg_t is implicitly done in HAL. Use this structure to only
@@ -922,23 +939,23 @@ typedef struct phNfc_sTransceiveInfo_t
*/
typedef struct phNfc_sPollDevInfo_t
{
- unsigned EnableIso14443A : 1; /**< Flag to enable
+ unsigned EnableIso14443A : 1; /**< Flag to enable
Reader A discovery */
- unsigned EnableIso14443B : 1; /**< Flag to enable
+ unsigned EnableIso14443B : 1; /**< Flag to enable
Reader B discovery */
unsigned EnableFelica212 : 1; /**< Flag to enable
Felica 212 discovery */
unsigned EnableFelica424 : 1; /**< Flag to enable
Felica 424 discovery */
- unsigned EnableIso15693 : 1; /**< Flag to enable
+ unsigned EnableIso15693 : 1; /**< Flag to enable
ISO 15693 discovery */
- unsigned EnableNfcActive : 1; /**< Flag to enable
- Active Mode of NFC-IP discovery.
- This is updated internally
+ unsigned EnableNfcActive : 1; /**< Flag to enable
+ Active Mode of NFC-IP discovery.
+ This is updated internally
based on the NFC-IP speed.
*/
unsigned RFU : 1; /**< Reserved for future use */
- unsigned DisableCardEmulation : 1; /**< Flag to
+ unsigned DisableCardEmulation : 1; /**< Flag to
disable the card emulation */
} phNfc_sPollDevInfo_t;
@@ -947,7 +964,7 @@ typedef struct phNfc_sPollDevInfo_t
*
* \brief P2P speed for the Initiator
*
-* The <em> \ref phNfc_eP2PMode_t enum </em> lists all the NFCIP1 speeds
+* The <em> \ref phNfc_eP2PMode_t enum </em> lists all the NFCIP1 speeds
* to be used for configuring the NFCIP1 discovery
*
* \note None.
@@ -986,7 +1003,7 @@ typedef enum phNfc_eNotificationType_t
/** \ingroup grp_hal_common
*
-* \brief
+* \brief
*
* \note None.
*/
@@ -1010,11 +1027,11 @@ typedef struct phNfc_sUiccInfo_t
*
* \note None.
*/
-typedef struct phNfc_sNfcIPCfg_t
+typedef struct phNfc_sNfcIPCfg_t
{
/* ATR_RES = General bytes length, Max length = 48 bytes */
uint8_t generalBytesLength;
- uint8_t generalBytes[PHHAL_MAX_ATR_LENGTH];
+ uint8_t generalBytes[PHHAL_MAX_ATR_LENGTH];
/* TODO: This will be updated later for any additional params*/
} phNfc_sNfcIPCfg_t;
@@ -1025,19 +1042,19 @@ typedef struct phNfc_sNfcIPCfg_t
* \brief Discovery Configuration Mode
*
* This enumeration is used to choose the Discovery Configuration
-* Mode :- Configure and Start, Stop or Start with last set
+* Mode :- Configure and Start, Stop or Start with last set
* configuration
* \note None.
*/
typedef enum phNfc_eDiscoveryConfigMode_t
{
- NFC_DISCOVERY_CONFIG = 0x00U,/**< Configure discovery with values
- in phNfc_sADD_Cfg_t and start
+ NFC_DISCOVERY_CONFIG = 0x00U,/**< Configure discovery with values
+ in phNfc_sADD_Cfg_t and start
discovery */
NFC_DISCOVERY_START, /**< Start Discovery with previously set
configuration */
NFC_DISCOVERY_STOP, /**< Stop the Discovery */
- NFC_DISCOVERY_RESUME /**< Resume the Discovery with previously
+ NFC_DISCOVERY_RESUME /**< Resume the Discovery with previously
* set configuration.
* This is valid only when the Target
* is not connected.
@@ -1048,14 +1065,14 @@ typedef enum phNfc_eDiscoveryConfigMode_t
*
* \brief Target or Tag Release Mode
*
-* This enumeration defines various modes of releasing an acquired target
+* This enumeration defines various modes of releasing an acquired target
* or tag.
* \note None.
*/
typedef enum phNfc_eReleaseType_t
{
NFC_INVALID_RELEASE_TYPE =0x00U,/**<Invalid release type */
- NFC_DISCOVERY_RESTART, /**< Release current target and
+ NFC_DISCOVERY_RESTART, /**< Release current target and
restart discovery within same technology*/
NFC_DISCOVERY_CONTINUE, /**< Release current target and continue
discovery with next technology in the wheel */
@@ -1067,8 +1084,8 @@ typedef enum phNfc_eReleaseType_t
*
* \brief Poll configuration structure
*
-* The <em> Poll configuration structure </em> holds information about the
-* enabling the the type of discovery required by the application. This
+* The <em> Poll configuration structure </em> holds information about the
+* enabling the the type of discovery required by the application. This
* structure is the input parameter for the discovery call
*
* \note All members of this structure are input parameters [out].
@@ -1078,28 +1095,28 @@ typedef enum phNfc_eReleaseType_t
*/
typedef struct phNfc_sADD_Cfg_t
{
- union
+ union
{
- phNfc_sPollDevInfo_t PollCfgInfo; /**< Enable/Disable Specific
- Reader Functionality and
- Card Emulation */
+ phNfc_sPollDevInfo_t PollCfgInfo; /**< Enable/Disable Specific
+ Reader Functionality and
+ Card Emulation */
unsigned PollEnabled; /** Can be used to set polling 'Off'
by setting PollEnabled to zero */
} PollDevInfo;
- uint32_t Duration; /**< Duration of virtual or idle
+ uint32_t Duration; /**< Duration of virtual or idle
period in microseconds in the step size
of 48 microseconds.If duration is set less
than 48 microseconds then default value is
- used.For more details please refer PN 544
+ used.For more details please refer PN 544
user manual*/
uint8_t NfcIP_Mode ; /**< Select the P2P
speeds using phNfc_eP2PMode_t type.
- This is used to enable NFC-IP Discovery
+ This is used to enable NFC-IP Discovery
The related Reader Type will be implicitly
selected */
uint8_t NfcIP_Target_Mode ;
- uint8_t NfcIP_Tgt_Disable; /**< Flag to
+ uint8_t NfcIP_Tgt_Disable; /**< Flag to
disable the NFCIP1 TARGET */
} phNfc_sADD_Cfg_t;