diff options
-rw-r--r-- | inc/phNfcConfig.h | 2 | ||||
-rw-r--r-- | src/phHciNfc_RFReaderA.c | 3 | ||||
-rw-r--r-- | src/phLibNfc.c | 6 | ||||
-rw-r--r-- | src/phLibNfc.h | 10 |
4 files changed, 19 insertions, 2 deletions
diff --git a/inc/phNfcConfig.h b/inc/phNfcConfig.h index 19a881b..563b7ae 100644 --- a/inc/phNfcConfig.h +++ b/inc/phNfcConfig.h @@ -176,7 +176,7 @@ #endif #ifndef NXP_MIFARE_XCHG_TIMEOUT -#define NXP_MIFARE_XCHG_TIMEOUT 0x03U +#define NXP_MIFARE_XCHG_TIMEOUT 0x0BU #endif #ifndef NXP_FELICA_XCHG_TIMEOUT diff --git a/src/phHciNfc_RFReaderA.c b/src/phHciNfc_RFReaderA.c index ba71724..1b1280a 100644 --- a/src/phHciNfc_RFReaderA.c +++ b/src/phHciNfc_RFReaderA.c @@ -67,6 +67,7 @@ #define RDR_A_MIFARE_RAW_LENGTH 0x03U +uint8_t nxp_nfc_mifareraw_timeout = NXP_MIFARE_XCHG_TIMEOUT; /* *************************** Structure and Enumeration *************************** */ @@ -1037,7 +1038,7 @@ phHciNfc_Send_ReaderA_Command( hcp_message = &(hcp_packet->msg.message); #ifdef ENABLE_MIFARE_RAW /* Time out */ - hcp_message->payload[i++] = NXP_MIFARE_XCHG_TIMEOUT ; + hcp_message->payload[i++] = nxp_nfc_mifareraw_timeout; /* Status */ hcp_message->payload[i++] = RDR_A_MIFARE_STATUS; #else diff --git a/src/phLibNfc.c b/src/phLibNfc.c index b47764e..efd186c 100644 --- a/src/phLibNfc.c +++ b/src/phLibNfc.c @@ -136,6 +136,12 @@ NFCSTATUS phLibNfc_SetFelicaTimeout(uint8_t timeout_in_ms) { return NFCSTATUS_SUCCESS; } +extern uint8_t nxp_nfc_mifareraw_timeout; +NFCSTATUS phLibNfc_SetMifareRawTimeout(uint8_t timeout) { + nxp_nfc_mifareraw_timeout = timeout; + return NFCSTATUS_SUCCESS; +} + /** * Initialize the phLibNfc interface. */ diff --git a/src/phLibNfc.h b/src/phLibNfc.h index 0e0a519..fa24866 100644 --- a/src/phLibNfc.h +++ b/src/phLibNfc.h @@ -860,6 +860,16 @@ NFCSTATUS phLibNfc_SetHciTimeout(uint32_t timeout_in_ms); // [1..255] -> timeout in ms NFCSTATUS phLibNfc_SetFelicaTimeout(uint8_t timeout_in_ms); +// MIFARE RAW timeout (ISO14443-3A / NfcA timeout) +// timeout is 8 bits +// bits [0..3] => timeout value, (256*16/13.56*10^6) * 2^value +// [0] -> 0.0003s +// .. +// [14] -> 4.9s +// [15] -> not allowed +// bits [4..7] => 0 +NFCSTATUS phLibNfc_SetMifareRawTimeout(uint8_t timeout); + /** * \ingroup grp_lib_nfc * |