sophware.home.insteon
Class InsteonEvent

java.lang.Object
  extended by sophware.home.io.HomeEvent
      extended by sophware.home.insteon.InsteonEvent
All Implemented Interfaces:
java.io.Serializable

public class InsteonEvent
extends HomeEvent
implements java.io.Serializable

The InsteonEvent represents an event on one of the Home's Insteon devices.

Version:
1.0, 03/19/07
Author:
Russell Soph
See Also:
Serialized Form

Field Summary
static short BRIGHT
           
static short BROADCAST_MSG
           
static short CURRENT_STATUS
           
static short DIM
           
static short FAST_OFF
           
static short FAST_ON
           
static short GRP_BROADCAST_MSG
           
static short GRP_CLEANUP_ACK_MSG
           
static short GRP_CLEANUP_MSG
           
static short OFF
           
static short ON
           
static short P2P_ACK_MSG
           
static short P2P_MSG
          Message types
static short P2P_NACK_MSG
           
static short PING
           
static short READ_LAST_LEVEL
           
static short READ_PRESET_LEVEL
           
static long serialVersionUID
           
static short SET_LAST_LEVEL
           
static short SET_PRESET_LEVEL
           
static short SIMULATED_EVENT
           
static short START_MANUAL_CHANGE
           
static short STATUS_REPORT
           
static short STATUS_REQUEST
           
static short STOP_MANUAL_CHANGE
           
 
Constructor Summary
protected InsteonEvent(byte[] msg)
          Instantiates an InsteonEvent
protected InsteonEvent(byte[] msg, int start)
          Instantiates an InsteonEvent
 
Method Summary
 InsteonAddress getAddress()
          Gets the from InsteonAddress for this event
 byte getCommand1()
          Gets the command for this event
 byte getCommand2()
          Gets the value associated with this command
static java.lang.String getCommandName(short command)
          Get command name
 float getDeviceRevision()
          If broadcast id will return device type.
 short getDeviceType()
          If broadcast id will return device type.
 byte getFlags()
          Gets the raw flags associated with this command
 short getHopsLeft()
          Gets the hops left (retransmissions)
 short getMaxHops()
          Gets the maximum hops (retransmissions)
 short getMessageType()
          Gets the message type 0 - direct message (binary 000) 1 - ACK of direct message (binary 001) 2 - group cleanup direct message (binary 010) 3 - ACK group cleanup direct message (binary 011) 4 - broadcast message (binary 100) 5 - NAK of direct message (binary 101) 6 - group broadcast (binary 110) 7 - NAK of group cleanup direct message (binary 111)
 byte[] getUserData()
          Gets the extended data associated with this command
 boolean isBroadcastID()
          True if this event is broadccast ID
 boolean isExtended()
          Tests to see if this is an extended message
 java.lang.String toString()
          String representation of this event
 
Methods inherited from class sophware.home.io.HomeEvent
getDate, getEventHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

SIMULATED_EVENT

public static final short SIMULATED_EVENT
See Also:
Constant Field Values

PING

public static final short PING
See Also:
Constant Field Values

ON

public static final short ON
See Also:
Constant Field Values

FAST_ON

public static final short FAST_ON
See Also:
Constant Field Values

OFF

public static final short OFF
See Also:
Constant Field Values

FAST_OFF

public static final short FAST_OFF
See Also:
Constant Field Values

BRIGHT

public static final short BRIGHT
See Also:
Constant Field Values

DIM

public static final short DIM
See Also:
Constant Field Values

START_MANUAL_CHANGE

public static final short START_MANUAL_CHANGE
See Also:
Constant Field Values

STOP_MANUAL_CHANGE

public static final short STOP_MANUAL_CHANGE
See Also:
Constant Field Values

STATUS_REQUEST

public static final short STATUS_REQUEST
See Also:
Constant Field Values

STATUS_REPORT

public static final short STATUS_REPORT
See Also:
Constant Field Values

READ_LAST_LEVEL

public static final short READ_LAST_LEVEL
See Also:
Constant Field Values

SET_LAST_LEVEL

public static final short SET_LAST_LEVEL
See Also:
Constant Field Values

READ_PRESET_LEVEL

public static final short READ_PRESET_LEVEL
See Also:
Constant Field Values

SET_PRESET_LEVEL

public static final short SET_PRESET_LEVEL
See Also:
Constant Field Values

CURRENT_STATUS

public static final short CURRENT_STATUS
See Also:
Constant Field Values

P2P_MSG

public static final short P2P_MSG
Message types

See Also:
Constant Field Values

P2P_ACK_MSG

public static final short P2P_ACK_MSG
See Also:
Constant Field Values

GRP_CLEANUP_MSG

public static final short GRP_CLEANUP_MSG
See Also:
Constant Field Values

GRP_CLEANUP_ACK_MSG

public static final short GRP_CLEANUP_ACK_MSG
See Also:
Constant Field Values

BROADCAST_MSG

public static final short BROADCAST_MSG
See Also:
Constant Field Values

P2P_NACK_MSG

public static final short P2P_NACK_MSG
See Also:
Constant Field Values

GRP_BROADCAST_MSG

public static final short GRP_BROADCAST_MSG
See Also:
Constant Field Values
Constructor Detail

InsteonEvent

protected InsteonEvent(byte[] msg)
                throws HomeException
Instantiates an InsteonEvent

Parameters:
msg - the message buffer
Throws:
HomeException

InsteonEvent

protected InsteonEvent(byte[] msg,
                       int start)
                throws HomeException
Instantiates an InsteonEvent

Parameters:
msg - the message buffer
Throws:
HomeException
Method Detail

getAddress

public InsteonAddress getAddress()
Gets the from InsteonAddress for this event

Returns:
the address from which this event originated

getCommand1

public byte getCommand1()
Gets the command for this event

Returns:
the command represented in this event

getCommand2

public byte getCommand2()
Gets the value associated with this command

Returns:
the value associated with this command

getMessageType

public short getMessageType()
Gets the message type 0 - direct message (binary 000) 1 - ACK of direct message (binary 001) 2 - group cleanup direct message (binary 010) 3 - ACK group cleanup direct message (binary 011) 4 - broadcast message (binary 100) 5 - NAK of direct message (binary 101) 6 - group broadcast (binary 110) 7 - NAK of group cleanup direct message (binary 111)

Returns:
the message type

isExtended

public boolean isExtended()
Tests to see if this is an extended message

Returns:
is this message and extended message

getHopsLeft

public short getHopsLeft()
Gets the hops left (retransmissions)

Returns:
hops left (0-3)

getMaxHops

public short getMaxHops()
Gets the maximum hops (retransmissions)

Returns:
maximum hops (0-3)

getFlags

public byte getFlags()
Gets the raw flags associated with this command

Returns:
the flags associated with this command

getUserData

public byte[] getUserData()
Gets the extended data associated with this command

Returns:
the extended data

isBroadcastID

public boolean isBroadcastID()
True if this event is broadccast ID

Returns:
true/false broadcast id

getDeviceType

public short getDeviceType()
If broadcast id will return device type. Otherwise it will throw an IllegalStateException

Returns:
the device type

getDeviceRevision

public float getDeviceRevision()
If broadcast id will return device type. Otherwise it will throw an IllegalStateException

Returns:
the device revision

getCommandName

public static java.lang.String getCommandName(short command)
Get command name

Returns:
name of the commmand

toString

public java.lang.String toString()
String representation of this event

Overrides:
toString in class java.lang.Object
Returns:
the String representing this event