[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/rincon/tools/java/com/rincon/jdebug
JDebugMsg.java, NONE, 1.1 JDebugMsg.class, NONE, 1.1
dmm
rincon at users.sourceforge.net
Wed Jul 12 09:44:16 PDT 2006
Update of /cvsroot/tinyos/tinyos-1.x/contrib/rincon/tools/java/com/rincon/jdebug
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3857/contrib/rincon/tools/java/com/rincon/jdebug
Added Files:
JDebugMsg.java JDebugMsg.class
Log Message:
Fixed the default-incompatible StdControl wiring to LedsC, and altered the JDebugMsg to be the default 29 bytes instead of 30.
--- NEW FILE: JDebugMsg.java ---
/**
* This class is automatically generated by mig. DO NOT EDIT THIS FILE.
* This class implements a Java interface to the 'JDebugMsg'
* message type.
*/
package com.rincon.jdebug.messages;
public class JDebugMsg extends net.tinyos.message.Message {
/** The default size of this message type in bytes. */
public static final int DEFAULT_MESSAGE_SIZE = 29;
/** The Active Message type associated with this message. */
public static final int AM_TYPE = 160;
/** Create a new JDebugMsg of size 29. */
public JDebugMsg() {
super(DEFAULT_MESSAGE_SIZE);
amTypeSet(AM_TYPE);
}
/** Create a new JDebugMsg of the given data_length. */
public JDebugMsg(int data_length) {
super(data_length);
amTypeSet(AM_TYPE);
}
/**
* Create a new JDebugMsg with the given data_length
* and base offset.
*/
public JDebugMsg(int data_length, int base_offset) {
super(data_length, base_offset);
amTypeSet(AM_TYPE);
}
/**
* Create a new JDebugMsg using the given byte array
* as backing store.
*/
public JDebugMsg(byte[] data) {
super(data);
amTypeSet(AM_TYPE);
}
/**
* Create a new JDebugMsg using the given byte array
* as backing store, with the given base offset.
*/
public JDebugMsg(byte[] data, int base_offset) {
super(data, base_offset);
amTypeSet(AM_TYPE);
}
/**
* Create a new JDebugMsg using the given byte array
* as backing store, with the given base offset and data length.
*/
public JDebugMsg(byte[] data, int base_offset, int data_length) {
super(data, base_offset, data_length);
amTypeSet(AM_TYPE);
}
/**
* Create a new JDebugMsg embedded in the given message
* at the given base offset.
*/
public JDebugMsg(net.tinyos.message.Message msg, int base_offset) {
super(msg, base_offset, DEFAULT_MESSAGE_SIZE);
amTypeSet(AM_TYPE);
}
/**
* Create a new JDebugMsg embedded in the given message
* at the given base offset and length.
*/
public JDebugMsg(net.tinyos.message.Message msg, int base_offset, int data_length) {
super(msg, base_offset, data_length);
amTypeSet(AM_TYPE);
}
/**
/* Return a String representation of this message. Includes the
* message type name and the non-indexed field values.
*/
public String toString() {
String s = "Message <JDebugMsg> \n";
try {
s += " [dlong=0x"+Long.toHexString(get_dlong())+"]\n";
} catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
try {
s += " [dint=0x"+Long.toHexString(get_dint())+"]\n";
} catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
try {
s += " [dshort=0x"+Long.toHexString(get_dshort())+"]\n";
} catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
try {
s += " [newLine=0x"+Long.toHexString(get_newLine())+"]\n";
} catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
try {
s += " [msg=";
for (int i = 0; i < 21; i++) {
s += "0x"+Long.toHexString(getElement_msg(i) & 0xff)+" ";
}
s += "]\n";
} catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
return s;
}
// Message-type-specific access methods appear below.
/////////////////////////////////////////////////////////
// Accessor methods for field: dlong
// Field type: long, unsigned
// Offset (bits): 0
// Size (bits): 32
/////////////////////////////////////////////////////////
/**
* Return whether the field 'dlong' is signed (false).
*/
public static boolean isSigned_dlong() {
return false;
}
/**
* Return whether the field 'dlong' is an array (false).
*/
public static boolean isArray_dlong() {
return false;
}
/**
* Return the offset (in bytes) of the field 'dlong'
*/
public static int offset_dlong() {
return (0 / 8);
}
/**
* Return the offset (in bits) of the field 'dlong'
*/
public static int offsetBits_dlong() {
return 0;
}
/**
* Return the value (as a long) of the field 'dlong'
*/
public long get_dlong() {
return (long)getUIntElement(offsetBits_dlong(), 32);
}
/**
* Set the value of the field 'dlong'
*/
public void set_dlong(long value) {
setUIntElement(offsetBits_dlong(), 32, value);
}
/**
* Return the size, in bytes, of the field 'dlong'
*/
public static int size_dlong() {
return (32 / 8);
}
/**
* Return the size, in bits, of the field 'dlong'
*/
public static int sizeBits_dlong() {
return 32;
}
/////////////////////////////////////////////////////////
// Accessor methods for field: dint
// Field type: int, unsigned
// Offset (bits): 32
// Size (bits): 16
/////////////////////////////////////////////////////////
/**
* Return whether the field 'dint' is signed (false).
*/
public static boolean isSigned_dint() {
return false;
}
/**
* Return whether the field 'dint' is an array (false).
*/
public static boolean isArray_dint() {
return false;
}
/**
* Return the offset (in bytes) of the field 'dint'
*/
public static int offset_dint() {
return (32 / 8);
}
/**
* Return the offset (in bits) of the field 'dint'
*/
public static int offsetBits_dint() {
return 32;
}
/**
* Return the value (as a int) of the field 'dint'
*/
public int get_dint() {
return (int)getUIntElement(offsetBits_dint(), 16);
}
/**
* Set the value of the field 'dint'
*/
public void set_dint(int value) {
setUIntElement(offsetBits_dint(), 16, value);
}
/**
* Return the size, in bytes, of the field 'dint'
*/
public static int size_dint() {
return (16 / 8);
}
/**
* Return the size, in bits, of the field 'dint'
*/
public static int sizeBits_dint() {
return 16;
}
/////////////////////////////////////////////////////////
// Accessor methods for field: dshort
// Field type: short, unsigned
// Offset (bits): 48
// Size (bits): 8
/////////////////////////////////////////////////////////
/**
* Return whether the field 'dshort' is signed (false).
*/
public static boolean isSigned_dshort() {
return false;
}
/**
* Return whether the field 'dshort' is an array (false).
*/
public static boolean isArray_dshort() {
return false;
}
/**
* Return the offset (in bytes) of the field 'dshort'
*/
public static int offset_dshort() {
return (48 / 8);
}
/**
* Return the offset (in bits) of the field 'dshort'
*/
public static int offsetBits_dshort() {
return 48;
}
/**
* Return the value (as a short) of the field 'dshort'
*/
public short get_dshort() {
return (short)getUIntElement(offsetBits_dshort(), 8);
}
/**
* Set the value of the field 'dshort'
*/
public void set_dshort(short value) {
setUIntElement(offsetBits_dshort(), 8, value);
}
/**
* Return the size, in bytes, of the field 'dshort'
*/
public static int size_dshort() {
return (8 / 8);
}
/**
* Return the size, in bits, of the field 'dshort'
*/
public static int sizeBits_dshort() {
return 8;
}
/////////////////////////////////////////////////////////
// Accessor methods for field: newLine
// Field type: short, unsigned
// Offset (bits): 56
// Size (bits): 8
/////////////////////////////////////////////////////////
/**
* Return whether the field 'newLine' is signed (false).
*/
public static boolean isSigned_newLine() {
return false;
}
/**
* Return whether the field 'newLine' is an array (false).
*/
public static boolean isArray_newLine() {
return false;
}
/**
* Return the offset (in bytes) of the field 'newLine'
*/
public static int offset_newLine() {
return (56 / 8);
}
/**
* Return the offset (in bits) of the field 'newLine'
*/
public static int offsetBits_newLine() {
return 56;
}
/**
* Return the value (as a short) of the field 'newLine'
*/
public short get_newLine() {
return (short)getUIntElement(offsetBits_newLine(), 8);
}
/**
* Set the value of the field 'newLine'
*/
public void set_newLine(short value) {
setUIntElement(offsetBits_newLine(), 8, value);
}
/**
* Return the size, in bytes, of the field 'newLine'
*/
public static int size_newLine() {
return (8 / 8);
}
/**
* Return the size, in bits, of the field 'newLine'
*/
public static int sizeBits_newLine() {
return 8;
}
/////////////////////////////////////////////////////////
// Accessor methods for field: msg
// Field type: short[], unsigned
// Offset (bits): 64
// Size of each element (bits): 8
/////////////////////////////////////////////////////////
/**
* Return whether the field 'msg' is signed (false).
*/
public static boolean isSigned_msg() {
return false;
}
/**
* Return whether the field 'msg' is an array (true).
*/
public static boolean isArray_msg() {
return true;
}
/**
* Return the offset (in bytes) of the field 'msg'
*/
public static int offset_msg(int index1) {
int offset = 64;
if (index1 < 0 || index1 >= 21) throw new ArrayIndexOutOfBoundsException();
offset += 0 + index1 * 8;
return (offset / 8);
}
/**
* Return the offset (in bits) of the field 'msg'
*/
public static int offsetBits_msg(int index1) {
int offset = 64;
if (index1 < 0 || index1 >= 21) throw new ArrayIndexOutOfBoundsException();
offset += 0 + index1 * 8;
return offset;
}
/**
* Return the entire array 'msg' as a short[]
*/
public short[] get_msg() {
short[] tmp = new short[21];
for (int index0 = 0; index0 < numElements_msg(0); index0++) {
tmp[index0] = getElement_msg(index0);
}
return tmp;
}
/**
* Set the contents of the array 'msg' from the given short[]
*/
public void set_msg(short[] value) {
for (int index0 = 0; index0 < value.length; index0++) {
setElement_msg(index0, value[index0]);
}
}
/**
* Return an element (as a short) of the array 'msg'
*/
public short getElement_msg(int index1) {
return (short)getUIntElement(offsetBits_msg(index1), 8);
}
/**
* Set an element of the array 'msg'
*/
public void setElement_msg(int index1, short value) {
setUIntElement(offsetBits_msg(index1), 8, value);
}
/**
* Return the total size, in bytes, of the array 'msg'
*/
public static int totalSize_msg() {
return (168 / 8);
}
/**
* Return the total size, in bits, of the array 'msg'
*/
public static int totalSizeBits_msg() {
return 168;
}
/**
* Return the size, in bytes, of each element of the array 'msg'
*/
public static int elementSize_msg() {
return (8 / 8);
}
/**
* Return the size, in bits, of each element of the array 'msg'
*/
public static int elementSizeBits_msg() {
return 8;
}
/**
* Return the number of dimensions in the array 'msg'
*/
public static int numDimensions_msg() {
return 1;
}
/**
* Return the number of elements in the array 'msg'
*/
public static int numElements_msg() {
return 21;
}
/**
* Return the number of elements in the array 'msg'
* for the given dimension.
*/
public static int numElements_msg(int dimension) {
int array_dims[] = { 21, };
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];
}
/**
* Fill in the array 'msg' with a String
*/
public void setString_msg(String s) {
int len = s.length();
int i;
for (i = 0; i < len; i++) {
setElement_msg(i, (short)s.charAt(i));
}
setElement_msg(i, (short)0); //null terminate
}
/**
* Read the array 'msg' as a String
*/
public String getString_msg() {
char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,21)];
int i;
for (i = 0; i < carr.length; i++) {
if ((char)getElement_msg(i) == (char)0) break;
carr[i] = (char)getElement_msg(i);
}
return new String(carr,0,i);
}
}
--- NEW FILE: JDebugMsg.class ---
Êþº¾
size_dlong
get_dshort
set_dshort
offset_msg
SourceFile
[dint=0x
*
*¸
YOL
ô
More information about the Tinyos-contrib-commits
mailing list