Interface DCCppInterface

All Known Implementing Classes:
DCCppEthernetPacketizer, DCCppOverTcpPacketizer, DCCppPacketizer, DCCppTrafficController, SerialDCCppPacketizer

public interface DCCppInterface
DCCppInterface defines the general connection to a DCC++ layout.

Use this interface to send messages to a DCC++ layout. Classes implementing the DCCppListener interface can register here to receive incoming DCC++ messages as events.

The jmri.jrmix.dccpp.DCCppTrafficControler provides the first implementation of this interface.

How do you locate an implemenation of this interface? That's an interesting question. This is inherently DCC++ specific, so it would be inappropriate to put it in the jmri.InterfaceManager. And Java interfaces can't have static members, so we can't provide an implementation() member. For now, we use a static implementation member in the DCCppTrafficController implementation to locate _any_ implementation; this clearly needs to be improved.

DCCppListener implementations registering for traffic updates cannot assume that messages will be returned in any particular thread. See the DCCppListener doc for more background.

See Also:
DCCppListener, Based on jmri.jmrix.lenz.XNetInterface
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int ALL
    Mask value to request notification of all incoming messages
    static int COMMINFO
    Mask value to request notification of communications related messages generated by the computer interface
    static int CONSIST
    Mask value to request notification of messages associated with consists
    static int CS_INFO
    Mask value to request notification of Command Station informational messages This includes all broadcast messages, except for the feedback broadcast and all programming messages
    static int FEEDBACK
    Mask value to request notification of FeedBack (i.e. sensor) related messages
    static int INTERFACE
    Mask value to request notification of messages associated with consists
    static int PROGRAMMING
    Mask value to request notification of messages associated with programming
    static int THROTTLE
    Mask value to request notification of messages associated with throttle status
  • Method Summary

    Modifier and Type Method Description
    void addDCCppListener​(int mask, DCCppListener l)
    Request notification of things happening on the DCC++.
    void removeDCCppListener​(int mask, DCCppListener listener)  
    void sendDCCppMessage​(DCCppMessage msg, DCCppListener replyTo)  
    boolean status()