Class RfidTrafficController
- All Implemented Interfaces:
RfidInterface
- Direct Known Subclasses:
ConcentratorTrafficController,StandaloneTrafficController
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.
- Since:
- 2.11.4
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RfidSystemConnectionMemo(package private) boolean(package private) booleanprotected boolean(package private) RfidReporterManager(package private) RfidSensorManager(package private) int(package private) booleanFields inherited from class jmri.jmrix.AbstractMRTrafficController
allowUnexpectedReply, AUTORETRYSTATE, cmdListeners, connectionError, controller, flushReceiveChars, IDLESTATE, istream, listenerQueue, maxRcvExceptionCount, mCurrentMode, mCurrentState, mLastSender, msgQueue, mWaitBeforePoll, NORMALMODE, NOTIFIEDSTATE, OKSENDMSGSTATE, ostream, POLLSTATE, PROGRAMINGMODE, rcvException, rcvThread, replyInDispatch, threadStopRequest, timeoutFlag, timeouts, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, waitTimePoll, xmtException, xmtRunnable, xmtThread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected booleanThis is a default, null implementation, which must be overridden in an adapter-specific subclass.protected AbstractMRMessageSets the system to normal mode during programming while in IDLESTATE.protected AbstractMRMessageSet the system to programming mode.protected voidforwardMessage(AbstractMRListener client, AbstractMRMessage m) Forward a RfidMessage to all registered RfidInterface listeners.protected voidforwardReply(AbstractMRListener client, AbstractMRReply r) Forward a reply to all registered RfidInterface listeners.protected voidforwardToPort(AbstractMRMessage m, AbstractMRListener reply) Actually transmit the next message to the port.getRange()getRfidMessage(int length) Get a message of a specific length for filling in.protected AbstractMRReplynewReply()This is a default, null implementation, which must be overridden in an adapter-specific subclass.protected AbstractMRMessageEventually, do initialization if neededprotected AbstractMRListenervoidabstract voidvoidsendRfidMessage(RfidMessage m, RfidListener reply) Forward a preformatted message to the actual interface.voidvoidvoidMethods inherited from class jmri.jmrix.AbstractMRTrafficController
addConsoleListener, addHeaderToOutput, addListener, addTrailerToOutput, canReceive, connectionWarn, connectPort, disconnectPort, distributeReply, enterProgModeDelayTime, getLastSender, getPortName, getSynchronizeRx, handleOneIncomingReply, handleTimeout, hasTimeouts, lengthOfByteStream, loadChars, newRcvNotifier, notifyMessage, notifyReply, portReadyToSend, portWarn, portWarnTCP, programmerIdle, readByteProtected, receiveLoop, recovery, removeListener, reportReceiveLoopException, resetTimeout, sendMessage, setAllowUnexpectedReply, setSynchronizeRx, status, terminate, terminateThreads, transmitLoop, transmitWait, unexpectedReplyStateError, waitForStartOfReply, warnOnTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrix.rfid.RfidInterface
status
-
Field Details
-
adapterMemo
-
logDebug
-
mSensorManager
-
mReporterManager
-
sendInterlock
boolean sendInterlock -
expectLength
boolean expectLength -
countingBytes
boolean countingBytes -
remainingBytes
int remainingBytes
-
-
Constructor Details
-
RfidTrafficController
public RfidTrafficController()Create a new RfidTrafficController instance.
-
-
Method Details
-
setAdapterMemo
-
getAdapterMemo
-
getRfidMessage
Get a message of a specific length for filling in.This is a default, null implementation, which must be overridden in an adapter-specific subclass.
- Parameters:
length- message length.- Returns:
- the RfidMessage.
-
addRfidListener
- Specified by:
addRfidListenerin interfaceRfidInterface
-
removeRfidListener
- Specified by:
removeRfidListenerin interfaceRfidInterface
-
forwardMessage
Forward a RfidMessage to all registered RfidInterface listeners.- Specified by:
forwardMessagein classAbstractMRTrafficController- Parameters:
client- abstract listener.m- message to forward.
-
forwardReply
Forward a reply to all registered RfidInterface listeners.- Specified by:
forwardReplyin classAbstractMRTrafficController
-
setSensorManager
-
getSensorManager
-
setReporterManager
-
getReporterManager
-
pollMessage
Eventually, do initialization if needed- Specified by:
pollMessagein classAbstractMRTrafficController- Returns:
- Formatted poll message
-
pollReplyHandler
- Specified by:
pollReplyHandlerin classAbstractMRTrafficController
-
sendRfidMessage
Forward a preformatted message to the actual interface.- Specified by:
sendRfidMessagein interfaceRfidInterface
-
forwardToPort
Description copied from class:AbstractMRTrafficControllerActually transmit the next message to the port.- Overrides:
forwardToPortin classAbstractMRTrafficController- Parameters:
m- the message to sendreply- the Listener sending the message, often provided as 'this'- See Also:
-
enterProgMode
Description copied from class:AbstractMRTrafficControllerSet the system to programming mode.- Specified by:
enterProgModein classAbstractMRTrafficController- Returns:
- any message that needs to be returned to the Command Station to change modes. If no message is needed, returns null.
- See Also:
-
enterNormalMode
Description copied from class:AbstractMRTrafficControllerSets the system to normal mode during programming while in IDLESTATE. IfAbstractMRTrafficController.programmerIdle()returns true, enterNormalMode() is called after a timeout.- Specified by:
enterNormalModein classAbstractMRTrafficController- Returns:
- any message that needs to be returned to the Command Station to change modes. If no message is needed, returns null.
- See Also:
-
endOfMessage
This is a default, null implementation, which must be overridden in an adapter-specific subclass.
- Specified by:
endOfMessagein classAbstractMRTrafficController
-
newReply
This is a default, null implementation, which must be overridden in an adapter-specific subclass.
- Specified by:
newReplyin classAbstractMRTrafficController
-
sendInitString
-
getRange
-