From 330b5275a180e0c88ab3a497abfad8a81a665fa2 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 28 Apr 2009 07:33:09 +0000 Subject: [PATCH] bug fix: bytes were not displayed correctly (signed) --- tools/cooja/java/se/sics/cooja/plugins/VariableWatcher.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/VariableWatcher.java b/tools/cooja/java/se/sics/cooja/plugins/VariableWatcher.java index 7c99fe215..6243c2f27 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/VariableWatcher.java +++ b/tools/cooja/java/se/sics/cooja/plugins/VariableWatcher.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: VariableWatcher.java,v 1.6 2008/02/11 14:03:19 fros4943 Exp $ + * $Id: VariableWatcher.java,v 1.7 2009/04/28 07:33:09 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -201,7 +201,7 @@ public class VariableWatcher extends VisPlugin { if (varType.getSelectedIndex() == BYTE_INDEX) { try { byte val = moteMemory.getByteValueOf((String) varName.getSelectedItem()); - varValues[0].setValue(new Integer(val)); + varValues[0].setValue(new Integer(0xFF & val)); varName.setBackground(Color.WHITE); writeButton.setEnabled(true); } catch (UnknownVariableException ex) { @@ -223,7 +223,7 @@ public class VariableWatcher extends VisPlugin { int length = ((Number) varLength.getValue()).intValue(); byte[] vals = moteMemory.getByteArray((String) varName.getSelectedItem(), length); for (int i=0; i < length; i++) { - varValues[i].setValue(new Integer(vals[i])); + varValues[i].setValue(new Integer(0xFF & vals[i])); } varName.setBackground(Color.WHITE); writeButton.setEnabled(true);