|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractMRTrafficController
jmri.jmrix.powerline.SerialTrafficController
public class SerialTrafficController
Converts Stream-based I/O to/from messages. The "SerialInterface" side sends/receives message objects.
The connection to a SerialPortController is via a pair of *Streams, which then carry sequences of characters for transmission. Note that this processing is handled in an independent thread.
This maintains a list of nodes, but doesn't currently do anything with it.
This implementation is complete and can be instantiated, but is not functional. It will be created e.g. when a default object is needed for configuring nodes, etc, during the initial configuration. A subclass must be instantiated to actually communicate with an adapter.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController |
|---|
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier |
| Field Summary | |
|---|---|
protected boolean |
logDebug
|
protected static SerialTrafficController |
self
|
| Fields inherited from class jmri.jmrix.AbstractMRTrafficController |
|---|
allowUnexpectedReply, cmdListeners, controller, flushReceiveChars, IDLESTATE, istream, mCurrentMode, mCurrentState, mLastSender, mWaitBeforePoll, NORMALMODE, NOTIFIEDSTATE, OKSENDMSGSTATE, ostream, PROGRAMINGMODE, replyInDispatch, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, xmtRunnable |
| Constructor Summary | |
|---|---|
SerialTrafficController()
|
|
| Method Summary | |
|---|---|
void |
addSerialListener(SerialListener l)
|
static void |
checkInstance(SerialTrafficController tc)
|
void |
deleteSerialNode(int nodeAddress)
Public method to delete a Serial node by node address |
protected boolean |
endOfMessage(AbstractMRReply msg)
This is a default, null implementation, which must be overridden in an adapter-specific subclass. |
protected AbstractMRMessage |
enterNormalMode()
|
protected AbstractMRMessage |
enterProgMode()
|
protected int |
enterProgModeDelayTime()
|
protected void |
forwardMessage(AbstractMRListener client,
AbstractMRMessage m)
Forward a SerialMessage to all registered SerialInterface listeners. |
protected void |
forwardReply(AbstractMRListener client,
AbstractMRReply r)
Forward a reply to all registered SerialInterface listeners. |
protected void |
forwardToPort(AbstractMRMessage m,
AbstractMRListener reply)
Actually transmits the next message to the port |
SerialNode |
getNodeFromAddress(int addr)
Public method to identify a SerialNode from its node address Note: 'addr' is the node address, numbered from 0. |
SerialSensorManager |
getSensorManager()
|
SerialMessage |
getSerialMessage(int length)
Get a message of a specific length for filling in. |
SerialNode |
getSerialNode(int index)
Public method to return the Serial node with a given index Note: To cycle through all nodes, begin with index=0, and increment your index at each call. |
void |
initializeSerialNode(SerialNode node)
Public method to set up for initialization of a Serial node |
protected void |
initNodes()
|
static SerialTrafficController |
instance()
static function returning the SerialTrafficController instance to use. |
int |
maxX10DimStep()
Provide the maximum number of dimming steps available. |
protected AbstractMRReply |
newReply()
This is a default, null implementation, which must be overridden in an adapter-specific subclass. |
protected AbstractMRMessage |
pollMessage()
Eventually, do initialization if needed |
protected AbstractMRListener |
pollReplyHandler()
|
void |
registerSerialNode(SerialNode node)
Public method to register a Serial node |
void |
removeSerialListener(SerialListener l)
|
void |
sendSerialMessage(SerialMessage m,
SerialListener reply)
Forward a preformatted message to the actual interface. |
void |
sendX10Sequence(X10Sequence s,
SerialListener l)
Send a sequence of X10 messages to an adapter. |
protected void |
setInstance()
|
void |
setSensorManager(SerialSensorManager m)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.jmrix.powerline.SerialInterface |
|---|
status |
| Field Detail |
|---|
protected boolean logDebug
protected static SerialTrafficController self
| Constructor Detail |
|---|
public SerialTrafficController()
| Method Detail |
|---|
protected void initNodes()
public void sendX10Sequence(X10Sequence s,
SerialListener l)
Makes them into the local messages and then queues in order.
This is a default, null implementation, which must be overridden in an adapter-specific subclass.
public int maxX10DimStep()
public SerialMessage getSerialMessage(int length)
This is a default, null implementation, which must be overridden in an adapter-specific subclass.
public void registerSerialNode(SerialNode node)
public void initializeSerialNode(SerialNode node)
public SerialNode getNodeFromAddress(int addr)
public void deleteSerialNode(int nodeAddress)
public SerialNode getSerialNode(int index)
public void addSerialListener(SerialListener l)
addSerialListener in interface SerialInterfacepublic void removeSerialListener(SerialListener l)
removeSerialListener in interface SerialInterfaceprotected int enterProgModeDelayTime()
enterProgModeDelayTime in class AbstractMRTrafficController
protected void forwardMessage(AbstractMRListener client,
AbstractMRMessage m)
forwardMessage in class AbstractMRTrafficController
protected void forwardReply(AbstractMRListener client,
AbstractMRReply r)
forwardReply in class AbstractMRTrafficControllerpublic void setSensorManager(SerialSensorManager m)
public SerialSensorManager getSensorManager()
protected AbstractMRMessage pollMessage()
pollMessage in class AbstractMRTrafficControllerprotected AbstractMRListener pollReplyHandler()
pollReplyHandler in class AbstractMRTrafficController
public void sendSerialMessage(SerialMessage m,
SerialListener reply)
sendSerialMessage in interface SerialInterface
protected void forwardToPort(AbstractMRMessage m,
AbstractMRListener reply)
AbstractMRTrafficController
forwardToPort in class AbstractMRTrafficControllerprotected AbstractMRMessage enterProgMode()
enterProgMode in class AbstractMRTrafficControllerprotected AbstractMRMessage enterNormalMode()
enterNormalMode in class AbstractMRTrafficControllerpublic static SerialTrafficController instance()
protected void setInstance()
setInstance in class AbstractMRTrafficControllerpublic static void checkInstance(SerialTrafficController tc)
protected boolean endOfMessage(AbstractMRReply msg)
This is a default, null implementation, which must be overridden in an adapter-specific subclass.
endOfMessage in class AbstractMRTrafficControllerprotected AbstractMRReply newReply()
This is a default, null implementation, which must be overridden in an adapter-specific subclass.
newReply in class AbstractMRTrafficController
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||