summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-10-21 16:31:37 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-21 16:31:37 -0700
commit94dc4266b48f757d39ed0396bf0af86cea7c206a (patch)
treee0f214c6a802c8095a3e20e8e97b59c639963a5d
parent51c44537dd9c3fef019f031cc220ca225a360ef0 (diff)
parent56f2a7bc39a14487f01cbf2d131ba3cde4126f2d (diff)
downloadpackages_apps_nfc-94dc4266b48f757d39ed0396bf0af86cea7c206a.zip
packages_apps_nfc-94dc4266b48f757d39ed0396bf0af86cea7c206a.tar.gz
packages_apps_nfc-94dc4266b48f757d39ed0396bf0af86cea7c206a.tar.bz2
Merge "NFC: Enable guard host timeout." into ics-mr0
-rw-r--r--jni/com_android_nfc_NativeNfcManager.cpp21
-rw-r--r--src/com/android/nfc/DeviceHost.java2
-rwxr-xr-xsrc/com/android/nfc/NfcService.java1
-rwxr-xr-xsrc/com/android/nfc/nxp/NativeNfcManager.java6
4 files changed, 27 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},
};
diff --git a/src/com/android/nfc/DeviceHost.java b/src/com/android/nfc/DeviceHost.java
index cfa0ed1..ae7fa40 100644
--- a/src/com/android/nfc/DeviceHost.java
+++ b/src/com/android/nfc/DeviceHost.java
@@ -196,4 +196,6 @@ public interface DeviceHost {
boolean canMakeReadOnly(int technology);
int getMaxTransceiveLength(int technology);
+
+ String dump();
}
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 1b56648..b955714 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -1762,6 +1762,7 @@ public class NfcService extends Application implements DeviceHostListener {
pw.println("mIsAirplaneSensitive=" + mIsAirplaneSensitive);
pw.println("mIsAirplaneToggleable=" + mIsAirplaneToggleable);
mP2pLinkManager.dump(fd, pw, args);
+ pw.println(mDeviceHost.dump());
}
}
}
diff --git a/src/com/android/nfc/nxp/NativeNfcManager.java b/src/com/android/nfc/nxp/NativeNfcManager.java
index ee75b6f..1e69970 100755
--- a/src/com/android/nfc/nxp/NativeNfcManager.java
+++ b/src/com/android/nfc/nxp/NativeNfcManager.java
@@ -244,6 +244,12 @@ public class NativeNfcManager implements DeviceHost {
}
+ private native String doDump();
+ @Override
+ public String dump() {
+ return doDump();
+ }
+
/**
* Notifies Ndef Message (TODO: rename into notifyTargetDiscovered)
*/