Package jmri.jmrix.powerline.simulator
Class SpecificTrafficController
java.lang.Object
jmri.jmrix.AbstractMRTrafficController
jmri.jmrix.powerline.SerialTrafficController
jmri.jmrix.powerline.simulator.SpecificTrafficController
- All Implemented Interfaces:
SerialInterface
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier -
Field Summary
Fields inherited from class jmri.jmrix.powerline.SerialTrafficController
logDebug, memoFields 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 TypeMethodDescriptionprotected booleanThis is a default, null implementation, which must be overridden in an adapter-specific subclass.protected voidforwardToPort(AbstractMRMessage m, AbstractMRListener reply) Actually transmit the next message to the port.getSerialMessage(int length) Get a message of a specific length for filling in.protected voidloadChars(AbstractMRReply msg, DataInputStream istream) Read a stream and pick packets out of it.protected AbstractMRReplynewReply()This is a default, null implementation, which must be overridden in an adapter-specific subclass.voidSend a sequence of Insteon messages.voidSend a sequence of X10 messages.Methods inherited from class jmri.jmrix.powerline.SerialTrafficController
addSerialListener, enterNormalMode, enterProgMode, enterProgModeDelayTime, forwardMessage, forwardReply, getAdapterMemo, getNumberOfIntensitySteps, getSensorManager, pollMessage, pollReplyHandler, removeSerialListener, sendDmxSequence, sendSerialMessage, setAdapterMemo, setSensorManagerMethods inherited from class jmri.jmrix.AbstractMRTrafficController
addConsoleListener, addHeaderToOutput, addListener, addTrailerToOutput, canReceive, connectionWarn, connectPort, disconnectPort, distributeReply, getLastSender, getPortName, getSynchronizeRx, handleOneIncomingReply, handleTimeout, hasTimeouts, lengthOfByteStream, 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.powerline.SerialInterface
status
-
Constructor Details
-
SpecificTrafficController
-
-
Method Details
-
sendX10Sequence
Send a sequence of X10 messages.Makes them into the local messages and then queues in order.
- Overrides:
sendX10Sequencein classSerialTrafficController- Parameters:
s- sequence to sendl- listener for reply
-
sendInsteonSequence
Send a sequence of Insteon messages.Makes them into the local messages and then queues in order.
- Overrides:
sendInsteonSequencein classSerialTrafficController- Parameters:
s- sequence to sendl- listener for reply
-
getSerialMessage
Get a message of a specific length for filling in.- Overrides:
getSerialMessagein classSerialTrafficController- Parameters:
length- message size- Returns:
- null
-
forwardToPort
Description copied from class:AbstractMRTrafficControllerActually transmit the next message to the port.- Overrides:
forwardToPortin classSerialTrafficController- Parameters:
m- the message to sendreply- the Listener sending the message, often provided as 'this'- See Also:
-
newReply
Description copied from class:SerialTrafficControllerThis is a default, null implementation, which must be overridden in an adapter-specific subclass.- Overrides:
newReplyin classSerialTrafficController
-
endOfMessage
Description copied from class:SerialTrafficControllerThis is a default, null implementation, which must be overridden in an adapter-specific subclass.- Overrides:
endOfMessagein classSerialTrafficController
-
loadChars
Read a stream and pick packets out of it. Knows the size of the packets from the contents.- Overrides:
loadCharsin classAbstractMRTrafficController- Parameters:
msg- message to fillistream- character source.- Throws:
IOException- when presented by the input source.
-