/**
 * This class is automatically generated by mig. DO NOT EDIT THIS FILE.
 * This class implements a Java interface to the 'SerialDataMsg'
 * message type.
 */

public class SerialDataMsg extends net.tinyos.message.Message {

    /** The default size of this message type in bytes. */
    public static final int DEFAULT_MESSAGE_SIZE = 13;

    /** The Active Message type associated with this message. */
    public static final int AM_TYPE = 12;

    /** Create a new SerialDataMsg of size 13. */
    public SerialDataMsg() {
        super(DEFAULT_MESSAGE_SIZE);
        amTypeSet(AM_TYPE);
    }

    /** Create a new SerialDataMsg of the given data_length. */
    public SerialDataMsg(int data_length) {
        super(data_length);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new SerialDataMsg with the given data_length
     * and base offset.
     */
    public SerialDataMsg(int data_length, int base_offset) {
        super(data_length, base_offset);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new SerialDataMsg using the given byte array
     * as backing store.
     */
    public SerialDataMsg(byte[] data) {
        super(data);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new SerialDataMsg using the given byte array
     * as backing store, with the given base offset.
     */
    public SerialDataMsg(byte[] data, int base_offset) {
        super(data, base_offset);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new SerialDataMsg using the given byte array
     * as backing store, with the given base offset and data length.
     */
    public SerialDataMsg(byte[] data, int base_offset, int data_length) {
        super(data, base_offset, data_length);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new SerialDataMsg embedded in the given message
     * at the given base offset.
     */
    public SerialDataMsg(net.tinyos.message.Message msg, int base_offset) {
        super(msg, base_offset, DEFAULT_MESSAGE_SIZE);
        amTypeSet(AM_TYPE);
    }

    /**
     * Create a new SerialDataMsg embedded in the given message
     * at the given base offset and length.
     */
    public SerialDataMsg(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 <SerialDataMsg> \n";
      try {
        s += "  [src_island_addr=0x"+Long.toHexString(get_src_island_addr())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [src_mote_addr=0x"+Long.toHexString(get_src_mote_addr())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [counter=0x"+Long.toHexString(get_counter())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [temp=0x"+Long.toHexString(get_temp())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [humid=0x"+Long.toHexString(get_humid())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [light=0x"+Long.toHexString(get_light())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      try {
        s += "  [rssi=0x"+Long.toHexString(get_rssi())+"]\n";
      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }
      return s;
    }

    // Message-type-specific access methods appear below.

    /////////////////////////////////////////////////////////
    // Accessor methods for field: src_island_addr
    //   Field type: short, unsigned
    //   Offset (bits): 0
    //   Size (bits): 8
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'src_island_addr' is signed (false).
     */
    public static boolean isSigned_src_island_addr() {
        return false;
    }

    /**
     * Return whether the field 'src_island_addr' is an array (false).
     */
    public static boolean isArray_src_island_addr() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'src_island_addr'
     */
    public static int offset_src_island_addr() {
        return (0 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'src_island_addr'
     */
    public static int offsetBits_src_island_addr() {
        return 0;
    }

    /**
     * Return the value (as a short) of the field 'src_island_addr'
     */
    public short get_src_island_addr() {
        return (short)getUIntBEElement(offsetBits_src_island_addr(), 8);
    }

    /**
     * Set the value of the field 'src_island_addr'
     */
    public void set_src_island_addr(short value) {
        setUIntBEElement(offsetBits_src_island_addr(), 8, value);
    }

    /**
     * Return the size, in bytes, of the field 'src_island_addr'
     */
    public static int size_src_island_addr() {
        return (8 / 8);
    }

    /**
     * Return the size, in bits, of the field 'src_island_addr'
     */
    public static int sizeBits_src_island_addr() {
        return 8;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: src_mote_addr
    //   Field type: int, unsigned
    //   Offset (bits): 8
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'src_mote_addr' is signed (false).
     */
    public static boolean isSigned_src_mote_addr() {
        return false;
    }

    /**
     * Return whether the field 'src_mote_addr' is an array (false).
     */
    public static boolean isArray_src_mote_addr() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'src_mote_addr'
     */
    public static int offset_src_mote_addr() {
        return (8 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'src_mote_addr'
     */
    public static int offsetBits_src_mote_addr() {
        return 8;
    }

    /**
     * Return the value (as a int) of the field 'src_mote_addr'
     */
    public int get_src_mote_addr() {
        return (int)getUIntBEElement(offsetBits_src_mote_addr(), 16);
    }

    /**
     * Set the value of the field 'src_mote_addr'
     */
    public void set_src_mote_addr(int value) {
        setUIntBEElement(offsetBits_src_mote_addr(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'src_mote_addr'
     */
    public static int size_src_mote_addr() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'src_mote_addr'
     */
    public static int sizeBits_src_mote_addr() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: counter
    //   Field type: int, unsigned
    //   Offset (bits): 24
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'counter' is signed (false).
     */
    public static boolean isSigned_counter() {
        return false;
    }

    /**
     * Return whether the field 'counter' is an array (false).
     */
    public static boolean isArray_counter() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'counter'
     */
    public static int offset_counter() {
        return (24 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'counter'
     */
    public static int offsetBits_counter() {
        return 24;
    }

    /**
     * Return the value (as a int) of the field 'counter'
     */
    public int get_counter() {
        return (int)getUIntBEElement(offsetBits_counter(), 16);
    }

    /**
     * Set the value of the field 'counter'
     */
    public void set_counter(int value) {
        setUIntBEElement(offsetBits_counter(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'counter'
     */
    public static int size_counter() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'counter'
     */
    public static int sizeBits_counter() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: temp
    //   Field type: int, unsigned
    //   Offset (bits): 40
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'temp' is signed (false).
     */
    public static boolean isSigned_temp() {
        return false;
    }

    /**
     * Return whether the field 'temp' is an array (false).
     */
    public static boolean isArray_temp() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'temp'
     */
    public static int offset_temp() {
        return (40 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'temp'
     */
    public static int offsetBits_temp() {
        return 40;
    }

    /**
     * Return the value (as a int) of the field 'temp'
     */
    public int get_temp() {
        return (int)getUIntBEElement(offsetBits_temp(), 16);
    }

    /**
     * Set the value of the field 'temp'
     */
    public void set_temp(int value) {
        setUIntBEElement(offsetBits_temp(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'temp'
     */
    public static int size_temp() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'temp'
     */
    public static int sizeBits_temp() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: humid
    //   Field type: int, unsigned
    //   Offset (bits): 56
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'humid' is signed (false).
     */
    public static boolean isSigned_humid() {
        return false;
    }

    /**
     * Return whether the field 'humid' is an array (false).
     */
    public static boolean isArray_humid() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'humid'
     */
    public static int offset_humid() {
        return (56 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'humid'
     */
    public static int offsetBits_humid() {
        return 56;
    }

    /**
     * Return the value (as a int) of the field 'humid'
     */
    public int get_humid() {
        return (int)getUIntBEElement(offsetBits_humid(), 16);
    }

    /**
     * Set the value of the field 'humid'
     */
    public void set_humid(int value) {
        setUIntBEElement(offsetBits_humid(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'humid'
     */
    public static int size_humid() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'humid'
     */
    public static int sizeBits_humid() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: light
    //   Field type: int, unsigned
    //   Offset (bits): 72
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'light' is signed (false).
     */
    public static boolean isSigned_light() {
        return false;
    }

    /**
     * Return whether the field 'light' is an array (false).
     */
    public static boolean isArray_light() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'light'
     */
    public static int offset_light() {
        return (72 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'light'
     */
    public static int offsetBits_light() {
        return 72;
    }

    /**
     * Return the value (as a int) of the field 'light'
     */
    public int get_light() {
        return (int)getUIntBEElement(offsetBits_light(), 16);
    }

    /**
     * Set the value of the field 'light'
     */
    public void set_light(int value) {
        setUIntBEElement(offsetBits_light(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'light'
     */
    public static int size_light() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'light'
     */
    public static int sizeBits_light() {
        return 16;
    }

    /////////////////////////////////////////////////////////
    // Accessor methods for field: rssi
    //   Field type: int, unsigned
    //   Offset (bits): 88
    //   Size (bits): 16
    /////////////////////////////////////////////////////////

    /**
     * Return whether the field 'rssi' is signed (false).
     */
    public static boolean isSigned_rssi() {
        return false;
    }

    /**
     * Return whether the field 'rssi' is an array (false).
     */
    public static boolean isArray_rssi() {
        return false;
    }

    /**
     * Return the offset (in bytes) of the field 'rssi'
     */
    public static int offset_rssi() {
        return (88 / 8);
    }

    /**
     * Return the offset (in bits) of the field 'rssi'
     */
    public static int offsetBits_rssi() {
        return 88;
    }

    /**
     * Return the value (as a int) of the field 'rssi'
     */
    public int get_rssi() {
        return (int)getUIntBEElement(offsetBits_rssi(), 16);
    }

    /**
     * Set the value of the field 'rssi'
     */
    public void set_rssi(int value) {
        setUIntBEElement(offsetBits_rssi(), 16, value);
    }

    /**
     * Return the size, in bytes, of the field 'rssi'
     */
    public static int size_rssi() {
        return (16 / 8);
    }

    /**
     * Return the size, in bits, of the field 'rssi'
     */
    public static int sizeBits_rssi() {
        return 16;
    }

}
