Index: tools/java/net/tinyos/message/TOSMsg.java =================================================================== RCS file: /cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/message/TOSMsg.java,v retrieving revision 1.6 diff -u -r1.6 TOSMsg.java --- tools/java/net/tinyos/message/TOSMsg.java 31 May 2004 10:30:26 -0000 1.6 +++ tools/java/net/tinyos/message/TOSMsg.java 24 Nov 2004 01:53:35 -0000 @@ -52,8 +52,6 @@ public abstract int offsetBits_crc() ; public abstract int get_crc() ; public abstract void set_crc(int value) ; - public abstract int get_strength() ; - public abstract void set_strength(int value) ; public abstract short get_ack() ; public abstract void set_ack(short value) ; public abstract int get_time() ; Index: tools/java/net/tinyos/message/micaz/BaseTOSMsg.java =================================================================== RCS file: /cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/message/micaz/BaseTOSMsg.java,v retrieving revision 1.1 diff -u -r1.1 BaseTOSMsg.java --- tools/java/net/tinyos/message/micaz/BaseTOSMsg.java 30 Jun 2004 23:58:14 -0000 1.1 +++ tools/java/net/tinyos/message/micaz/BaseTOSMsg.java 24 Nov 2004 01:53:35 -0000 @@ -9,12 +9,12 @@ public class BaseTOSMsg extends net.tinyos.message.TOSMsg { /** The default size of this message type in bytes. */ - public static final int DEFAULT_MESSAGE_SIZE = 46; + public static final int DEFAULT_MESSAGE_SIZE = 45; /** The Active Message type associated with this message. */ public static final int AM_TYPE = -1; - /** Create a new BaseTOSMsg of size 46. */ + /** Create a new BaseTOSMsg of size 45. */ public BaseTOSMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); @@ -118,15 +118,15 @@ s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { - s += " [crc=0x"+Long.toHexString(get_crc())+"]\n"; - } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } - try { s += " [strength=0x"+Long.toHexString(get_strength())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [lqi=0x"+Long.toHexString(get_lqi())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { + s += " [crc=0x"+Long.toHexString(get_crc())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { s += " [ack=0x"+Long.toHexString(get_ack())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { @@ -795,198 +795,198 @@ } ///////////////////////////////////////////////////////// - // Accessor methods for field: crc - // Field type: int, unsigned + // Accessor methods for field: strength + // Field type: short, unsigned // Offset (bits): 312 - // Size (bits): 16 + // Size (bits): 8 ///////////////////////////////////////////////////////// /** - * Return whether the field 'crc' is signed (false). + * Return whether the field 'strength' is signed (false). */ - public static boolean isSigned_crc() { + public static boolean isSigned_strength() { return false; } /** - * Return whether the field 'crc' is an array (false). + * Return whether the field 'strength' is an array (false). */ - public static boolean isArray_crc() { + public static boolean isArray_strength() { return false; } /** - * Return the offset (in bytes) of the field 'crc' + * Return the offset (in bytes) of the field 'strength' */ - public int offset_crc() { + public static int offset_strength() { return (312 / 8); } /** - * Return the offset (in bits) of the field 'crc' + * Return the offset (in bits) of the field 'strength' */ - public int offsetBits_crc() { + public static int offsetBits_strength() { return 312; } /** - * Return the value (as a int) of the field 'crc' + * Return the value (as a short) of the field 'strength' */ - public int get_crc() { - return (int)getUIntElement(offsetBits_crc(), 16); + public short get_strength() { + return (short)getUIntElement(offsetBits_strength(), 8); } /** - * Set the value of the field 'crc' + * Set the value of the field 'strength' */ - public void set_crc(int value) { - setUIntElement(offsetBits_crc(), 16, value); + public void set_strength(short value) { + setUIntElement(offsetBits_strength(), 8, value); } /** - * Return the size, in bytes, of the field 'crc' + * Return the size, in bytes, of the field 'strength' */ - public static int size_crc() { - return (16 / 8); + public static int size_strength() { + return (8 / 8); } /** - * Return the size, in bits, of the field 'crc' + * Return the size, in bits, of the field 'strength' */ - public static int sizeBits_crc() { - return 16; + public static int sizeBits_strength() { + return 8; } ///////////////////////////////////////////////////////// - // Accessor methods for field: strength + // Accessor methods for field: lqi // Field type: short, unsigned - // Offset (bits): 328 + // Offset (bits): 320 // Size (bits): 8 ///////////////////////////////////////////////////////// /** - * Return whether the field 'strength' is signed (false). + * Return whether the field 'lqi' is signed (false). */ - public static boolean isSigned_strength() { + public static boolean isSigned_lqi() { return false; } /** - * Return whether the field 'strength' is an array (false). + * Return whether the field 'lqi' is an array (false). */ - public static boolean isArray_strength() { + public static boolean isArray_lqi() { return false; } /** - * Return the offset (in bytes) of the field 'strength' + * Return the offset (in bytes) of the field 'lqi' */ - public static int offset_strength() { - return (328 / 8); + public static int offset_lqi() { + return (320 / 8); } /** - * Return the offset (in bits) of the field 'strength' + * Return the offset (in bits) of the field 'lqi' */ - public static int offsetBits_strength() { - return 328; + public static int offsetBits_lqi() { + return 320; } /** - * Return the value (as a short) of the field 'strength' + * Return the value (as a short) of the field 'lqi' */ - public int get_strength() { - return (int)getUIntElement(offsetBits_strength(), 8); + public short get_lqi() { + return (short)getUIntElement(offsetBits_lqi(), 8); } /** - * Set the value of the field 'strength' + * Set the value of the field 'lqi' */ - public void set_strength(int value) { - setUIntElement(offsetBits_strength(), 8, value); + public void set_lqi(short value) { + setUIntElement(offsetBits_lqi(), 8, value); } /** - * Return the size, in bytes, of the field 'strength' + * Return the size, in bytes, of the field 'lqi' */ - public static int size_strength() { + public static int size_lqi() { return (8 / 8); } /** - * Return the size, in bits, of the field 'strength' + * Return the size, in bits, of the field 'lqi' */ - public static int sizeBits_strength() { + public static int sizeBits_lqi() { return 8; } ///////////////////////////////////////////////////////// - // Accessor methods for field: lqi + // Accessor methods for field: crc // Field type: short, unsigned - // Offset (bits): 336 + // Offset (bits): 328 // Size (bits): 8 ///////////////////////////////////////////////////////// /** - * Return whether the field 'lqi' is signed (false). + * Return whether the field 'crc' is signed (false). */ - public static boolean isSigned_lqi() { + public static boolean isSigned_crc() { return false; } /** - * Return whether the field 'lqi' is an array (false). + * Return whether the field 'crc' is an array (false). */ - public static boolean isArray_lqi() { + public static boolean isArray_crc() { return false; } /** - * Return the offset (in bytes) of the field 'lqi' + * Return the offset (in bytes) of the field 'crc' */ - public static int offset_lqi() { - return (336 / 8); + public int offset_crc() { + return (328 / 8); } /** - * Return the offset (in bits) of the field 'lqi' + * Return the offset (in bits) of the field 'crc' */ - public static int offsetBits_lqi() { - return 336; + public int offsetBits_crc() { + return 328; } /** - * Return the value (as a short) of the field 'lqi' + * Return the value (as a short) of the field 'crc' */ - public short get_lqi() { - return (short)getUIntElement(offsetBits_lqi(), 8); + public int get_crc() { + return (short)getUIntElement(offsetBits_crc(), 8); } /** - * Set the value of the field 'lqi' + * Set the value of the field 'crc' */ - public void set_lqi(short value) { - setUIntElement(offsetBits_lqi(), 8, value); + public void set_crc(int value) { + setUIntElement(offsetBits_crc(), 8, value); } /** - * Return the size, in bytes, of the field 'lqi' + * Return the size, in bytes, of the field 'crc' */ - public static int size_lqi() { + public static int size_crc() { return (8 / 8); } /** - * Return the size, in bits, of the field 'lqi' + * Return the size, in bits, of the field 'crc' */ - public static int sizeBits_lqi() { + public static int sizeBits_crc() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: ack // Field type: short, unsigned - // Offset (bits): 344 + // Offset (bits): 336 // Size (bits): 8 ///////////////////////////////////////////////////////// @@ -1008,14 +1008,14 @@ * Return the offset (in bytes) of the field 'ack' */ public static int offset_ack() { - return (344 / 8); + return (336 / 8); } /** * Return the offset (in bits) of the field 'ack' */ public static int offsetBits_ack() { - return 344; + return 336; } /** @@ -1049,7 +1049,7 @@ ///////////////////////////////////////////////////////// // Accessor methods for field: time // Field type: int, unsigned - // Offset (bits): 352 + // Offset (bits): 344 // Size (bits): 16 ///////////////////////////////////////////////////////// @@ -1071,14 +1071,14 @@ * Return the offset (in bytes) of the field 'time' */ public static int offset_time() { - return (352 / 8); + return (344 / 8); } /** * Return the offset (in bits) of the field 'time' */ public static int offsetBits_time() { - return 352; + return 344; } /** Index: tools/java/net/tinyos/message/micaz/Makefile =================================================================== RCS file: /cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/message/micaz/Makefile,v retrieving revision 1.1 diff -u -r1.1 Makefile --- tools/java/net/tinyos/message/micaz/Makefile 30 Jun 2004 23:58:14 -0000 1.1 +++ tools/java/net/tinyos/message/micaz/Makefile 24 Nov 2004 01:53:35 -0000 @@ -10,7 +10,7 @@ #TO REMAKE BaseTOSMsg, uncomment the line below and type make micaz msg #include $(TOS)/../apps/Makerules -AM = $(TOS)/platform/micaz/AM.h +AM = $(TOS)/lib/CC2420Radio/AM.h msg: FORCE $(MIG) $(PFLAGS) $(CFLAGS) -java-classname=$(PACKAGE).$(PLATFORM).BaseTOSMsg $(AM) TOS_Msg -o BaseTOSMsg.java Index: tools/java/net/tinyos/message/telos/BaseTOSMsg.java =================================================================== RCS file: /cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/message/telos/BaseTOSMsg.java,v retrieving revision 1.1 diff -u -r1.1 BaseTOSMsg.java --- tools/java/net/tinyos/message/telos/BaseTOSMsg.java 31 May 2004 10:30:27 -0000 1.1 +++ tools/java/net/tinyos/message/telos/BaseTOSMsg.java 24 Nov 2004 01:53:35 -0000 @@ -6,15 +6,15 @@ package net.tinyos.message.telos; -public abstract class BaseTOSMsg extends net.tinyos.message.TOSMsg { +public class BaseTOSMsg extends net.tinyos.message.TOSMsg { /** The default size of this message type in bytes. */ - public static final int DEFAULT_MESSAGE_SIZE = 44; + public static final int DEFAULT_MESSAGE_SIZE = 45; /** The Active Message type associated with this message. */ public static final int AM_TYPE = -1; - /** Create a new BaseTOSMsg of size 44. */ + /** Create a new BaseTOSMsg of size 45. */ public BaseTOSMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); @@ -112,7 +112,7 @@ } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [data="; - for (int i = 0; i < 28; i++) { + for (int i = 0; i < 29; i++) { s += "0x"+Long.toHexString(getElement_data(i) & 0xff)+" "; } s += "]\n"; @@ -121,6 +121,9 @@ s += " [strength=0x"+Long.toHexString(get_strength())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { + s += " [lqi=0x"+Long.toHexString(get_lqi())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { s += " [crc=0x"+Long.toHexString(get_crc())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { @@ -158,7 +161,7 @@ /** * Return the offset (in bytes) of the field 'length' */ - public int offset_length() { + public int offset_length() { return (0 / 8); } @@ -664,7 +667,7 @@ */ public int offset_data(int index1) { int offset = 80; - if (index1 < 0 || index1 >= 28) throw new ArrayIndexOutOfBoundsException(); + if (index1 < 0 || index1 >= 29) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return (offset / 8); } @@ -674,7 +677,7 @@ */ public static int offsetBits_data(int index1) { int offset = 80; - if (index1 < 0 || index1 >= 28) throw new ArrayIndexOutOfBoundsException(); + if (index1 < 0 || index1 >= 29) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return offset; } @@ -683,7 +686,7 @@ * Return the entire array 'data' as a byte[] */ public byte[] get_data() { - byte[] tmp = new byte[28]; + byte[] tmp = new byte[29]; for (int index0 = 0; index0 < numElements_data(0); index0++) { tmp[index0] = getElement_data(index0); } @@ -717,14 +720,14 @@ * Return the total size, in bytes, of the array 'data' */ public int totalSize_data() { - return (224 / 8); + return (232 / 8); } /** * Return the total size, in bits, of the array 'data' */ public int totalSizeBits_data() { - return 224; + return 232; } /** @@ -751,16 +754,16 @@ /** * Return the number of elements in the array 'data' */ - public int numElements_data() { - return 28; + public int numElements_data() { + return 29; } /** * Return the number of elements in the array 'data' * for the given dimension. */ - public int numElements_data(int dimension) { - int array_dims[] = { 28, }; + public int numElements_data(int dimension) { + int array_dims[] = { 29, }; if (dimension < 0 || dimension >= 1) throw new ArrayIndexOutOfBoundsException(); if (array_dims[dimension] == 0) throw new IllegalArgumentException("Array dimension "+dimension+" has unknown size"); return array_dims[dimension]; @@ -782,7 +785,7 @@ * Read the array 'data' as a String */ public String getString_data() { - char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,28)]; + char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,29)]; int i; for (i = 0; i < carr.length; i++) { if ((char)getElement_data(i) == (char)0) break; @@ -793,9 +796,9 @@ ///////////////////////////////////////////////////////// // Accessor methods for field: strength - // Field type: int, unsigned - // Offset (bits): 304 - // Size (bits): 16 + // Field type: short, unsigned + // Offset (bits): 312 + // Size (bits): 8 ///////////////////////////////////////////////////////// /** @@ -816,52 +819,115 @@ * Return the offset (in bytes) of the field 'strength' */ public static int offset_strength() { - return (304 / 8); + return (312 / 8); } /** * Return the offset (in bits) of the field 'strength' */ public static int offsetBits_strength() { - return 304; + return 312; } /** - * Return the value (as a int) of the field 'strength' + * Return the value (as a short) of the field 'strength' */ - public int get_strength() { - return (int)getUIntElement(offsetBits_strength(), 16); + public short get_strength() { + return (short)getUIntElement(offsetBits_strength(), 8); } /** * Set the value of the field 'strength' */ - public void set_strength(int value) { - setUIntElement(offsetBits_strength(), 16, value); + public void set_strength(short value) { + setUIntElement(offsetBits_strength(), 8, value); } /** * Return the size, in bytes, of the field 'strength' */ public static int size_strength() { - return (16 / 8); + return (8 / 8); } /** * Return the size, in bits, of the field 'strength' */ public static int sizeBits_strength() { - return 16; + return 8; } ///////////////////////////////////////////////////////// - // Accessor methods for field: crc + // Accessor methods for field: lqi // Field type: short, unsigned // Offset (bits): 320 // Size (bits): 8 ///////////////////////////////////////////////////////// /** + * Return whether the field 'lqi' is signed (false). + */ + public static boolean isSigned_lqi() { + return false; + } + + /** + * Return whether the field 'lqi' is an array (false). + */ + public static boolean isArray_lqi() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'lqi' + */ + public static int offset_lqi() { + return (320 / 8); + } + + /** + * Return the offset (in bits) of the field 'lqi' + */ + public static int offsetBits_lqi() { + return 320; + } + + /** + * Return the value (as a short) of the field 'lqi' + */ + public short get_lqi() { + return (short)getUIntElement(offsetBits_lqi(), 8); + } + + /** + * Set the value of the field 'lqi' + */ + public void set_lqi(short value) { + setUIntElement(offsetBits_lqi(), 8, value); + } + + /** + * Return the size, in bytes, of the field 'lqi' + */ + public static int size_lqi() { + return (8 / 8); + } + + /** + * Return the size, in bits, of the field 'lqi' + */ + public static int sizeBits_lqi() { + return 8; + } + + ///////////////////////////////////////////////////////// + // Accessor methods for field: crc + // Field type: short, unsigned + // Offset (bits): 328 + // Size (bits): 8 + ///////////////////////////////////////////////////////// + + /** * Return whether the field 'crc' is signed (false). */ public static boolean isSigned_crc() { @@ -878,17 +944,30 @@ /** * Return the offset (in bytes) of the field 'crc' */ - public int offset_crc() { - return (320 / 8); + public int offset_crc() { + return (328 / 8); } /** * Return the offset (in bits) of the field 'crc' */ - public int offsetBits_crc() { - return 320; + public int offsetBits_crc() { + return 328; + } + + /** + * Return the value (as a short) of the field 'crc' + */ + public int get_crc() { + return (short)getUIntElement(offsetBits_crc(), 8); } + /** + * Set the value of the field 'crc' + */ + public void set_crc(int value) { + setUIntElement(offsetBits_crc(), 8, value); + } /** * Return the size, in bytes, of the field 'crc' @@ -907,7 +986,7 @@ ///////////////////////////////////////////////////////// // Accessor methods for field: ack // Field type: short, unsigned - // Offset (bits): 328 + // Offset (bits): 336 // Size (bits): 8 ///////////////////////////////////////////////////////// @@ -929,14 +1008,14 @@ * Return the offset (in bytes) of the field 'ack' */ public static int offset_ack() { - return (328 / 8); + return (336 / 8); } /** * Return the offset (in bits) of the field 'ack' */ public static int offsetBits_ack() { - return 328; + return 336; } /** @@ -970,7 +1049,7 @@ ///////////////////////////////////////////////////////// // Accessor methods for field: time // Field type: int, unsigned - // Offset (bits): 336 + // Offset (bits): 344 // Size (bits): 16 ///////////////////////////////////////////////////////// @@ -992,14 +1071,14 @@ * Return the offset (in bytes) of the field 'time' */ public static int offset_time() { - return (336 / 8); + return (344 / 8); } /** * Return the offset (in bits) of the field 'time' */ public static int offsetBits_time() { - return 336; + return 344; } /** Index: tools/java/net/tinyos/message/telos/Makefile =================================================================== RCS file: /cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/message/telos/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- tools/java/net/tinyos/message/telos/Makefile 12 Jul 2004 20:19:59 -0000 1.5 +++ tools/java/net/tinyos/message/telos/Makefile 24 Nov 2004 01:53:35 -0000 @@ -10,7 +10,7 @@ #TO REMAKE BaseTOSMsg, uncomment the line below and type make telos msg #include $(TOS)/../apps/Makerules -AM = $(TOS)/platform/telos/AM.h +AM = $(TOS)/lib/CC2420Radio/AM.h msg: FORCE $(MIG) $(PFLAGS) $(CFLAGS) -java-classname=$(PACKAGE).$(PLATFORM).BaseTOSMsg $(AM) TOS_Msg -o BaseTOSMsg.java