Package jmri.jmrix.lenz.liusbethernet
Class LIUSBEthernetXNetPacketizer
java.lang.Object
jmri.jmrix.AbstractMRTrafficController
jmri.jmrix.lenz.XNetTrafficController
jmri.jmrix.lenz.XNetPacketizer
jmri.jmrix.lenz.liusb.LIUSBXNetPacketizer
jmri.jmrix.lenz.liusbethernet.LIUSBEthernetXNetPacketizer
- All Implemented Interfaces:
XNetInterface
public class LIUSBEthernetXNetPacketizer extends LIUSBXNetPacketizer
This is an extension of the XNetPacketizer to handle the device specific
requirements of the LIUSBEthernet.
In particular, LIUSBEthernetXNetPacketizer counts the number of commands received.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier
-
Field Summary
Fields 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, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, waitTimePoll, xmtException, xmtRunnable, xmtThread
Fields inherited from interface jmri.jmrix.lenz.XNetInterface
ALL, COMMINFO, CONSIST, CS_INFO, FEEDBACK, INTERFACE, PROGRAMMING, THROTTLE
-
Constructor Summary
Constructors Constructor Description LIUSBEthernetXNetPacketizer(LenzCommandStation pCommandStation)
-
Method Summary
Modifier and Type Method Description protected int
addHeaderToOutput(byte[] msg, AbstractMRMessage m)
Add header to the outgoing byte stream.protected int
lengthOfByteStream(AbstractMRMessage m)
Determine how much many bytes the entire message will take, including space for header and trailer.protected void
loadChars(AbstractMRReply msg, DataInputStream istream)
Get characters from the input source, and file a message.Methods inherited from class jmri.jmrix.lenz.XNetPacketizer
addTrailerToOutput, portReadyToSend, sendXNetMessage
Methods inherited from class jmri.jmrix.lenz.XNetTrafficController
addXNetListener, connectPort, endOfMessage, enterNormalMode, enterProgMode, forwardMessage, forwardReply, getCommandStation, getFeedbackMessageCache, getSystemConnectionMemo, handleTimeout, newReply, notifyMessage, pollMessage, pollReplyHandler, programmerIdle, removeXNetListener, sendHighPriorityXNetMessage, setSystemConnectionMemo
Methods inherited from class jmri.jmrix.AbstractMRTrafficController
addListener, canReceive, connectionWarn, disconnectPort, distributeReply, enterProgModeDelayTime, finalize, forwardToPort, getLastSender, getPortName, getSynchronizeRx, handleOneIncomingReply, hasTimeouts, newRcvNotifier, notifyReply, portWarn, portWarnTCP, readByteProtected, receiveLoop, recovery, removeListener, reportReceiveLoopException, resetTimeout, sendMessage, setAllowUnexpectedReply, setSynchronizeRx, status, terminate, terminateThreads, transmitLoop, transmitWait, unexpectedReplyStateError, waitForStartOfReply
-
Constructor Details
-
Method Details
-
lengthOfByteStream
Determine how much many bytes the entire message will take, including space for header and trailer.- Overrides:
lengthOfByteStream
in classLIUSBXNetPacketizer
- Parameters:
m
- the message to be sent- Returns:
- number of bytes
-
addHeaderToOutput
Add header to the outgoing byte stream.- Overrides:
addHeaderToOutput
in classLIUSBXNetPacketizer
- Parameters:
msg
- the output byte streamm
- Message results- Returns:
- next location in the stream to fill
-
loadChars
Get characters from the input source, and file a message.Returns only when the message is complete.
Only used in the Receive thread.
- Overrides:
loadChars
in classLIUSBXNetPacketizer
- Parameters:
msg
- message to fillistream
- character source.- Throws:
IOException
- when presented by the input source.
-