/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'ReportMsg' * message type. */ public class ReportMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 14; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 1; /** Create a new ReportMsg of size 14. */ public ReportMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new ReportMsg of the given data_length. */ public ReportMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new ReportMsg with the given data_length * and base offset. */ public ReportMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new ReportMsg using the given byte array * as backing store. */ public ReportMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new ReportMsg using the given byte array * as backing store, with the given base offset. */ public ReportMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new ReportMsg using the given byte array * as backing store, with the given base offset and data length. */ public ReportMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new ReportMsg embedded in the given message * at the given base offset. */ public ReportMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new ReportMsg embedded in the given message * at the given base offset and length. */ public ReportMsg(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 \n"; try { s += " [source=0x"+Long.toHexString(get_source())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [temperature1=0x"+Long.toHexString(get_temperature1())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [temperature2=0x"+Long.toHexString(get_temperature2())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [light1=0x"+Long.toHexString(get_light1())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [light2=0x"+Long.toHexString(get_light2())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: source // Field type: int, signed // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'source' is signed (true). */ public static boolean isSigned_source() { return true; } /** * Return whether the field 'source' is an array (false). */ public static boolean isArray_source() { return false; } /** * Return the offset (in bytes) of the field 'source' */ public static int offset_source() { return (0 / 8); } /** * Return the offset (in bits) of the field 'source' */ public static int offsetBits_source() { return 0; } /** * Return the value (as a int) of the field 'source' */ public int get_source() { return (int)getUIntBEElement(offsetBits_source(), 16); } /** * Set the value of the field 'source' */ public void set_source(int value) { setUIntBEElement(offsetBits_source(), 16, value); } /** * Return the size, in bytes, of the field 'source' */ public static int size_source() { return (16 / 8); } /** * Return the size, in bits, of the field 'source' */ public static int sizeBits_source() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: temperature1 // Field type: int, signed // Offset (bits): 16 // Size (bits): 32 ///////////////////////////////////////////////////////// /** * Return whether the field 'temperature1' is signed (true). */ public static boolean isSigned_temperature1() { return true; } /** * Return whether the field 'temperature1' is an array (false). */ public static boolean isArray_temperature1() { return false; } /** * Return the offset (in bytes) of the field 'temperature1' */ public static int offset_temperature1() { return (16 / 8); } /** * Return the offset (in bits) of the field 'temperature1' */ public static int offsetBits_temperature1() { return 16; } /** * Return the value (as a int) of the field 'temperature1' */ public int get_temperature1() { return (int)getSIntBEElement(offsetBits_temperature1(), 32); } /** * Set the value of the field 'temperature1' */ public void set_temperature1(int value) { setSIntBEElement(offsetBits_temperature1(), 32, value); } /** * Return the size, in bytes, of the field 'temperature1' */ public static int size_temperature1() { return (32 / 8); } /** * Return the size, in bits, of the field 'temperature1' */ public static int sizeBits_temperature1() { return 32; } ///////////////////////////////////////////////////////// // Accessor methods for field: temperature2 // Field type: int, signed // Offset (bits): 48 // Size (bits): 32 ///////////////////////////////////////////////////////// /** * Return whether the field 'temperature2' is signed (true). */ public static boolean isSigned_temperature2() { return true; } /** * Return whether the field 'temperature2' is an array (false). */ public static boolean isArray_temperature2() { return false; } /** * Return the offset (in bytes) of the field 'temperature2' */ public static int offset_temperature2() { return (48 / 8); } /** * Return the offset (in bits) of the field 'temperature2' */ public static int offsetBits_temperature2() { return 48; } /** * Return the value (as a int) of the field 'temperature2' */ public int get_temperature2() { return (int)getSIntBEElement(offsetBits_temperature2(), 32); } /** * Set the value of the field 'temperature2' */ public void set_temperature2(int value) { setSIntBEElement(offsetBits_temperature2(), 32, value); } /** * Return the size, in bytes, of the field 'temperature2' */ public static int size_temperature2() { return (32 / 8); } /** * Return the size, in bits, of the field 'temperature2' */ public static int sizeBits_temperature2() { return 32; } ///////////////////////////////////////////////////////// // Accessor methods for field: light1 // Field type: short, signed // Offset (bits): 80 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'light1' is signed (true). */ public static boolean isSigned_light1() { return true; } /** * Return whether the field 'light1' is an array (false). */ public static boolean isArray_light1() { return false; } /** * Return the offset (in bytes) of the field 'light1' */ public static int offset_light1() { return (80 / 8); } /** * Return the offset (in bits) of the field 'light1' */ public static int offsetBits_light1() { return 80; } /** * Return the value (as a short) of the field 'light1' */ public short get_light1() { return (short)getSIntBEElement(offsetBits_light1(), 16); } /** * Set the value of the field 'light1' */ public void set_light1(short value) { setSIntBEElement(offsetBits_light1(), 16, value); } /** * Return the size, in bytes, of the field 'light1' */ public static int size_light1() { return (16 / 8); } /** * Return the size, in bits, of the field 'light1' */ public static int sizeBits_light1() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: light2 // Field type: short, signed // Offset (bits): 96 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'light2' is signed (true). */ public static boolean isSigned_light2() { return true; } /** * Return whether the field 'light2' is an array (false). */ public static boolean isArray_light2() { return false; } /** * Return the offset (in bytes) of the field 'light2' */ public static int offset_light2() { return (96 / 8); } /** * Return the offset (in bits) of the field 'light2' */ public static int offsetBits_light2() { return 96; } /** * Return the value (as a short) of the field 'light2' */ public short get_light2() { return (short)getSIntBEElement(offsetBits_light2(), 16); } /** * Set the value of the field 'light2' */ public void set_light2(short value) { setSIntBEElement(offsetBits_light2(), 16, value); } /** * Return the size, in bytes, of the field 'light2' */ public static int size_light2() { return (16 / 8); } /** * Return the size, in bits, of the field 'light2' */ public static int sizeBits_light2() { return 16; } }