|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.micheldalal.x10.CM17A
CM17A is the FireCracker Computer Interface shipped with The FireCracker Ultimate Home Control Kit. This class uses the Java Communications API (COMM) to communicate via the CM17A with the Wireless Link Module(TM) (a.k.a. Transiever Module).
This is an implementation of the FireCracker (CM17A) Communications Specification. The basics of the interface are:
Standby | '1' | Wait | '0' | Wait | '1' | Wait...
_____________________ _____________________
RTS _| |_____|
________ ___________________ ________
DTR _| |_____| |_____|
The recommended time for the '1', '0' and 'Wait' states is at least 0.5ms.
Each transmission consists of 40 bits. This is made up of the following:
Header 16 bits Data 16 bits Footer 8 bits
The header and footer never change and are defined as follows:
Header 11010101 10101010 Footer 10101101
The following table defines the states of the RTS and DTR signals required to send a logical '1' and logical '0' to the interface:
Signal RTS DTR Reset 0 0 Logical '1' 1 0 Logical '0' 0 1 Standby 1 1
| Constructor Summary | |
CM17A()
Creates this object and maintains a reference to the serial port. |
|
CM17A(javax.comm.SerialPort serialPort)
Creates this object and maintains a reference to the serial port. |
|
| Method Summary | |
void |
adjustBrightness(char house,
boolean mode,
int percent)
Dims/brightens the lamp modules in the specified house. |
protected void |
finalize()
Finalizes this object. |
javax.comm.SerialPort |
getSerialPort()
Returns the serial port used for communication. |
void |
setSerialPort(javax.comm.SerialPort serialPort)
Sets the serial port used for communication. |
void |
setState(char house,
int unit,
boolean state)
Turns off/on the specified of the selected house. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CM17A()
public CM17A(javax.comm.SerialPort serialPort)
| Method Detail |
public void setSerialPort(javax.comm.SerialPort serialPort)
serialPort - the serial port object.public javax.comm.SerialPort getSerialPort()
public void setState(char house,
int unit,
boolean state)
throws java.lang.IllegalArgumentException
house - the house to control. 'A' to 'P'.unit - the unit to control. 1 to 16.state - true to turn on and false to turn off.
java.lang.IllegalArgumentException - thrown if the house or unit are within the allowable range.
public void adjustBrightness(char house,
boolean mode,
int percent)
throws java.lang.IllegalArgumentException
house - the house to control. 'A' to 'P'.mode - true to brighten and false to dim.percent - the percentage to change. Changes will occur is 5% increments.
java.lang.IllegalArgumentException - thrown if the house or unit are within the allowable range.
protected void finalize()
throws java.lang.Throwable
java.lang.Throwable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||