📄 identmsg.java
字号:
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'IdentMsg' * message type. */package net.tinyos.ident;public class IdentMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 21; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 12; /** Create a new IdentMsg of size 21. */ public IdentMsg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new IdentMsg of the given data_length. */ public IdentMsg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new IdentMsg with the given data_length * and base offset. */ public IdentMsg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new IdentMsg using the given byte array * as backing store. */ public IdentMsg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new IdentMsg using the given byte array * as backing store, with the given base offset. */ public IdentMsg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new IdentMsg using the given byte array * as backing store, with the given base offset and data length. */ public IdentMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new IdentMsg embedded in the given message * at the given base offset. */ public IdentMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new IdentMsg embedded in the given message * at the given base offset and length. */ public IdentMsg(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 <IdentMsg> \n"; try { s += " [seqno=0x"+Long.toHexString(get_seqno())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [broadcastPeriod=0x"+Long.toHexString(get_broadcastPeriod())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [identity.id="; for (int i = 0; i < 15; i++) { s += "0x"+Long.toHexString(getElement_identity_id(i) & 0xff)+" "; } s += "]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [msgRate=0x"+Long.toHexString(get_msgRate())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: seqno // Field type: int, unsigned // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'seqno' is signed (false). */ public static boolean isSigned_seqno() { return false; } /** * Return whether the field 'seqno' is an array (false). */ public static boolean isArray_seqno() { return false; } /** * Return the offset (in bytes) of the field 'seqno' */ public static int offset_seqno() { return (0 / 8); } /** * Return the offset (in bits) of the field 'seqno' */ public static int offsetBits_seqno() { return 0; } /** * Return the value (as a int) of the field 'seqno' */ public int get_seqno() { return (int)getUIntElement(offsetBits_seqno(), 16); } /** * Set the value of the field 'seqno' */ public void set_seqno(int value) { setUIntElement(offsetBits_seqno(), 16, value); } /** * Return the size, in bytes, of the field 'seqno' */ public static int size_seqno() { return (16 / 8); } /** * Return the size, in bits, of the field 'seqno' */ public static int sizeBits_seqno() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: broadcastPeriod // Field type: int, unsigned // Offset (bits): 16 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'broadcastPeriod' is signed (false). */ public static boolean isSigned_broadcastPeriod() { return false; } /** * Return whether the field 'broadcastPeriod' is an array (false). */ public static boolean isArray_broadcastPeriod() { return false; } /** * Return the offset (in bytes) of the field 'broadcastPeriod' */ public static int offset_broadcastPeriod() { return (16 / 8); } /** * Return the offset (in bits) of the field 'broadcastPeriod' */ public static int offsetBits_broadcastPeriod() { return 16; } /** * Return the value (as a int) of the field 'broadcastPeriod' */ public int get_broadcastPeriod() { return (int)getUIntElement(offsetBits_broadcastPeriod(), 16); } /** * Set the value of the field 'broadcastPeriod' */ public void set_broadcastPeriod(int value) { setUIntElement(offsetBits_broadcastPeriod(), 16, value); } /** * Return the size, in bytes, of the field 'broadcastPeriod' */ public static int size_broadcastPeriod() { return (16 / 8); } /** * Return the size, in bits, of the field 'broadcastPeriod' */ public static int sizeBits_broadcastPeriod() { return 16; } ///////////////////////////////////////////////////////// // Accessor methods for field: identity.id // Field type: byte[], unsigned // Offset (bits): 32 // Size of each element (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'identity.id' is signed (false). */ public static boolean isSigned_identity_id() { return false; } /** * Return whether the field 'identity.id' is an array (true). */ public static boolean isArray_identity_id() { return true; } /** * Return the offset (in bytes) of the field 'identity.id' */ public static int offset_identity_id(int index1) { int offset = 32; if (index1 < 0 || index1 >= 15) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return (offset / 8); } /** * Return the offset (in bits) of the field 'identity.id' */ public static int offsetBits_identity_id(int index1) { int offset = 32; if (index1 < 0 || index1 >= 15) throw new ArrayIndexOutOfBoundsException(); offset += 0 + index1 * 8; return offset; } /** * Return the entire array 'identity.id' as a byte[] */ public byte[] get_identity_id() { byte[] tmp = new byte[15]; for (int index0 = 0; index0 < numElements_identity_id(0); index0++) { tmp[index0] = getElement_identity_id(index0); } return tmp; } /** * Set the contents of the array 'identity.id' from the given byte[] */ public void set_identity_id(byte[] value) { for (int index0 = 0; index0 < value.length; index0++) { setElement_identity_id(index0, value[index0]); } } /** * Return an element (as a byte) of the array 'identity.id' */ public byte getElement_identity_id(int index1) { return (byte)getSIntElement(offsetBits_identity_id(index1), 8); } /** * Set an element of the array 'identity.id' */ public void setElement_identity_id(int index1, byte value) { setSIntElement(offsetBits_identity_id(index1), 8, value); } /** * Return the total size, in bytes, of the array 'identity.id' */ public static int totalSize_identity_id() { return (120 / 8); } /** * Return the total size, in bits, of the array 'identity.id' */ public static int totalSizeBits_identity_id() { return 120; } /** * Return the size, in bytes, of each element of the array 'identity.id' */ public static int elementSize_identity_id() { return (8 / 8); } /** * Return the size, in bits, of each element of the array 'identity.id' */ public static int elementSizeBits_identity_id() { return 8; } /** * Return the number of dimensions in the array 'identity.id' */ public static int numDimensions_identity_id() { return 1; } /** * Return the number of elements in the array 'identity.id' */ public static int numElements_identity_id() { return 15; } /** * Return the number of elements in the array 'identity.id' * for the given dimension. */ public static int numElements_identity_id(int dimension) { int array_dims[] = { 15, }; 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 'identity.id' with a String */ public void setString_identity_id(String s) { int len = s.length(); int i; for (i = 0; i < len; i++) { setElement_identity_id(i, (byte)s.charAt(i)); } setElement_identity_id(i, (byte)0); //null terminate } /** * Read the array 'identity.id' as a String */ public String getString_identity_id() { char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,15)]; int i; for (i = 0; i < carr.length; i++) { if ((char)getElement_identity_id(i) == (char)0) break; carr[i] = (char)getElement_identity_id(i); } return new String(carr,0,i); } ///////////////////////////////////////////////////////// // Accessor methods for field: msgRate // Field type: int, unsigned // Offset (bits): 152 // Size (bits): 16 ///////////////////////////////////////////////////////// /** * Return whether the field 'msgRate' is signed (false). */ public static boolean isSigned_msgRate() { return false; } /** * Return whether the field 'msgRate' is an array (false). */ public static boolean isArray_msgRate() { return false; } /** * Return the offset (in bytes) of the field 'msgRate' */ public static int offset_msgRate() { return (152 / 8); } /** * Return the offset (in bits) of the field 'msgRate' */ public static int offsetBits_msgRate() { return 152; } /** * Return the value (as a int) of the field 'msgRate' */ public int get_msgRate() { return (int)getUIntElement(offsetBits_msgRate(), 16); } /** * Set the value of the field 'msgRate' */ public void set_msgRate(int value) { setUIntElement(offsetBits_msgRate(), 16, value); } /** * Return the size, in bytes, of the field 'msgRate' */ public static int size_msgRate() { return (16 / 8); } /** * Return the size, in bits, of the field 'msgRate' */ public static int sizeBits_msgRate() { return 16; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -