Package jmri.jmrix.powerline.cp290
Class SpecificTrafficController
- java.lang.Object
-
- jmri.jmrix.AbstractMRTrafficController
-
- jmri.jmrix.powerline.SerialTrafficController
-
- jmri.jmrix.powerline.cp290.SpecificTrafficController
-
- All Implemented Interfaces:
SerialInterface
public class SpecificTrafficController extends SerialTrafficController
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, memo
-
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, timeoutFlag, timeouts, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, waitTimePoll, xmtException, xmtRunnable, xmtThread
-
-
Constructor Summary
Constructors Constructor Description SpecificTrafficController(SerialSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
endOfMessage(AbstractMRReply msg)
Decide if a reply have been completely received.(package private) void
formatAndSend(int housecode, int devicemask, X10Sequence.Function c, SerialListener l)
Format a message and send itprotected void
forwardToPort(AbstractMRMessage m, AbstractMRListener reply)
Actually transmit the next message to the port.int
getNumberOfIntensitySteps()
This system provides 16 dim stepsSerialMessage
getSerialMessage(int length)
Get a message of a specific length for filling in.protected AbstractMRReply
newReply()
This is a default, null implementation, which must be overridden in an adapter-specific subclass.void
sendX10Sequence(X10Sequence s, SerialListener l)
Send a sequence of X10 messages(package private) int
setDeviceBit(int devicemask, int device)
Turn a 1-16 device number into a mask bit-
Methods inherited from class jmri.jmrix.powerline.SerialTrafficController
addSerialListener, enterNormalMode, enterProgMode, enterProgModeDelayTime, forwardMessage, forwardReply, getAdapterMemo, getSensorManager, pollMessage, pollReplyHandler, removeSerialListener, sendDmxSequence, sendInsteonSequence, sendSerialMessage, setAdapterMemo, setSensorManager
-
Methods inherited from class jmri.jmrix.AbstractMRTrafficController
addConsoleListener, addHeaderToOutput, addListener, addTrailerToOutput, canReceive, connectionWarn, connectPort, disconnectPort, distributeReply, 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, warnOnTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.powerline.SerialInterface
status
-
-
-
-
Constructor Detail
-
SpecificTrafficController
public SpecificTrafficController(SerialSystemConnectionMemo memo)
-
-
Method Detail
-
sendX10Sequence
public void sendX10Sequence(X10Sequence s, SerialListener l)
Send a sequence of X10 messagesMakes them into the local messages and then queues in order
- Overrides:
sendX10Sequence
in classSerialTrafficController
- Parameters:
s
- sequence to sendl
- listener for reply
-
setDeviceBit
int setDeviceBit(int devicemask, int device)
Turn a 1-16 device number into a mask bit- Parameters:
devicemask
- mask valuedevice
- X10 device code- Returns:
- bit mask for device code
-
formatAndSend
void formatAndSend(int housecode, int devicemask, X10Sequence.Function c, SerialListener l)
Format a message and send it- Parameters:
housecode
- X10 housecode valuedevicemask
- X10 devicemaskc
- X10 cmd codel
- listener
-
getNumberOfIntensitySteps
public int getNumberOfIntensitySteps()
This system provides 16 dim steps- Overrides:
getNumberOfIntensitySteps
in classSerialTrafficController
- Returns:
- By default, dimming not available.
-
getSerialMessage
public SerialMessage getSerialMessage(int length)
Get a message of a specific length for filling in.- Overrides:
getSerialMessage
in classSerialTrafficController
- Parameters:
length
- message size- Returns:
- null
-
forwardToPort
protected void forwardToPort(AbstractMRMessage m, AbstractMRListener reply)
Description copied from class:AbstractMRTrafficController
Actually transmit the next message to the port.- Overrides:
forwardToPort
in classSerialTrafficController
- Parameters:
m
- the message to sendreply
- the Listener sending the message, often provided as 'this'- See Also:
AbstractMRTrafficController.sendMessage(AbstractMRMessage, AbstractMRListener)
-
newReply
protected AbstractMRReply newReply()
Description copied from class:SerialTrafficController
This is a default, null implementation, which must be overridden in an adapter-specific subclass.- Overrides:
newReply
in classSerialTrafficController
-
endOfMessage
protected boolean endOfMessage(AbstractMRReply msg)
Decide if a reply have been completely received.- Overrides:
endOfMessage
in classSerialTrafficController
- Returns:
- true if the reply is complete
-
-