⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fieldreplymsg.java

📁 tinyos最新版
💻 JAVA
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'FieldReplyMsg' * message type. */package net.tinyos.task.awtfield;public class FieldReplyMsg extends net.tinyos.message.Message {    /** The default size of this message type in bytes. */    public static final int DEFAULT_MESSAGE_SIZE = 6;    /** The Active Message type associated with this message. */    public static final int AM_TYPE = 122;    /** Create a new FieldReplyMsg of size 6. */    public FieldReplyMsg() {        super(DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /** Create a new FieldReplyMsg of the given data_length. */    public FieldReplyMsg(int data_length) {        super(data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldReplyMsg with the given data_length     * and base offset.     */    public FieldReplyMsg(int data_length, int base_offset) {        super(data_length, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldReplyMsg using the given byte array     * as backing store.     */    public FieldReplyMsg(byte[] data) {        super(data);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldReplyMsg using the given byte array     * as backing store, with the given base offset.     */    public FieldReplyMsg(byte[] data, int base_offset) {        super(data, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldReplyMsg using the given byte array     * as backing store, with the given base offset and data length.     */    public FieldReplyMsg(byte[] data, int base_offset, int data_length) {        super(data, base_offset, data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldReplyMsg embedded in the given message     * at the given base offset.     */    public FieldReplyMsg(net.tinyos.message.Message msg, int base_offset) {        super(msg, base_offset, DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /**     * Create a new FieldReplyMsg embedded in the given message     * at the given base offset and length.     */    public FieldReplyMsg(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 <FieldReplyMsg> \n";      try {        s += "  [sender=0x"+Long.toHexString(get_sender())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {        s += "  [cmdId=0x"+Long.toHexString(get_cmdId())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {        s += "  [errorNo=0x"+Long.toHexString(get_errorNo())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      return s;    }    // Message-type-specific access methods appear below.    /////////////////////////////////////////////////////////    // Accessor methods for field: sender    //   Field type: int, signed    //   Offset (bits): 0    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'sender' is signed (true).     */    public static boolean isSigned_sender() {        return true;    }    /**     * Return whether the field 'sender' is an array (false).     */    public static boolean isArray_sender() {        return false;    }    /**     * Return the offset (in bytes) of the field 'sender'     */    public static int offset_sender() {        return (0 / 8);    }    /**     * Return the offset (in bits) of the field 'sender'     */    public static int offsetBits_sender() {        return 0;    }    /**     * Return the value (as a int) of the field 'sender'     */    public int get_sender() {        return (int)getUIntElement(offsetBits_sender(), 16);    }    /**     * Set the value of the field 'sender'     */    public void set_sender(int value) {        setUIntElement(offsetBits_sender(), 16, value);    }    /**     * Return the size, in bytes, of the field 'sender'     */    public static int size_sender() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'sender'     */    public static int sizeBits_sender() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: cmdId    //   Field type: int, signed    //   Offset (bits): 16    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'cmdId' is signed (true).     */    public static boolean isSigned_cmdId() {        return true;    }    /**     * Return whether the field 'cmdId' is an array (false).     */    public static boolean isArray_cmdId() {        return false;    }    /**     * Return the offset (in bytes) of the field 'cmdId'     */    public static int offset_cmdId() {        return (16 / 8);    }    /**     * Return the offset (in bits) of the field 'cmdId'     */    public static int offsetBits_cmdId() {        return 16;    }    /**     * Return the value (as a int) of the field 'cmdId'     */    public int get_cmdId() {        return (int)getUIntElement(offsetBits_cmdId(), 16);    }    /**     * Set the value of the field 'cmdId'     */    public void set_cmdId(int value) {        setUIntElement(offsetBits_cmdId(), 16, value);    }    /**     * Return the size, in bytes, of the field 'cmdId'     */    public static int size_cmdId() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'cmdId'     */    public static int sizeBits_cmdId() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: errorNo    //   Field type: short, signed    //   Offset (bits): 32    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'errorNo' is signed (true).     */    public static boolean isSigned_errorNo() {        return true;    }    /**     * Return whether the field 'errorNo' is an array (false).     */    public static boolean isArray_errorNo() {        return false;    }    /**     * Return the offset (in bytes) of the field 'errorNo'     */    public static int offset_errorNo() {        return (32 / 8);    }    /**     * Return the offset (in bits) of the field 'errorNo'     */    public static int offsetBits_errorNo() {        return 32;    }    /**     * Return the value (as a short) of the field 'errorNo'     */    public short get_errorNo() {        return (short)getSIntElement(offsetBits_errorNo(), 16);    }    /**     * Set the value of the field 'errorNo'     */    public void set_errorNo(short value) {        setSIntElement(offsetBits_errorNo(), 16, value);    }    /**     * Return the size, in bytes, of the field 'errorNo'     */    public static int size_errorNo() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'errorNo'     */    public static int sizeBits_errorNo() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: result    //   Field type: byte[], signed    //   Offset (bits): 48    //   Size of each element (bits): 8    /////////////////////////////////////////////////////////    /**     * Return whether the field 'result' is signed (true).     */    public static boolean isSigned_result() {        return true;    }    /**     * Return whether the field 'result' is an array (true).     */    public static boolean isArray_result() {        return true;    }    /**     * Return the offset (in bytes) of the field 'result'     */    public static int offset_result(int index1) {        int offset = 48;        if (index1 < 0) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 8;        return (offset / 8);    }    /**     * Return the offset (in bits) of the field 'result'     */    public static int offsetBits_result(int index1) {        int offset = 48;        if (index1 < 0) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 8;        return offset;    }    /**     * Return the entire array 'result' as a byte[]     */    public byte[] get_result() {        throw new IllegalArgumentException("Cannot get field as array - unknown size");    }    /**     * Set the contents of the array 'result' from the given byte[]     */    public void set_result(byte[] value) {        for (int index0 = 0; index0 < value.length; index0++) {            setElement_result(index0, value[index0]);        }    }    /**     * Return an element (as a byte) of the array 'result'     */    public byte getElement_result(int index1) {        return (byte)getSIntElement(offsetBits_result(index1), 8);    }    /**     * Set an element of the array 'result'     */    public void setElement_result(int index1, byte value) {        setSIntElement(offsetBits_result(index1), 8, value);    }    /**     * Return the size, in bytes, of each element of the array 'result'     */    public static int elementSize_result() {        return (8 / 8);    }    /**     * Return the size, in bits, of each element of the array 'result'     */    public static int elementSizeBits_result() {        return 8;    }    /**     * Return the number of dimensions in the array 'result'     */    public static int numDimensions_result() {        return 1;    }    /**     * Return the number of elements in the array 'result'     * for the given dimension.     */    public static int numElements_result(int dimension) {      int array_dims[] = { 0,  };        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 'result' with a String     */    public void setString_result(String s) {          int len = s.length();         int i;         for (i = 0; i < len; i++) {             setElement_result(i, (byte)s.charAt(i));         }         setElement_result(i, (byte)0); //null terminate    }    /**     * Read the array 'result' as a String     */    public String getString_result() {          char carr[] = new char[net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH];         int i;         for (i = 0; i < carr.length; i++) {             if ((char)getElement_result(i) == (char)0) break;             carr[i] = (char)getElement_result(i);         }         return new String(carr,0,i);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -