|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--serial.Serial | +--serial.TwoWayX10
This is a software controller for the TwoWay X10 controller device.
Serial
Fields inherited from class serial.Serial |
answerTimeout,
cancelEcho,
device,
listener,
semaphore,
serial,
serial_in,
serial_out,
timeout_wait,
waitingForResponse |
Constructor Summary | |
TwoWayX10()
|
Method Summary | |
boolean |
brightenBy(char house,
int module,
int delta)
|
boolean |
brightenBy(int delta)
|
boolean |
brightenTo(char house,
int module,
int level)
|
boolean |
brightenTo(int level)
|
boolean |
dimBy(char house,
int module,
int delta)
Applies only to devices connected to lamp modules. |
boolean |
dimBy(int delta)
|
boolean |
dimTo(char house,
int module,
int level)
Dims a lamp connected to a lamp module to level specified in argument level. |
boolean |
dimTo(int level)
|
static Serial |
getNewInstance()
This method is here so that children of this class can override it so that main() calls appropriate constructor |
boolean |
issueCommand(String cmd)
|
boolean |
issueCommand(String cmd,
int tryCnt)
Internal tool for sending X10 commands (exposed for debugging) |
void |
open(String in_device)
Opens connection to an X10 controller on a given port and sets default X10 parameters for that port |
boolean |
selectDevice(char house,
int module)
After calling this method all action methods without house/module code inputs will refer to the device you select here. |
boolean |
selectDevice(X10Data dev)
|
boolean |
selectDevices(Vector devs)
Similar to selectDevice except that it lets you select several devices at once. |
boolean |
turnOff()
|
boolean |
turnOff(char house,
int module)
|
boolean |
turnOn()
Turns on selected device |
boolean |
turnOn(char house,
int module)
Calls select device and then turnOn |
Methods inherited from class serial.Serial |
addEventListener,
close,
main,
open,
open,
openNoParams,
processSerialEvent,
read,
readBytes,
readString,
ready,
send,
send,
sendSynch,
sendSynch,
sendSynch,
serialEvent,
setFlowControlMode |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TwoWayX10()
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. Uses standard port settings. (e.g. "/dev/term/ttyrg" DONT
FORGET ABOUT TERM)public boolean issueCommand(String cmd, int tryCnt)
cmd
- command to be senttryCnt
- how many attempts to make in case there are
problemspublic boolean issueCommand(String cmd)
public boolean selectDevice(char house, int module)
house
- house code as char (i.e. 'a' or 'E', ...)public boolean selectDevice(X10Data dev)
selectDevice(char, int)
public boolean selectDevices(Vector devs)
devs
- a vector of X10Data objectsX10Data
public boolean turnOn(char house, int module)
public boolean turnOn()
public boolean turnOff(char house, int module)
public boolean turnOff()
public boolean dimBy(char house, int module, int delta)
public boolean dimBy(int delta)
public boolean dimTo(char house, int module, int level)
public boolean dimTo(int level)
public boolean brightenBy(char house, int module, int delta)
dimBy(char, int, int)
public boolean brightenBy(int delta)
public boolean brightenTo(char house, int module, int level)
dimTo(char, int, int)
public boolean brightenTo(int level)
public static Serial getNewInstance()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |