sophware.home.insteon
Class InsteonCommand

java.lang.Object
  extended by sophware.home.io.HomeCommand
      extended by sophware.home.insteon.InsteonCommand
All Implemented Interfaces:
java.io.Serializable, MacroStep

public class InsteonCommand
extends HomeCommand
implements java.io.Serializable

An InsteonCommand is transmitted via a HomeTransmitter to an Insteon device on the home's network.

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

Field Summary
static short CANCEL_LINKING
           
static short RESET_CONTROLLER
           
static long serialVersionUID
           
static short START_LINKING
           
 
Constructor Summary
InsteonCommand(DeviceAddress dest, InsteonCommand groupCommand)
          constructs a cleanup command InsteonCommand
InsteonCommand(DeviceAddress dest, short command)
          constructs a new InsteonCommand
InsteonCommand(DeviceAddress dest, short command, byte[] data)
          constructs a new InsteonCommand
InsteonCommand(DeviceAddress dest, short command, short level)
          constructs a new InsteonCommand
InsteonCommand(DeviceAddress dest, short command, short level, byte[] data)
          constructs a new InsteonCommand
InsteonCommand(short command)
          constructs a new direct PLC InsteonCommand
InsteonCommand(short command, short value)
          constructs a new direct PLC InsteonCommand
 
Method Summary
 int getBytes(byte[] data)
          get the transmission bytes
 short getCommand()
          get the command value
 InsteonAddress getDestination()
          Get destination Address
 InsteonAddress getGroup()
          Get group Address
 short getLevel()
          get the command value
 boolean isGroupCommand()
          Check if group command
 java.lang.String toString()
          string representation of this command
 
Methods inherited from class sophware.home.io.HomeCommand
execute, getListener, getRequestID, setListener, setRequestID
 
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

START_LINKING

public static final short START_LINKING
See Also:
Constant Field Values

CANCEL_LINKING

public static final short CANCEL_LINKING
See Also:
Constant Field Values

RESET_CONTROLLER

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

InsteonCommand

public InsteonCommand(DeviceAddress dest,
                      short command)
constructs a new InsteonCommand

Parameters:
dest - the destination address
command - the command to be sent

InsteonCommand

public InsteonCommand(DeviceAddress dest,
                      InsteonCommand groupCommand)
constructs a cleanup command InsteonCommand

Parameters:
dest - the destination address
groupCommand - the group command to be cleaned up

InsteonCommand

public InsteonCommand(DeviceAddress dest,
                      short command,
                      short level)
constructs a new InsteonCommand

Parameters:
dest - the destination address
command - the command to be sent
level - the desired level 0-100%

InsteonCommand

public InsteonCommand(DeviceAddress dest,
                      short command,
                      byte[] data)
constructs a new InsteonCommand

Parameters:
dest - the destination address
command - the command to be sent
data - the 14 bytes of extended data

InsteonCommand

public InsteonCommand(DeviceAddress dest,
                      short command,
                      short level,
                      byte[] data)
constructs a new InsteonCommand

Parameters:
dest - the destination address
command - the command to be sent
level - the desired level 0-100%
data - the 14 bytes of extended data

InsteonCommand

public InsteonCommand(short command)
constructs a new direct PLC InsteonCommand

Parameters:
command - the direct command

InsteonCommand

public InsteonCommand(short command,
                      short value)
constructs a new direct PLC InsteonCommand

Parameters:
command - the direct command
value - data associated with command
Method Detail

getDestination

public InsteonAddress getDestination()
Get destination Address

Returns:
the destination addresss

getGroup

public InsteonAddress getGroup()
Get group Address

Returns:
the group addresss

isGroupCommand

public boolean isGroupCommand()
Check if group command

Returns:
true/false group command

getCommand

public short getCommand()
get the command value

Returns:
the first command value

getLevel

public short getLevel()
get the command value

Returns:
the second command value

getBytes

public int getBytes(byte[] data)
get the transmission bytes

Specified by:
getBytes in class HomeCommand
Parameters:
data - a data buffer must be at least 20 bytes
Returns:
length of the transmission data

toString

public java.lang.String toString()
string representation of this command

Overrides:
toString in class java.lang.Object
Returns:
the string