Package jmri.jmrix.mrc
Class MrcTrafficController
java.lang.Object
jmri.jmrix.mrc.MrcTrafficController
- All Implemented Interfaces:
MrcInterface
- Direct Known Subclasses:
MrcPacketizer
Converts Stream-based I/O to/from MRC messages. The "MrcInterface" side
sends/receives message objects.
The connection to a MrcPortController 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 handles the state transitions, based on the necessary state in each message.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) MrcSystemConnectionMemo(package private) intprotected intprotected intprotected Vector<MrcTrafficListenerFilter>protected intFields inherited from interface jmri.jmrix.mrc.MrcInterface
ALL, CLOCK, POLL, POWER, PROGRAMMING, SENSORS, THROTTLEINFO, TURNOUTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTrafficListener(int mask, MrcTrafficListener l) voidchangeTrafficListener(int mask, MrcTrafficListener l) intintMonitor the number of bytes in MRC messaages received across the interface.intMonitor the number of MRC messaages received across the interface.intMonitor the number of MRC messages transmitted across the interface.abstract booleanIs there a backlog of information for the outbound link?voidnotifyRcv(Date timestamp, MrcMessage m) voidnotifyXmit(Date timestamp, MrcMessage m) voidremoveTrafficListener(int mask, MrcTrafficListener l) voidReset statistics (received message count, transmitted message count, received byte count).abstract voidvoidvoidsetCabNumber(int x) abstract booleanstatus()
-
Field Details
-
cabAddress
int cabAddress -
trafficListeners
-
receivedMsgCount
-
receivedByteCount
-
transmittedMsgCount
-
adaptermemo
-
-
Constructor Details
-
MrcTrafficController
public MrcTrafficController()Create a new MrcTrafficController instance. Simple implementation.
-
-
Method Details
-
setCabNumber
-
getCabNumber
-
status
- Specified by:
statusin interfaceMrcInterface
-
sendMrcMessage
- Specified by:
sendMrcMessagein interfaceMrcInterface
-
addTrafficListener
- Specified by:
addTrafficListenerin interfaceMrcInterface
-
removeTrafficListener
- Specified by:
removeTrafficListenerin interfaceMrcInterface
-
changeTrafficListener
- Specified by:
changeTrafficListenerin interfaceMrcInterface
-
notifyRcv
-
notifyXmit
-
isXmtBusy
Is there a backlog of information for the outbound link? This includes both in the program (e.g. the outbound queue) and in the command station interface (e.g. flow control from the port).- Returns:
- true if busy, false if nothing waiting to send
-
resetStatistics
Reset statistics (received message count, transmitted message count, received byte count). -
getReceivedMsgCount
Monitor the number of MRC messaages received across the interface. This includes the messages this client has sent.- Returns:
- count of messages received
-
getReceivedByteCount
Monitor the number of bytes in MRC messaages received across the interface. This includes the messages this client has sent.- Returns:
- count of bytes in received messages
-
getTransmittedMsgCount
Monitor the number of MRC messages transmitted across the interface.- Returns:
- count of messages sent
-
getAdapterMemo
-
setAdapterMemo
-
getUserName
-
getSystemPrefix
-