Interface LocoNetInterface

    • Field Detail

      • SLOTINFO

        static final int SLOTINFO
        Mask value to request notification of messages effecting slot status, including the programming slot
        See Also:
        Constant Field Values
      • TURNOUTS

        static final int TURNOUTS
        Mask value to request notification of messages indicating changes in turnout status
        See Also:
        Constant Field Values
      • SENSORS

        static final int SENSORS
        Mask value to request notification of messages indicating changes in sensor status
        See Also:
        Constant Field Values
      • POWER

        static final int POWER
        Mask value to request notification of messages associated with layout power
        See Also:
        Constant Field Values
    • Method Detail

      • addLocoNetListener

        void addLocoNetListener​(int mask,
                                LocoNetListener listener)
        Request notification of things happening on the LocoNet.

        The same listener can register multiple times with different masks. (Multiple registrations with a single mask value are equivalent to a single registration) Mask values are defined as class constants. Note that these are bit masks, and should be OR'd, not added, if multiple values are desired.

        The event notification contains the received message as source, not this object, so that we can notify of an incoming message to multiple places and then move on.

        Parameters:
        mask - The OR of the key values of messages to be reported (to reduce traffic, provide for listeners interested in different things)
        listener - Object to be notified of new messages as they arrive.
      • status

        boolean status()
        Check whether an implementation is operational. Returns true if operational.
        Returns:
        true if implementation is operational.