|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread lejos.nxt.comm.LCPResponder
public class LCPResponder
Support for LCP commands
Field Summary | |
---|---|
protected NXTConnection |
conn
|
protected NXTCommConnector |
connector
|
protected boolean |
running
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
LCPResponder(NXTCommConnector connector)
Create a Responder using the provided connector The connector is used to create the listening connection used to accept remote commands. |
Method Summary | |
---|---|
protected int |
command(byte[] inMsg,
int len,
byte[] reply)
Process the actual command Default action is to call the LCP object to emulate the command |
protected void |
disconnect()
Method called to disconnect the responder connect. |
protected void |
postCommand(byte[] inMsg,
int inLen,
byte[] replyMsg,
int replyLen)
|
protected int |
preCommand(byte[] inMsg,
int len)
Method called with a newly read command, before it is processed. |
void |
run()
When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread. |
void |
shutdown()
Terminate the responder. |
protected void |
waitConnect()
Method called when the responder is waiting for a new connection. |
Methods inherited from class java.lang.Thread |
---|
currentThread, getPriority, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, setDaemon, setPriority, sleep, start, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NXTCommConnector connector
protected NXTConnection conn
protected boolean running
Constructor Detail |
---|
public LCPResponder(NXTCommConnector connector)
connector
- Method Detail |
---|
protected void waitConnect()
protected void disconnect()
protected int preCommand(byte[] inMsg, int len)
inMsg
- Newly read commandlen
- length of the command
protected int command(byte[] inMsg, int len, byte[] reply)
inMsg
- The command byteslen
- length of the commandreply
- bytes to send back in response to the command
protected void postCommand(byte[] inMsg, int inLen, byte[] replyMsg, int replyLen)
public void run()
Runnable
Runnable
is used
to create a thread, starting the thread causes the object's
run
method to be called in that separately executing
thread.
run
in interface Runnable
run
in class Thread
public void shutdown()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |