|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectx10.CM11ASerialController
CM11ASerialController is an X10 Controller that bridges x10 hardware
and software by communicating via a SerialPort with the x10
"CM11A" module.
This class requires the javax.comm package from Sun Microsystems.
| Field Summary | |
static byte |
DATA_POLL
DATA_POLL byte - the x10 "CM11A" protocol DATA_POLL byte. |
static byte |
OK
OK byte - the x10 "CM11A" protocol OK byte. |
static byte |
PC_READY
PC_READY byte - the x10 "CM11A" protocol PC_READY byte. |
static byte |
READY
READY byte - the x10 "CM11A" protocol READY byte. |
static byte |
TIME
TIME byte - the x10 "CM11A" protocol TIME byte. |
static byte |
TIME_POLL
TIME_POLL byte - the x10 "CM11A" protocol TIME_POLL byte. |
| Constructor Summary | |
CM11ASerialController(java.lang.String comport)
CM11ASerialController constructs and starts the Controller on the specified comport. |
|
| Method Summary | |
void |
addCommand(Command command)
addCommand adds a command to the queue to be dispatched. |
void |
addUnitListener(UnitListener listener)
addUnitListener registers the UnitListener for events. |
protected void |
finalize()
finalize disconnects the serial port connection and closes the Controller. |
void |
removeUnitListener(UnitListener listener)
removeUnitListener unregisters the UnitListener for events. |
void |
run()
run is the thread loop that constantly blocks and reads events off of the serial port from the "CM11A" module. |
void |
shutdown(long millis)
shutdown tells the controller to finish all commands in the queue and then gracefully disconnects the serial port connection. |
void |
shutdownNow()
shutdownNow shuts down the controller and closes the serial port immediately. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final byte OK
public static final byte READY
public static final byte TIME
public static final byte TIME_POLL
public static final byte DATA_POLL
public static final byte PC_READY
| Constructor Detail |
public CM11ASerialController(java.lang.String comport)
throws java.io.IOException
comport - the communications port in which the "CM11A"
module is connected.
java.io.IOException - if an error occurs while trying to connect
to the specified Communications Port.| Method Detail |
public void addUnitListener(UnitListener listener)
addUnitListener in interface Controllerlistener - the listener to register for events.UnitEventpublic void removeUnitListener(UnitListener listener)
removeUnitListener in interface Controllerlistener - the listener to remove.public void addCommand(Command command)
addCommand in interface Controllercommand - the Command to be dispatched.protected void finalize()
public void shutdown(long millis)
throws OperationTimedOutException,
java.lang.InterruptedException
millis - the number of milliseconds to wait for a graceful shutdown.
OperationTimedOutException - thrown if the Controller has not
completely shutdown in the amount of time specified.
java.lang.InterruptedException - thrown if the thread is unexpectedly interruptedpublic void shutdownNow()
public void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||