jmri.jmrix.zimo
Class Mx1Packetizer
java.lang.Object
jmri.jmrix.zimo.Mx1TrafficController
jmri.jmrix.zimo.Mx1Packetizer
- All Implemented Interfaces:
- Mx1Interface
public class Mx1Packetizer
- extends Mx1TrafficController
Access to Zimo Mx1 messages
via stream-based I/O. The "Mx1Interface" * side sends/receives Mx1Message objects. The connection to
a Mx1PortController is via a pair of *Streams, which then carry sequences
of characters for transmission.
Messages come to this via the main GUI thread, and are forwarded back to
listeners in that same thread. Reception and transmission are handled in
dedicated threads by RcvHandler and XmtHandler objects. Those are internal
classes defined here. The thread priorities are:
- RcvHandler - at highest available priority
- XmtHandler - down one, which is assumed to be above the GUI
- (everything else)
- Author:
- Bob Jacobsen Copyright (C) 2001
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Mx1Packetizer
public Mx1Packetizer(Mx1CommandStation pCommandStation)
status
public boolean status()
- Specified by:
status in interface Mx1Interface- Specified by:
status in class Mx1TrafficController
sendMx1Message
public void sendMx1Message(Mx1Message m,
Mx1Listener reply)
- Forward a preformatted Mx1Message to the actual interface.
End of Message is added here, then the message
is converted to a byte array and queued for transmission
- Specified by:
sendMx1Message in interface Mx1Interface- Specified by:
sendMx1Message in class Mx1TrafficController
- Parameters:
m - Message to send; will be updated with CRC
connectPort
public void connectPort(Mx1PortController p)
- Make connection to existing Mx1PortController object.
- Parameters:
p - Port controller for connected. Save this for a later
disconnect call
disconnectPort
public void disconnectPort(Mx1PortController p)
- Break connection to existing LnPortController object. Once broken,
attempts to send via "message" member will fail.
- Parameters:
p - previously connected port
startThreads
public void startThreads()
- Invoked at startup to start the threads needed here.
Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.
Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: