From 5c55dc07b0ad6523f6c4e9ae77c6b67ec45c0889 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 15 Oct 2012 19:16:48 -0500 Subject: [PATCH] AndroidGCS: The leading 0 in each two bytes of the UAVO hash could get chewed up --- androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java b/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java index 053c2a227..509647a10 100644 --- a/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java +++ b/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java @@ -431,9 +431,9 @@ public class TelemetryMonitor extends Observable { } else { final int HASH_SIZE_USED = 8; String jarName = new String(); - for (int i = 0; i < HASH_SIZE_USED; i++) - jarName += Integer.toHexString((int) description - .getDouble(i + 60)); + for (int i = 0; i < HASH_SIZE_USED; i++) { + jarName += String.format("%02x", (int) description.getDouble(i + 60)); + } jarName += ".jar"; if (DEBUG) Log.d(TAG, "Attempting to load: " + jarName); if (telemService.loadUavobjects(jarName, objMngr)) {