|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--serial.Serial | +--serial.LynX10
This is a software controller for the LynX10 coprocessor device
Serial
Fields inherited from class serial.Serial |
answerTimeout,
cancelEcho,
device,
listener,
semaphore,
serial,
serial_in,
serial_out,
timeout_wait,
waitingForResponse |
Constructor Summary | |
LynX10()
|
Method Summary | |
boolean |
brightenBy(char house,
int module,
int delta)
|
boolean |
brightenTo(char house,
int module,
int level)
There is no difference between dimTo and brightenTo with this controller |
boolean |
dimBy(char house,
int module,
int delta)
Applies only to devices connected to lamp modules. |
boolean |
dimTo(char house,
int module,
int level)
Dims a lamp connected to a lamp module to level specified in argument level. |
protected String |
encodeDevice(char house,
int module)
|
protected String |
encodeHouse(char house)
Takes a house code (like a, b, C ...) and converts it into internal LynX10 encoding |
protected String |
encodeLevel(int level)
|
protected String |
encodeModule(int module)
|
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 |
protected boolean |
relativeChange(boolean dim,
char house,
int delta)
Uses raw X10 codes to dim (if dim=true)/brighten a preselected device by delta |
protected boolean |
selectDevice(char house,
int module)
Selects the device to be talked to for the next raw X10 command (used here by dimBy and brightenBy methods) |
boolean |
turnOff(char house,
int module)
|
boolean |
turnOn(char house,
int module)
turns on specified device |
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 LynX10()
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)
protected String encodeHouse(char house)
protected String encodeModule(int module)
protected String encodeLevel(int level)
protected String encodeDevice(char house, int module)
public boolean turnOn(char house, int module)
public boolean turnOff(char house, int module)
protected boolean selectDevice(char house, int module)
public boolean dimBy(char house, int module, int delta)
protected boolean relativeChange(boolean dim, char house, int delta)
public boolean dimTo(char house, int module, int level)
public boolean brightenBy(char house, int module, int delta)
dimBy(char, int, int)
public boolean brightenTo(char house, int module, int level)
public static Serial getNewInstance()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |