Class XNetSensor

All Implemented Interfaces:
Comparable<NamedBean>, EventListener, PropertyChangeProvider, DigitalIO, AbstractMRListener, XNetListener, NamedBean, Sensor

public class XNetSensor extends AbstractSensor implements XNetListener
Extend jmri.AbstractSensor for XpressNet layouts.
  • Field Details

  • Constructor Details

  • Method Details

    • requestUpdateFromLayout

      public void requestUpdateFromLayout()
      Request an update on status by sending an XpressNet message.
      Specified by:
      requestUpdateFromLayout in interface DigitalIO
    • initmessage

      initmessage is a package protected class which allows the Manger to send a feedback message at initialization without changing the state of the sensor with respect to whether or not a feedback request was sent. This is used only when the sensor is created by on layout feedback.
      Parameters:
      l - Reply message
    • message

      public void message(XNetReply l)
      Implementing classes will typically have a function/listener to get updates from the layout, which will then call public void firePropertyChange(String propertyName, Object oldValue, Object newValue) _once_ if anything has changed state (or set the commanded state directly)
      Specified by:
      message in interface XNetListener
      Parameters:
      l - Reply message
    • message

      public void message(XNetMessage l)
      Listen for the messages to the LI100/LI101.
      Specified by:
      message in interface XNetListener
      Parameters:
      l - message to process
    • notifyTimeout

      public void notifyTimeout(XNetMessage msg)
      Handle a timeout notification.
      Specified by:
      notifyTimeout in interface XNetListener
      Parameters:
      msg - The message that timed out
    • getNumber

      int getNumber()
      Package protected routine to get the Sensor Number.
      Returns:
      current Sensor address number
    • getBaseAddress

      Package protected routine to get the Sensor Base Address.
      Returns:
      the Sensor base address
    • getNibble

      int getNibble()
      Package protected routine to get the Sensor Nibble.
      Returns:
      contents of sensor nibble