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

📄 oscopemsg.java

📁 tinyos最新版
💻 JAVA
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'OscopeMsg' * message type. */package net.tinyos.oscope;public class OscopeMsg extends net.tinyos.message.Message {    /** The default size of this message type in bytes. */    public static final int DEFAULT_MESSAGE_SIZE = 26;    /** The Active Message type associated with this message. */    public static final int AM_TYPE = 10;    /** Create a new OscopeMsg of size 26. */    public OscopeMsg() {        super(DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /** Create a new OscopeMsg of the given data_length. */    public OscopeMsg(int data_length) {        super(data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new OscopeMsg with the given data_length     * and base offset.     */    public OscopeMsg(int data_length, int base_offset) {        super(data_length, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new OscopeMsg using the given byte array     * as backing store.     */    public OscopeMsg(byte[] data) {        super(data);        amTypeSet(AM_TYPE);    }    /**     * Create a new OscopeMsg using the given byte array     * as backing store, with the given base offset.     */    public OscopeMsg(byte[] data, int base_offset) {        super(data, base_offset);        amTypeSet(AM_TYPE);    }    /**     * Create a new OscopeMsg using the given byte array     * as backing store, with the given base offset and data length.     */    public OscopeMsg(byte[] data, int base_offset, int data_length) {        super(data, base_offset, data_length);        amTypeSet(AM_TYPE);    }    /**     * Create a new OscopeMsg embedded in the given message     * at the given base offset.     */    public OscopeMsg(net.tinyos.message.Message msg, int base_offset) {        super(msg, base_offset, DEFAULT_MESSAGE_SIZE);        amTypeSet(AM_TYPE);    }    /**     * Create a new OscopeMsg embedded in the given message     * at the given base offset and length.     */    public OscopeMsg(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 <OscopeMsg> \n";      try {        s += "  [sourceMoteID=0x"+Long.toHexString(get_sourceMoteID())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {        s += "  [lastSampleNumber=0x"+Long.toHexString(get_lastSampleNumber())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {        s += "  [channel=0x"+Long.toHexString(get_channel())+"]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      try {        s += "  [data=";        for (int i = 0; i < 10; i++) {          s += "0x"+Long.toHexString(getElement_data(i) & 0xff)+" ";        }        s += "]\n";      } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }      return s;    }    // Message-type-specific access methods appear below.    /////////////////////////////////////////////////////////    // Accessor methods for field: sourceMoteID    //   Field type: int, unsigned    //   Offset (bits): 0    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'sourceMoteID' is signed (false).     */    public static boolean isSigned_sourceMoteID() {        return false;    }    /**     * Return whether the field 'sourceMoteID' is an array (false).     */    public static boolean isArray_sourceMoteID() {        return false;    }    /**     * Return the offset (in bytes) of the field 'sourceMoteID'     */    public static int offset_sourceMoteID() {        return (0 / 8);    }    /**     * Return the offset (in bits) of the field 'sourceMoteID'     */    public static int offsetBits_sourceMoteID() {        return 0;    }    /**     * Return the value (as a int) of the field 'sourceMoteID'     */    public int get_sourceMoteID() {        return (int)getUIntElement(offsetBits_sourceMoteID(), 16);    }    /**     * Set the value of the field 'sourceMoteID'     */    public void set_sourceMoteID(int value) {        setUIntElement(offsetBits_sourceMoteID(), 16, value);    }    /**     * Return the size, in bytes, of the field 'sourceMoteID'     */    public static int size_sourceMoteID() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'sourceMoteID'     */    public static int sizeBits_sourceMoteID() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: lastSampleNumber    //   Field type: int, unsigned    //   Offset (bits): 16    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'lastSampleNumber' is signed (false).     */    public static boolean isSigned_lastSampleNumber() {        return false;    }    /**     * Return whether the field 'lastSampleNumber' is an array (false).     */    public static boolean isArray_lastSampleNumber() {        return false;    }    /**     * Return the offset (in bytes) of the field 'lastSampleNumber'     */    public static int offset_lastSampleNumber() {        return (16 / 8);    }    /**     * Return the offset (in bits) of the field 'lastSampleNumber'     */    public static int offsetBits_lastSampleNumber() {        return 16;    }    /**     * Return the value (as a int) of the field 'lastSampleNumber'     */    public int get_lastSampleNumber() {        return (int)getUIntElement(offsetBits_lastSampleNumber(), 16);    }    /**     * Set the value of the field 'lastSampleNumber'     */    public void set_lastSampleNumber(int value) {        setUIntElement(offsetBits_lastSampleNumber(), 16, value);    }    /**     * Return the size, in bytes, of the field 'lastSampleNumber'     */    public static int size_lastSampleNumber() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'lastSampleNumber'     */    public static int sizeBits_lastSampleNumber() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: channel    //   Field type: int, unsigned    //   Offset (bits): 32    //   Size (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'channel' is signed (false).     */    public static boolean isSigned_channel() {        return false;    }    /**     * Return whether the field 'channel' is an array (false).     */    public static boolean isArray_channel() {        return false;    }    /**     * Return the offset (in bytes) of the field 'channel'     */    public static int offset_channel() {        return (32 / 8);    }    /**     * Return the offset (in bits) of the field 'channel'     */    public static int offsetBits_channel() {        return 32;    }    /**     * Return the value (as a int) of the field 'channel'     */    public int get_channel() {        return (int)getUIntElement(offsetBits_channel(), 16);    }    /**     * Set the value of the field 'channel'     */    public void set_channel(int value) {        setUIntElement(offsetBits_channel(), 16, value);    }    /**     * Return the size, in bytes, of the field 'channel'     */    public static int size_channel() {        return (16 / 8);    }    /**     * Return the size, in bits, of the field 'channel'     */    public static int sizeBits_channel() {        return 16;    }    /////////////////////////////////////////////////////////    // Accessor methods for field: data    //   Field type: int[], unsigned    //   Offset (bits): 48    //   Size of each element (bits): 16    /////////////////////////////////////////////////////////    /**     * Return whether the field 'data' is signed (false).     */    public static boolean isSigned_data() {        return false;    }    /**     * Return whether the field 'data' is an array (true).     */    public static boolean isArray_data() {        return true;    }    /**     * Return the offset (in bytes) of the field 'data'     */    public static int offset_data(int index1) {        int offset = 48;        if (index1 < 0 || index1 >= 10) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 16;        return (offset / 8);    }    /**     * Return the offset (in bits) of the field 'data'     */    public static int offsetBits_data(int index1) {        int offset = 48;        if (index1 < 0 || index1 >= 10) throw new ArrayIndexOutOfBoundsException();        offset += 0 + index1 * 16;        return offset;    }    /**     * Return the entire array 'data' as a int[]     */    public int[] get_data() {        int[] tmp = new int[10];        for (int index0 = 0; index0 < numElements_data(0); index0++) {            tmp[index0] = getElement_data(index0);        }        return tmp;    }    /**     * Set the contents of the array 'data' from the given int[]     */    public void set_data(int[] value) {        for (int index0 = 0; index0 < value.length; index0++) {            setElement_data(index0, value[index0]);        }    }    /**     * Return an element (as a int) of the array 'data'     */    public int getElement_data(int index1) {        return (int)getUIntElement(offsetBits_data(index1), 16);    }    /**     * Set an element of the array 'data'     */    public void setElement_data(int index1, int value) {        setUIntElement(offsetBits_data(index1), 16, value);    }    /**     * Return the total size, in bytes, of the array 'data'     */    public static int totalSize_data() {        return (160 / 8);    }    /**     * Return the total size, in bits, of the array 'data'     */    public static int totalSizeBits_data() {        return 160;    }    /**     * Return the size, in bytes, of each element of the array 'data'     */    public static int elementSize_data() {        return (16 / 8);    }    /**     * Return the size, in bits, of each element of the array 'data'     */    public static int elementSizeBits_data() {        return 16;    }    /**     * Return the number of dimensions in the array 'data'     */    public static int numDimensions_data() {        return 1;    }    /**     * Return the number of elements in the array 'data'     */    public static int numElements_data() {        return 10;    }    /**     * Return the number of elements in the array 'data'     * for the given dimension.     */    public static int numElements_data(int dimension) {      int array_dims[] = { 10,  };        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];    }}

⌨️ 快捷键说明

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