diff options
-rw-r--r-- | src/phHciNfc_Generic.c | 4 | ||||
-rw-r--r-- | src/phHciNfc_RFReader.c | 3 | ||||
-rw-r--r-- | src/phLibNfc.c | 13 | ||||
-rw-r--r-- | src/phLibNfc.h | 11 |
4 files changed, 29 insertions, 2 deletions
diff --git a/src/phHciNfc_Generic.c b/src/phHciNfc_Generic.c index 4433344..45aefdc 100644 --- a/src/phHciNfc_Generic.c +++ b/src/phHciNfc_Generic.c @@ -56,6 +56,8 @@ ################################################################################ */ +/* HCI timeout value */ +uint32_t nxp_nfc_hci_response_timeout = NXP_NFC_HCI_TIMEOUT; /* ################################################################################ @@ -577,7 +579,7 @@ phHciNfc_Release_Lower( { /* Start the HCI Response Timer */ phOsalNfc_Timer_Start( hci_resp_timer_id, - NXP_HCI_RESPONSE_TIMEOUT, phHciNfc_Response_Timeout, NULL); + nxp_nfc_hci_response_timeout, phHciNfc_Response_Timeout, NULL ); HCI_DEBUG(" HCI : Timer %X Started \n", hci_resp_timer_id); } diff --git a/src/phHciNfc_RFReader.c b/src/phHciNfc_RFReader.c index 6f53f74..1ecba87 100644 --- a/src/phHciNfc_RFReader.c +++ b/src/phHciNfc_RFReader.c @@ -63,6 +63,7 @@ #define NFCIP_ACTIVATE_DELAY 0x05U +uint8_t nxp_nfc_isoxchg_timeout = NXP_ISO_XCHG_TIMEOUT; /* *************************** Structure and Enumeration *************************** */ @@ -2328,7 +2329,7 @@ phHciNfc_ReaderMgmt_Release( (uint8_t) pipe_id, HCP_MSG_TYPE_COMMAND, cmd); hcp_message = &(hcp_packet->msg.message); /* Frame Wait Timeout */ - hcp_message->payload[i++] = NXP_ISO_XCHG_TIMEOUT ; + hcp_message->payload[i++] = nxp_nfc_isoxchg_timeout ; phHciNfc_Append_HCPFrame((uint8_t *)hcp_message->payload, i, p_pipe_info->param_info, p_pipe_info->param_length); diff --git a/src/phLibNfc.c b/src/phLibNfc.c index 008963b..3361f51 100644 --- a/src/phLibNfc.c +++ b/src/phLibNfc.c @@ -117,6 +117,19 @@ NFCSTATUS phLibNfc_Download_Mode () return phDal4Nfc_Download(); } + +extern uint8_t nxp_nfc_isoxchg_timeout; +NFCSTATUS phLibNfc_SetIsoXchgTimeout(uint8_t timeout) { + nxp_nfc_isoxchg_timeout = timeout; + return NFCSTATUS_SUCCESS; +} + +extern uint32_t nxp_nfc_hci_response_timeout; +NFCSTATUS phLibNfc_SetHciTimeout(uint32_t timeout_in_ms) { + nxp_nfc_hci_response_timeout = timeout_in_ms; + return NFCSTATUS_SUCCESS; +} + /** * Initialize the phLibNfc interface. */ diff --git a/src/phLibNfc.h b/src/phLibNfc.h index c09815a..bfd3eb7 100644 --- a/src/phLibNfc.h +++ b/src/phLibNfc.h @@ -845,6 +845,17 @@ NFCSTATUS phLibNfc_HW_Reset (); NFCSTATUS phLibNfc_Download_Mode (); +// 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 +// bit [4] => timeout enable +// bit [5..7] => unused +NFCSTATUS phLibNfc_SetIsoXchgTimeout(uint8_t timeout); +NFCSTATUS phLibNfc_SetHciTimeout(uint32_t timeout_in_ms); + /** * \ingroup grp_lib_nfc * |