|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.loconet.LnTrafficController
jmri.jmrix.loconet.LnTrafficRouter
public class LnTrafficRouter
Implements a LocoNetInterface by doing a scatter-gather to another, simpler implementation.
This is intended for remote operation, where only one copy of each message should go to/from another node. By putting a LnTrafficRouter implementation at the remote node, all of the routing of messages to multiple consumers can be done without traffic over the connection.
| Field Summary |
|---|
| Fields inherited from class jmri.jmrix.loconet.LnTrafficController |
|---|
listeners, receivedByteCount, receivedMsgCount, self, transmittedMsgCount |
| Fields inherited from interface jmri.jmrix.loconet.LocoNetInterface |
|---|
ALL, POWER, PROGRAMMING, SENSORS, SLOTINFO, TURNOUTS |
| Constructor Summary | |
|---|---|
LnTrafficRouter()
|
|
| Method Summary | |
|---|---|
void |
connect(LocoNetInterface i)
Make connection to existing LocoNetInterface object for upstream communication. |
void |
disconnectPort(LocoNetInterface i)
Break connection to upstream LocoNetInterface object. |
boolean |
isXmtBusy()
Implement abstract method to signal if there's a backlog of information waiting to be sent. |
void |
message(LocoNetMessage m)
Receive a LocoNet message from upstream and forward it to all the local clients. |
void |
sendLocoNetMessage(LocoNetMessage m)
Forward a preformatted LocoNetMessage to the actual interface. |
boolean |
status()
|
| Methods inherited from class jmri.jmrix.loconet.LnTrafficController |
|---|
addLocoNetListener, getReceivedByteCount, getReceivedMsgCount, getTransmittedMsgCount, instance, notify, removeLocoNetListener, resetStatistics |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LnTrafficRouter()
| Method Detail |
|---|
public boolean status()
status in interface LocoNetInterfacestatus in class LnTrafficControllerpublic void sendLocoNetMessage(LocoNetMessage m)
sendLocoNetMessage in interface LocoNetInterfacesendLocoNetMessage in class LnTrafficControllerm - Message to send; will be updated with CRCpublic void message(LocoNetMessage m)
message in interface LocoNetListenerm - The received LocoNet message. Note that this same object
may be presented to multiple users. It should not be
modified here.public void connect(LocoNetInterface i)
i - Interface to be connectedpublic void disconnectPort(LocoNetInterface i)
i - previously connected interfacepublic boolean isXmtBusy()
isXmtBusy in class LnTrafficController
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||