ledevent.java
来自「tinyos最新版」· Java 代码 · 共 298 行
JAVA
298 行
/** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'LedEvent' * message type. */package net.tinyos.sim.msg;public class LedEvent extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 1; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 64; /** Create a new LedEvent of size 1. */ public LedEvent() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new LedEvent of the given data_length. */ public LedEvent(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new LedEvent with the given data_length * and base offset. */ public LedEvent(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new LedEvent using the given byte array * as backing store. */ public LedEvent(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new LedEvent using the given byte array * as backing store, with the given base offset. */ public LedEvent(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new LedEvent using the given byte array * as backing store, with the given base offset and data length. */ public LedEvent(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new LedEvent embedded in the given message * at the given base offset. */ public LedEvent(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new LedEvent embedded in the given message * at the given base offset and length. */ public LedEvent(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 <LedEvent> \n"; try { s += " [red=0x"+Long.toHexString(get_red())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [green=0x"+Long.toHexString(get_green())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [yellow=0x"+Long.toHexString(get_yellow())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: red // Field type: byte, unsigned // Offset (bits): 0 // Size (bits): 1 ///////////////////////////////////////////////////////// /** * Return whether the field 'red' is signed (false). */ public static boolean isSigned_red() { return false; } /** * Return whether the field 'red' is an array (false). */ public static boolean isArray_red() { return false; } /** * Return the offset (in bytes) of the field 'red' */ public static int offset_red() { return (0 / 8); } /** * Return the offset (in bits) of the field 'red' */ public static int offsetBits_red() { return 0; } /** * Return the value (as a byte) of the field 'red' */ public byte get_red() { return (byte)getUIntElement(offsetBits_red(), 1); } /** * Set the value of the field 'red' */ public void set_red(byte value) { setUIntElement(offsetBits_red(), 1, value); } /** * Return the size, in bytes, of the field 'red' * WARNING: This field is not an even-sized number of bytes (1 bits). */ public static int size_red() { return (1 / 8) + 1; } /** * Return the size, in bits, of the field 'red' */ public static int sizeBits_red() { return 1; } ///////////////////////////////////////////////////////// // Accessor methods for field: green // Field type: byte, unsigned // Offset (bits): 1 // Size (bits): 1 ///////////////////////////////////////////////////////// /** * Return whether the field 'green' is signed (false). */ public static boolean isSigned_green() { return false; } /** * Return whether the field 'green' is an array (false). */ public static boolean isArray_green() { return false; } /** * Return the offset (in bytes) of the field 'green' * WARNING: This field is not byte-aligned (bit offset 1). */ public static int offset_green() { return (1 / 8); } /** * Return the offset (in bits) of the field 'green' */ public static int offsetBits_green() { return 1; } /** * Return the value (as a byte) of the field 'green' */ public byte get_green() { return (byte)getUIntElement(offsetBits_green(), 1); } /** * Set the value of the field 'green' */ public void set_green(byte value) { setUIntElement(offsetBits_green(), 1, value); } /** * Return the size, in bytes, of the field 'green' * WARNING: This field is not an even-sized number of bytes (1 bits). */ public static int size_green() { return (1 / 8) + 1; } /** * Return the size, in bits, of the field 'green' */ public static int sizeBits_green() { return 1; } ///////////////////////////////////////////////////////// // Accessor methods for field: yellow // Field type: byte, unsigned // Offset (bits): 2 // Size (bits): 1 ///////////////////////////////////////////////////////// /** * Return whether the field 'yellow' is signed (false). */ public static boolean isSigned_yellow() { return false; } /** * Return whether the field 'yellow' is an array (false). */ public static boolean isArray_yellow() { return false; } /** * Return the offset (in bytes) of the field 'yellow' * WARNING: This field is not byte-aligned (bit offset 2). */ public static int offset_yellow() { return (2 / 8); } /** * Return the offset (in bits) of the field 'yellow' */ public static int offsetBits_yellow() { return 2; } /** * Return the value (as a byte) of the field 'yellow' */ public byte get_yellow() { return (byte)getUIntElement(offsetBits_yellow(), 1); } /** * Set the value of the field 'yellow' */ public void set_yellow(byte value) { setUIntElement(offsetBits_yellow(), 1, value); } /** * Return the size, in bytes, of the field 'yellow' * WARNING: This field is not an even-sized number of bytes (1 bits). */ public static int size_yellow() { return (1 / 8) + 1; } /** * Return the size, in bits, of the field 'yellow' */ public static int sizeBits_yellow() { return 1; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?