sophware.home.x10
Class X10Command

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

public class X10Command
extends HomeCommand
implements java.io.Serializable

A X10Command is transmitted via a HomeTransmitter to an X10 device on the home's network.

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

Field Summary
static long serialVersionUID
           
 
Constructor Summary
X10Command(DeviceAddress addr, byte[] extData)
          Creates a new extended code X10Command
X10Command(DeviceAddress addr, short function)
          Creates a new X10Command
X10Command(DeviceAddress addr, short function, short dimValue)
          Creates a new X10Command
 
Method Summary
 void addAddress(X10Address addr)
          Add the X10Addresses to this event.
 java.util.Enumeration<X10Address> getAddresses()
          Gets the X10Addresses to for this command.
protected  java.util.Vector<X10Address> getAddressVector()
          Gets the X10Addresses to for this command.
 int getBytes(byte[] buf)
          Gets the bytes associated with this command
 short getDimValue()
          Gets the dim value
 byte[] getExtData(byte[] data)
          Gets the extended data
 short getFunction()
          Gets the function command
 java.lang.String toString()
          Gets the 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
Constructor Detail

X10Command

public X10Command(DeviceAddress addr,
                  short function)
Creates a new X10Command

Parameters:
addr - the DeviceAddress to which this command will be sent
function - the function to send

X10Command

public X10Command(DeviceAddress addr,
                  short function,
                  short dimValue)
Creates a new X10Command

Parameters:
addr - the DeviceAddress to which this command will be sent
function - the commmand to send
dimValue - the data associated with the function

X10Command

public X10Command(DeviceAddress addr,
                  byte[] extData)
Creates a new extended code X10Command

Parameters:
addr - the DeviceAddress to which this command will be sent
extData - the extended data associated with the command
Method Detail

addAddress

public void addAddress(X10Address addr)
Add the X10Addresses to this event.

Parameters:
addr - X10Address

getAddressVector

protected java.util.Vector<X10Address> getAddressVector()
Gets the X10Addresses to for this command.

Returns:
the DeviceAddress

getAddresses

public java.util.Enumeration<X10Address> getAddresses()
Gets the X10Addresses to for this command.

Returns:
the DeviceAddress

getFunction

public short getFunction()
Gets the function command

Returns:
the insteon command number

getDimValue

public short getDimValue()
Gets the dim value

Returns:
the dim value

getExtData

public byte[] getExtData(byte[] data)
Gets the extended data

Parameters:
data - buffer into which the 2 bytes of extended data are copied
Returns:
the extended data buffer or null in no data

getBytes

public int getBytes(byte[] buf)
Gets the bytes associated with this command

Specified by:
getBytes in class HomeCommand
Parameters:
buf - the buffer to be used (for efficiency)
Returns:
the X10 bytes. First byte is length of buffer. Second byte is the command mask.

toString

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

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