|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--serial.SerialX10
The SerialX10 class is designed to control the X10 control devices, which in turn control the X10 modules which govern current from electrical outlets to various devices. Of primary use in the room are the "lamp" modules, which handle enough current to run a halogen lamp, and can even dim the light level to one of 16 settings. The modules are referred to by Housecode and Module numbers. The Housecode is actually a letter setting on the module, ranging from A-P, but in the SerialX10 class it is a byte from 0-15 (0-->A). The module number ranges from 1-16 on the modules themselves, but in the SerialX10 class it is a byte from 0-15 (1-->0). Thus Housecode C, Module 4 can be turned on by calling x10inst.turnOn(2,3); The usage of this class is intended as follows:
x10 = new SerialX10()
x10.open("/dev/whatever")
turnOn(), turnOff(), and dim()
functions.
x10.close()
Constructor Summary | |
SerialX10()
|
Method Summary | |
void |
close()
Closes the port. |
void |
dim(byte housecode,
byte module,
byte dimth)
Sends a "DIM" command to the specified module If it is off, it will turn it on full-way, then dim it down to the proper position (that is a limitation of the X10 API). |
void |
fadeOff(byte housecode,
byte module)
Sends a fade off command to the module. |
void |
fadeOn(byte housecode,
byte module)
Fades it on. |
static void |
main(String[] args)
Used for standalone debugging and hardware tests. |
void |
open(String in_device)
|
void |
turnOff(byte housecode,
byte module)
Sends a directly "OFF" command to the specified module |
void |
turnOn(byte housecode,
byte module)
Sends an "ON" command to the specified module |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SerialX10()
Method Detail |
public void open(String in_device) throws javax.comm.NoSuchPortException, javax.comm.PortInUseException, IOException
in_device
- the name of the serial device to speak to. (e.g. "/dev/ttyrg")public void turnOn(byte housecode, byte module) throws IOException
housecode
- (0-15)module
- (0-15)public void fadeOn(byte housecode, byte module) throws IOException
housecode
- (0-15)module
- (0-15)public void turnOff(byte housecode, byte module) throws IOException
housecode
- (0-15)module
- (0-15)public void fadeOff(byte housecode, byte module) throws IOException
housecode
- (0-15)module
- (0-15)public void dim(byte housecode, byte module, byte dimth) throws IOException
housecode
- (0-15)module
- (0-15)dimth
- (0-15) 0 is dark, 15 is brightpublic void close() throws IOException
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |