📄 bombillacapsulemsg.java
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'BombillaCapsuleMsg' * message type. */package net.tinyos.vm_asm;public class BombillaCapsuleMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 30; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 30; /** Create a new BombillaCapsuleMsg of size 30. */ public BombillaCapsuleMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new BombillaCapsuleMsg of the given data_length. */ public BombillaCapsuleMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new BombillaCapsuleMsg with the given data_length * and base offset. */ public BombillaCapsuleMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new BombillaCapsuleMsg using the given byte array * as backing store. */ public BombillaCapsuleMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new BombillaCapsuleMsg using the given byte array * as backing store, with the given base offset. */ public BombillaCapsuleMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new BombillaCapsuleMsg using the given byte array * as backing store, with the given base offset and data length. */ public BombillaCapsuleMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new BombillaCapsuleMsg embedded in the given message * at the given base offset. */ public BombillaCapsuleMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new BombillaCapsuleMsg embedded in the given message * at the given base offset and length. */ public BombillaCapsuleMsg(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 <BombillaCapsuleMsg> \n"; try { s += " [capsule.version=0x"+Long.toHexString(get_capsule_version())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [capsule.type=0x"+Long.toHexString(get_capsule_type())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [capsule.options=0x"+Long.toHexString(get_capsule_options())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [capsule.code="; for (int i = 0; i < 24; i++) { s += "0x"+Long.toHexString(getElement_capsule_code(i) & 0xff)+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: capsule.version // Field type: long // Offset (bits): 0 // Size (bits): 32 ///////////////////////////////////////////////////////// /** * Return whether the field 'capsule.version' is signed (false). */ public static boolean isSigned_capsule_version() { return false; } /** * Return whether the field 'capsule.version' is an array (false). */ public static boolean isArray_capsule_version() { return false; } /** * Return the offset (in bytes) of the field 'capsule.version' */ public static int offset_capsule_version() { return (0 / 8); } /** * Return the offset (in bits) of the field 'capsule.version' */ public static int offsetBits_capsule_version() { return 0; } /** * Return the value (as a long) of the field 'capsule.version' */ public long get_capsule_version() { return (long)getUIntElement(offsetBits_capsule_version(), 32); } /** * Set the value of the field 'capsule.version' */ public void set_capsule_version(long value) { setUIntElement(offsetBits_capsule_version(), 32, value); } /** * Return the size, in bytes, of the field 'capsule.version' */ public static int size_capsule_version() { return (32 / 8); } /** * Return the size, in bits, of the field 'capsule.version' */ public static int sizeBits_capsule_version() { return 32; } ///////////////////////////////////////////////////////// // Accessor methods for field: capsule.type // Field type: short // Offset (bits): 32 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'capsule.type' is signed (false). */ public static boolean isSigned_capsule_type() { return false; } /** * Return whether the field 'capsule.type' is an array (false). */ public static boolean isArray_capsule_type() { return false; } /** * Return the offset (in bytes) of the field 'capsule.type' */ public static int offset_capsule_type() { return (32 / 8); } /** * Return the offset (in bits) of the field 'capsule.type' */ public static int offsetBits_capsule_type() { return 32; } /** * Return the value (as a short) of the field 'capsule.type' */ public short get_capsule_type() { return (short)getUIntElement(offsetBits_capsule_type(), 8); } /** * Set the value of the field 'capsule.type' */ public void set_capsule_type(short value) { setUIntElement(offsetBits_capsule_type(), 8, value); } /** * Return the size, in bytes, of the field 'capsule.type' */ public static int size_capsule_type() { return (8 / 8); } /** * Return the size, in bits, of the field 'capsule.type' */ public static int sizeBits_capsule_type() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: capsule.options // Field type: short // Offset (bits): 40 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'capsule.options' is signed (false). */ public static boolean isSigned_capsule_options() { return false; } /** * Return whether the field 'capsule.options' is an array (false). */ public static boolean isArray_capsule_options() { return false; } /** * Return the offset (in bytes) of the field 'capsule.options' */ public static int offset_capsule_options() { return (40 / 8); } /** * Return the offset (in bits) of the field 'capsule.options' */ public static int offsetBits_capsule_options() { return 40; } /** * Return the value (as a short) of the field 'capsule.options' */ public short get_capsule_options() { return (short)getUIntElement(offsetBits_capsule_options(), 8); } /** * Set the value of the field 'capsule.options' */ public void set_capsule_options(short value) { setUIntElement(offsetBits_capsule_options(), 8, value); } /** * Return the size, in bytes, of the field 'capsule.options' */ public static int size_capsule_options() { return (8 / 8); } /** * Return the size, in bits, of the field 'capsule.options' */ public static int sizeBits_capsule_options() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: capsule.code // Field type: byte[] // Offset (bits): 48 // Size of each element (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'capsule.code' is signed (false). */ public static boolean isSigned_capsule_code() { return false; } /** * Return whether the field 'capsule.code' is an array (true). */ public static boolean isArray_capsule_code() { return true; } /** * Return the offset (in bytes) of the field 'capsule.code' */ public static int offset_capsule_code(int index1) { int offset = 48; if (index1 < 0 || index1 >= 24) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return (offset / 8); } /** * Return the offset (in bits) of the field 'capsule.code' */ public static int offsetBits_capsule_code(int index1) { int offset = 48; if (index1 < 0 || index1 >= 24) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return offset; } /** * Return the entire array 'capsule.code' as a byte[] */ public byte[] get_capsule_code() { byte[] tmp = new byte[24]; for (int index0 = 0; index0 < numElements_capsule_code(0); index0++) { tmp[index0] = getElement_capsule_code(index0); } return tmp; } /** * Set the contents of the array 'capsule.code' from the given byte[] */ public void set_capsule_code(byte[] value) { for (int index0 = 0; index0 < value.length; index0++) { setElement_capsule_code(index0, value[index0]); } } /** * Return an element (as a byte) of the array 'capsule.code' */ public byte getElement_capsule_code(int index1) { return (byte)getSIntElement(offsetBits_capsule_code(index1), 8); } /** * Set an element of the array 'capsule.code' */ public void setElement_capsule_code(int index1, byte value) { setSIntElement(offsetBits_capsule_code(index1), 8, value); } /** * Return the total size, in bytes, of the array 'capsule.code' */ public static int totalSize_capsule_code() { return (192 / 8); } /** * Return the total size, in bits, of the array 'capsule.code' */ public static int totalSizeBits_capsule_code() { return 192; } /** * Return the size, in bytes, of each element of the array 'capsule.code' */ public static int elementSize_capsule_code() { return (8 / 8); } /** * Return the size, in bits, of each element of the array 'capsule.code' */ public static int elementSizeBits_capsule_code() { return 8; } /** * Return the number of dimensions in the array 'capsule.code' */ public static int numDimensions_capsule_code() { return 1; } /** * Return the number of elements in the array 'capsule.code' */ public static int numElements_capsule_code() { return 24; } /** * Return the number of elements in the array 'capsule.code' * for the given dimension. */ public static int numElements_capsule_code(int dimension) { int array_dims[] = { 24, }; 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 'capsule.code' with a String */ public void setString_capsule_code(String s) { int len = s.length(); int i; for (i = 0; i < len; i++) { setElement_capsule_code(i, (byte)s.charAt(i)); } setElement_capsule_code(i, (byte)0); //null terminate } /** * Read the array 'capsule.code' as a String */ public String getString_capsule_code() { char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,24)]; int i; for (i = 0; i < carr.length; i++) { if ((char)getElement_capsule_code(i) == (char)0) break; carr[i] = (char)getElement_capsule_code(i); } return new String(carr,0,i); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -