com.jpeterson.x10.module
Class CM17AStandardTransmission

java.lang.Object
  |
  +--com.jpeterson.x10.module.CM17AStandardTransmission

public class CM17AStandardTransmission
extends java.lang.Object
implements CM17ATransmissionEvent

Encapsulates the commands to send and then sends them.


Constructor Summary
CM17AStandardTransmission(AddressEvent address, OffEvent event)
           
CM17AStandardTransmission(AddressEvent address, OnEvent event)
          Create
CM17AStandardTransmission(BrightEvent event)
           
CM17AStandardTransmission(DimEvent event)
           
 
Method Summary
protected static byte getDeviceByte(int device)
          Get the byte representing the device code.
protected static byte getHouseByte(char houseCode)
          Get the byte representing the house code.
 void transmit(javax.comm.SerialPort port)
          Transmit this event to the CM17A device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CM17AStandardTransmission

public CM17AStandardTransmission(AddressEvent address,
                                 OnEvent event)
Create

CM17AStandardTransmission

public CM17AStandardTransmission(AddressEvent address,
                                 OffEvent event)

CM17AStandardTransmission

public CM17AStandardTransmission(DimEvent event)

CM17AStandardTransmission

public CM17AStandardTransmission(BrightEvent event)
Method Detail

getHouseByte

protected static byte getHouseByte(char houseCode)
Get the byte representing the house code.
Parameters:
houseCode - The character for the house code; 'A' through 'P', upper case, inclusive.
Throws:
java.lang.IllegalArgumentException - Thrown if the house code is invalid.

getDeviceByte

protected static byte getDeviceByte(int device)
Get the byte representing the device code.
Parameters:
device - The number for the device code; 1 through 16, inclusive.
Throws:
java.lang.IllegalArgumentException - Thrown if the device code is invalid.

transmit

public void transmit(javax.comm.SerialPort port)
Transmit this event to the CM17A device.
Specified by:
transmit in interface CM17ATransmissionEvent
Parameters:
port - Serial port to send the event to.