📄 bombilladatamsg.java
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'BombillaDataMsg' * message type. */package net.tinyos.vm_asm;public class BombillaDataMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 28; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 31; /** Create a new BombillaDataMsg of size 28. */ public BombillaDataMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new BombillaDataMsg of the given data_length. */ public BombillaDataMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new BombillaDataMsg with the given data_length * and base offset. */ public BombillaDataMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new BombillaDataMsg using the given byte array * as backing store. */ public BombillaDataMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new BombillaDataMsg using the given byte array * as backing store, with the given base offset. */ public BombillaDataMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new BombillaDataMsg using the given byte array * as backing store, with the given base offset and data length. */ public BombillaDataMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new BombillaDataMsg embedded in the given message * at the given base offset. */ public BombillaDataMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new BombillaDataMsg embedded in the given message * at the given base offset and length. */ public BombillaDataMsg(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 <BombillaDataMsg> \n"; try { s += " [header="; for (int i = 0; i < 6; i++) { s += "0x"+Long.toHexString(getElement_header(i) & 0xff)+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [payload.type=0x"+Long.toHexString(get_payload_type())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [payload.size=0x"+Long.toHexString(get_payload_size())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [payload.entries="; for (int i = 0; i < 10; i++) { s += "0x"+Long.toHexString(getElement_payload_entries(i) & 0xff)+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: header // Field type: byte[] // Offset (bits): 0 // Size of each element (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'header' is signed (false). */ public static boolean isSigned_header() { return false; } /** * Return whether the field 'header' is an array (true). */ public static boolean isArray_header() { return true; } /** * Return the offset (in bytes) of the field 'header' */ public static int offset_header(int index1) { int offset = 0; if (index1 < 0 || index1 >= 6) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return (offset / 8); } /** * Return the offset (in bits) of the field 'header' */ public static int offsetBits_header(int index1) { int offset = 0; if (index1 < 0 || index1 >= 6) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return offset; } /** * Return the entire array 'header' as a byte[] */ public byte[] get_header() { byte[] tmp = new byte[6]; for (int index0 = 0; index0 < numElements_header(0); index0++) { tmp[index0] = getElement_header(index0); } return tmp; } /** * Set the contents of the array 'header' from the given byte[] */ public void set_header(byte[] value) { for (int index0 = 0; index0 < value.length; index0++) { setElement_header(index0, value[index0]); } } /** * Return an element (as a byte) of the array 'header' */ public byte getElement_header(int index1) { return (byte)getSIntElement(offsetBits_header(index1), 8); } /** * Set an element of the array 'header' */ public void setElement_header(int index1, byte value) { setSIntElement(offsetBits_header(index1), 8, value); } /** * Return the total size, in bytes, of the array 'header' */ public static int totalSize_header() { return (48 / 8); } /** * Return the total size, in bits, of the array 'header' */ public static int totalSizeBits_header() { return 48; } /** * Return the size, in bytes, of each element of the array 'header' */ public static int elementSize_header() { return (8 / 8); } /** * Return the size, in bits, of each element of the array 'header' */ public static int elementSizeBits_header() { return 8; } /** * Return the number of dimensions in the array 'header' */ public static int numDimensions_header() { return 1; } /** * Return the number of elements in the array 'header' */ public static int numElements_header() { return 6; } /** * Return the number of elements in the array 'header' * for the given dimension. */ public static int numElements_header(int dimension) { int array_dims[] = { 6, }; 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 'header' with a String */ public void setString_header(String s) { int len = s.length(); int i; for (i = 0; i < len; i++) { setElement_header(i, (byte)s.charAt(i)); } setElement_header(i, (byte)0); //null terminate } /** * Read the array 'header' as a String */ public String getString_header() { char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,6)]; int i; for (i = 0; i < carr.length; i++) { if ((char)getElement_header(i) == (char)0) break; carr[i] = (char)getElement_header(i); } return new String(carr,0,i); } ///////////////////////////////////////////////////////// // Accessor methods for field: payload.type // Field type: short // Offset (bits): 48 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'payload.type' is signed (false). */ public static boolean isSigned_payload_type() { return false; } /** * Return whether the field 'payload.type' is an array (false). */ public static boolean isArray_payload_type() { return false; } /** * Return the offset (in bytes) of the field 'payload.type' */ public static int offset_payload_type() { return (48 / 8); } /** * Return the offset (in bits) of the field 'payload.type' */ public static int offsetBits_payload_type() { return 48; } /** * Return the value (as a short) of the field 'payload.type' */ public short get_payload_type() { return (short)getUIntElement(offsetBits_payload_type(), 8); } /** * Set the value of the field 'payload.type' */ public void set_payload_type(short value) { setUIntElement(offsetBits_payload_type(), 8, value); } /** * Return the size, in bytes, of the field 'payload.type' */ public static int size_payload_type() { return (8 / 8); } /** * Return the size, in bits, of the field 'payload.type' */ public static int sizeBits_payload_type() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: payload.size // Field type: short // Offset (bits): 56 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'payload.size' is signed (false). */ public static boolean isSigned_payload_size() { return false; } /** * Return whether the field 'payload.size' is an array (false). */ public static boolean isArray_payload_size() { return false; } /** * Return the offset (in bytes) of the field 'payload.size' */ public static int offset_payload_size() { return (56 / 8); } /** * Return the offset (in bits) of the field 'payload.size' */ public static int offsetBits_payload_size() { return 56; } /** * Return the value (as a short) of the field 'payload.size' */ public short get_payload_size() { return (short)getUIntElement(offsetBits_payload_size(), 8); } /** * Set the value of the field 'payload.size' */ public void set_payload_size(short value) { setUIntElement(offsetBits_payload_size(), 8, value); } /** * Return the size, in bytes, of the field 'payload.size' */ public static int size_payload_size() { return (8 / 8); } /** * Return the size, in bits, of the field 'payload.size' */ public static int sizeBits_payload_size() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: payload.entries // Field type: short[] // Offset (bits): 64 // Size of each element (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'payload.entries' is signed (false). */ public static boolean isSigned_payload_entries() { return false; } /** * Return whether the field 'payload.entries' is an array (true). */ public static boolean isArray_payload_entries() { return true; } /** * Return the offset (in bytes) of the field 'payload.entries' */ public static int offset_payload_entries(int index1) { int offset = 64; if (index1 < 0 || index1 >= 10) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 16; return (offset / 8); } /** * Return the offset (in bits) of the field 'payload.entries' */ public static int offsetBits_payload_entries(int index1) { int offset = 64; if (index1 < 0 || index1 >= 10) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 16; return offset; } /** * Return the entire array 'payload.entries' as a short[] */ public short[] get_payload_entries() { short[] tmp = new short[10]; for (int index0 = 0; index0 < numElements_payload_entries(0); index0++) { tmp[index0] = getElement_payload_entries(index0); } return tmp; } /** * Set the contents of the array 'payload.entries' from the given short[] */ public void set_payload_entries(short[] value) { for (int index0 = 0; index0 < value.length; index0++) { setElement_payload_entries(index0, value[index0]); } } /** * Return an element (as a short) of the array 'payload.entries' */ public short getElement_payload_entries(int index1) { return (short)getSIntElement(offsetBits_payload_entries(index1), 16); } /** * Set an element of the array 'payload.entries' */ public void setElement_payload_entries(int index1, short value) { setSIntElement(offsetBits_payload_entries(index1), 16, value); } /** * Return the total size, in bytes, of the array 'payload.entries' */ public static int totalSize_payload_entries() { return (160 / 8); } /** * Return the total size, in bits, of the array 'payload.entries' */ public static int totalSizeBits_payload_entries() { return 160; } /** * Return the size, in bytes, of each element of the array 'payload.entries' */ public static int elementSize_payload_entries() { return (16 / 8); } /** * Return the size, in bits, of each element of the array 'payload.entries' */ public static int elementSizeBits_payload_entries() { return 16; } /** * Return the number of dimensions in the array 'payload.entries' */ public static int numDimensions_payload_entries() { return 1; } /** * Return the number of elements in the array 'payload.entries' */ public static int numElements_payload_entries() { return 10; } /** * Return the number of elements in the array 'payload.entries' * for the given dimension. */ public static int numElements_payload_entries(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 + -