diff options
author | Martijn Coenen <maco@google.com> | 2011-10-19 17:31:27 -0700 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2011-10-21 15:48:46 -0700 |
commit | 56f2a7bc39a14487f01cbf2d131ba3cde4126f2d (patch) | |
tree | a6a7954edcbc1d6394481cf2f3dd64385ba3dd12 /jni | |
parent | 7bbabb2deebbc498c635f690c5283201da549247 (diff) | |
download | packages_apps_nfc-56f2a7bc39a14487f01cbf2d131ba3cde4126f2d.zip packages_apps_nfc-56f2a7bc39a14487f01cbf2d131ba3cde4126f2d.tar.gz packages_apps_nfc-56f2a7bc39a14487f01cbf2d131ba3cde4126f2d.tar.bz2 |
NFC: Enable guard host timeout.
Set to 255 ms, increase number of retries to 64.
Add dump() interface to native library
Change-Id: Ib3a32f70453f7f8b79ff89394410f56b4b9dd7a2
Diffstat (limited to 'jni')
-rw-r--r-- | jni/com_android_nfc_NativeNfcManager.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/jni/com_android_nfc_NativeNfcManager.cpp b/jni/com_android_nfc_NativeNfcManager.cpp index fc2b345..b1da2db 100644 --- a/jni/com_android_nfc_NativeNfcManager.cpp +++ b/jni/com_android_nfc_NativeNfcManager.cpp @@ -26,7 +26,9 @@ #define ERROR_BUFFER_TOO_SMALL -12 #define ERROR_INSUFFICIENT_RESOURCES -9 -#define EEDATA_SETTINGS_NUMBER 30 +#define EEDATA_SETTINGS_NUMBER 32 + +extern uint32_t libnfc_llc_error_count; static phLibNfc_sConfig_t gDrvCfg; void *gHWRef; @@ -93,8 +95,11 @@ uint8_t EEDATA_Settings[EEDATA_SETTINGS_NUMBER][4] = { ,{0x00,0x9F,0x36,0x60} // Default value 0x0411 = 50 ms ---> New Value : 0x1460 = 250 ms //LLC Timer - ,{0x00,0x9C,0x31,0x00} // - ,{0x00,0x9C,0x32,0x00} // + ,{0x00,0x9C,0x31,0x00} // Guard host time-out in ms (MSB) + ,{0x00,0x9C,0x32,0xC8} // Guard host time-out in ms (LSB) + ,{0x00,0x9C,0x19,0x40} // Max RX retry (PN544=>host?) + ,{0x00,0x9C,0x1A,0x40} // Max TX retry (PN544=>host?) + ,{0x00,0x9C,0x0C,0x00} // ,{0x00,0x9C,0x0D,0x00} // ,{0x00,0x9C,0x12,0x00} // @@ -2615,6 +2620,13 @@ clean_and_return: return result; } +static jstring com_android_nfc_NfcManager_doDump(JNIEnv *e, jobject o) +{ + char buffer[100]; + snprintf(buffer, sizeof(buffer), "libnfc llc error_count=%u", libnfc_llc_error_count); + return e->NewStringUTF(buffer); +} + /* * JNI registration. */ @@ -2676,6 +2688,9 @@ static JNINativeMethod gMethods[] = {"doAbort", "()V", (void *)com_android_nfc_NfcManager_doAbort}, + + {"doDump", "()Ljava/lang/String;", + (void *)com_android_nfc_NfcManager_doDump}, }; |