summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-06-06 13:57:17 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-06 13:57:17 -0700
commita66737d038c5c8dbc96d0b8accb9c511ba7553ac (patch)
tree8a8c21f887267e987b2093d01489a294770a79a6 /src
parent97ffda519d438861f34d6de511f9025656470af6 (diff)
parent1db6f8ed6317c429ced6d2d7c92fd5a64ffe4015 (diff)
downloadexternal_libnfc-nxp-a66737d038c5c8dbc96d0b8accb9c511ba7553ac.zip
external_libnfc-nxp-a66737d038c5c8dbc96d0b8accb9c511ba7553ac.tar.gz
external_libnfc-nxp-a66737d038c5c8dbc96d0b8accb9c511ba7553ac.tar.bz2
Merge "Implement Felica timeout handling (libNFC)."
Diffstat (limited to 'src')
-rw-r--r--src/phHciNfc_Felica.c5
-rw-r--r--src/phLibNfc.c6
-rw-r--r--src/phLibNfc.h4
3 files changed, 13 insertions, 2 deletions
diff --git a/src/phHciNfc_Felica.c b/src/phHciNfc_Felica.c
index 1a353a5..2bbb32a 100644
--- a/src/phHciNfc_Felica.c
+++ b/src/phHciNfc_Felica.c
@@ -58,7 +58,8 @@
#define NXP_FEL_CUR_IDM_PMM_LEN 0x08U
#define FELICA_STATUS 0x00U
-#define FELICA_TIMEOUT NXP_FELICA_XCHG_TIMEOUT
+
+uint8_t nxp_nfc_felica_timeout = NXP_FELICA_XCHG_TIMEOUT;
/* Presence check command for felica tag */
#define FELICA_REQ_MODE 0x04U
@@ -908,7 +909,7 @@ phHciNfc_Send_Felica_Command(
hcp_message = &(hcp_packet->msg.message);
/* Time out */
- hcp_message->payload[i++] = FELICA_TIMEOUT ;
+ hcp_message->payload[i++] = nxp_nfc_felica_timeout ;
/* Status */
hcp_message->payload[i++] = FELICA_STATUS;
diff --git a/src/phLibNfc.c b/src/phLibNfc.c
index 9c7db4f..f5976b7 100644
--- a/src/phLibNfc.c
+++ b/src/phLibNfc.c
@@ -130,6 +130,12 @@ NFCSTATUS phLibNfc_SetHciTimeout(uint32_t timeout_in_ms) {
return NFCSTATUS_SUCCESS;
}
+extern uint32_t nxp_nfc_felica_timeout;
+NFCSTATUS phLibNfc_SetFelicaTimeout(uint8_t timeout_in_ms) {
+ nxp_nfc_felica_timeout = timeout_in_ms;
+ return NFCSTATUS_SUCCESS;
+}
+
/**
* Initialize the phLibNfc interface.
*/
diff --git a/src/phLibNfc.h b/src/phLibNfc.h
index 216196f..0e0a519 100644
--- a/src/phLibNfc.h
+++ b/src/phLibNfc.h
@@ -855,6 +855,10 @@ NFCSTATUS phLibNfc_Download_Mode ();
// bit [5..7] => unused
NFCSTATUS phLibNfc_SetIsoXchgTimeout(uint8_t timeout);
NFCSTATUS phLibNfc_SetHciTimeout(uint32_t timeout_in_ms);
+// Felica timeout
+// [0] -> timeout disabled
+// [1..255] -> timeout in ms
+NFCSTATUS phLibNfc_SetFelicaTimeout(uint8_t timeout_in_ms);
/**
* \ingroup grp_lib_nfc