Class LnIPLImplementation

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
jmri.jmrix.loconet.duplexgroup.swing.LnIPLImplementation
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, LocoNetListener

public class LnIPLImplementation extends JComponent implements LocoNetListener
Implements a class to handle message creation and message interpretation of LocoNet messages associated with IPL. IPL is a mechanism which allows identification and firmware programming of some types of Digitrax hardware.
See Also:
  • Field Details

  • Constructor Details

    • LnIPLImplementation

      Constructor for LnIPMImplementation for a given LocoNetSystemConnectionMemo as provided by the instantiating method.
      Parameters:
      lnMemo - LocoNetSystemConnectionMemo for the LocoNet communication interface
  • Method Details

    • createQueryAllIplDevicesPacket

      Create a LocoNet packet which queries UR92(s) for Duplex group identification information. The invoking method is responsible for sending the message to LocoNet.
      Returns:
      a LocoNetMessage containing the packet required to query UR92 device Duplex Group Identity information
    • sendIplQueryAllDevices

      public void sendIplQueryAllDevices()
    • createIplSpecificHostQueryPacket

      public static final LocoNetMessage createIplSpecificHostQueryPacket(Integer hostMfr, Integer hostDevice)
      Create a LocoNet packet which queries IPL devices by specific host manufacturer and specific host device type. The invoking method is responsible for sending the message to LocoNet.

      Note: Different devices may only respond to IPL Identity requests if the host manufacturer and host type are defined. Others devices will respond when host manufacturer and host type are left as zero.

      Parameters:
      hostMfr - the host manufacturer number
      hostDevice - the host device type number
      Returns:
      a LocoNetMessage containing the packet required to request IPL identity information from devices of the specified host manufacturer and host device type.
    • createIplSpecificSlaveQueryPacket

      public static final LocoNetMessage createIplSpecificSlaveQueryPacket(Integer slaveMfr, Integer slaveDevice)
      Create a LocoNet packet which queries IPL devices by specific slave manufacturer and specific slave device type. The invoking method is responsible for sending the message to LocoNet.

      Note: Some devices have no "slave" device and may not respond to this message. Other devices may only respond if both manufacturer and device type information is specified for both host and slave.

      Parameters:
      slaveMfr - the slave manufacturer number
      slaveDevice - the slave device type number
      Returns:
      a LocoNetMessage containing the packet required to request IPL identity information from devices of the specified slave manufacturer and slave device type.
    • createIplSpecificSlaveQueryPacket

      public static final LocoNetMessage createIplSpecificSlaveQueryPacket(Integer hostMfr, Integer hostDevice, Integer slaveMfr, Integer slaveDevice)
      Create a LocoNet packet which queries IPL devices by specific host manufacturer, specific host device type, specific slave manufacturer and specific slave device type. The invoking method is responsible for sending the message to LocoNet.

      Note: Different devices respond differently depending on whether host and/or slave manufacturer and/or device type information are provided.

      Parameters:
      hostMfr - the host manufacturer number
      hostDevice - the host device type number
      slaveMfr - the slave manufacturer number
      slaveDevice - the slave device type number
      Returns:
      a LocoNetMessage containing the packet required to request IPL identity information from devices of the specified host and slave manufacturers and host and slave device types.
    • createIplUr92QueryPacket

      Create a LocoNet packet which queries UR92 devices for IPL identification information. The invoking method is responsible for sending the message to LocoNet.
      Returns:
      a LocoNetMessage containing the packet required to query UR92 devices for IPL identification information
    • createIplDt402QueryPacket

      Create a LocoNet packet which queries DT402x throttles for IPL identification information. The invoking method is responsible for sending the message to LocoNet.
      Returns:
      a LocoNetMessage containing the packet required to query DT402x devices for IPL identification information
    • createIplUt4QueryPacket

      public static final LocoNetMessage createIplUt4QueryPacket()
      Create a LocoNet packet which queries (some) UT4 throttles for IPL identification information. The invoking method is responsible for sending the message to LocoNet.

      Note that UT4 and UT4R devices may not respond to this query. UT4D devices may respond to this query.

      Returns:
      a LocoNetMessage containing the packet required to query (some) UT4 devices for IPL identification information
    • createIplDcs51QueryPacket

      Create a LocoNet packet which queries DCS51 devices for IPL identification information. The invoking method is responsible for sending the message to LocoNet.
      Returns:
      a LocoNetMessage containing the packet required to query DCS51 devices for IPL identification information
    • createIplDcs52QueryPacket

      Create a LocoNet packet which queries DCS52 devices for IPL identification information. The invoking method is responsible for sending the message to LocoNet.
      Returns:
      a LocoNetMessage containing the packet required to query DCS52 devices for IPL identification information
    • createIplPr3QueryPacket

      public static final LocoNetMessage createIplPr3QueryPacket()
      Create a LocoNet packet which queries PR3 devices for IPL identification information. The invoking method is responsible for sending the message to LocoNet.
      Returns:
      a LocoNetMessage containing the packet required to query PR3 devices for IPL identification information
    • isIplIdentityQueryMessage

      public static final boolean isIplIdentityQueryMessage(LocoNetMessage m)
      Checks message m to determine if it contains a IPL Identity Report message.
      Parameters:
      m - LocoNetMessage to be checked for an IPL Identity Query message
      Returns:
      true if message is report of IPL Identity
    • isIplIdentityReportMessage

      public static final boolean isIplIdentityReportMessage(LocoNetMessage m)
      Checks message m to determine if it contains a IPL Identity Report message.
      Parameters:
      m - LocoNet message to check for an IPL Identity Report
      Returns:
      true if message is report of IPL Identity
    • isIplSpecificIdentityReportMessage

      public static final boolean isIplSpecificIdentityReportMessage(LocoNetMessage m, Integer hostMfr, Integer hostDevice)
      Check message m to determine if it contains an IPL Identity Report message for a specific host manufacturer and specific host device type.
      Parameters:
      m - message to analyse
      hostMfr - the host manufacturer number
      hostDevice - the host device type number
      Returns:
      true if message is report of UR92 IPL Identity
    • isIplUr92IdentityReportMessage

      public static final boolean isIplUr92IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a UR92 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of UR92 IPL Identity
    • isIplDt402IdentityReportMessage

      public static final boolean isIplDt402IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a DT402 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of DT402 IPL Identity
    • isIplUt4IdentityReportMessage

      public static final boolean isIplUt4IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a UT4 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of UT4 IPL Identity
    • isIplDcs51IdentityReportMessage

      public static final boolean isIplDcs51IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a DSC51 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of DCS51 IPL Identity
    • isIplDcs52IdentityReportMessage

      public static final boolean isIplDcs52IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a DSC52 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of DCS52 IPL Identity
    • isIplUr93IdentityReportMessage

      public static final boolean isIplUr93IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a UR93 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of UR92 IPL Identity
    • isIplPr3IdentityReportMessage

      public static final boolean isIplPr3IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a PR3 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of PR3 IPL Identity
    • isIplDt402DIdentityReportMessage

      public static final boolean isIplDt402DIdentityReportMessage(LocoNetMessage m)
    • isIplUt4DIdentityReportMessage

      public static final boolean isIplUt4DIdentityReportMessage(LocoNetMessage m)
    • isIplPr4IdentityReportMessage

      public static final boolean isIplPr4IdentityReportMessage(LocoNetMessage m)
    • isIplBxp88IdentityReportMessage

      public static final boolean isIplBxp88IdentityReportMessage(LocoNetMessage m)
    • isIplLnwiIdentityReportMessage

      public static final boolean isIplLnwiIdentityReportMessage(LocoNetMessage m)
    • isIplDcs240IdentityReportMessage

      public static final boolean isIplDcs240IdentityReportMessage(LocoNetMessage m)
    • isIplDcs210IdentityReportMessage

      public static final boolean isIplDcs210IdentityReportMessage(LocoNetMessage m)
    • isIplDcs210PlusIdentityReportMessage

      public static final boolean isIplDcs210PlusIdentityReportMessage(LocoNetMessage m)
    • isIplDcs240PlusIdentityReportMessage

      public static final boolean isIplDcs240PlusIdentityReportMessage(LocoNetMessage m)
    • isIplDt500DIdentityReportMessage

      public static final boolean isIplDt500DIdentityReportMessage(LocoNetMessage m)
    • isIplDt500IdentityReportMessage

      public static final boolean isIplDt500IdentityReportMessage(LocoNetMessage m)
      Check message m to determine if it contains a DT500 IPL Identity Report message.
      Parameters:
      m - message to analyse
      Returns:
      true if message is report of DT500 IPL Identity
    • extractInterpretedIplHostDevice

      Extract the IPL Host manufacturer and Device information from m and return the interpreted information as a String.
      Parameters:
      m - LocoNet Message containg the IPL Identity report
      Returns:
      String containing the interpreted IPL Host Manufacturer and Device. If m is not a valid IPL Identity report, returns null.
    • extractInterpretedIplSlaveDevice

      Extract the IPL Slave manufacturer and Device information from m.
      Parameters:
      m - IPL Identity message
      Returns:
      String containing the interpreted IPL Slave Manufacturer and Device. If m is not a valid IPL Identity report, returns null.
    • extractIplIdentityHostManufacturer

      Get the IPL host manufacturer number from an IPL Identity report message.

      The invoking method should ensure that message m is an IPL Identity message before invoking this method.

      Parameters:
      m - IPL Identity message
      Returns:
      Integer containing the IPL host manufacturer number
    • extractIplIdentityHostDevice

      Get the host device number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method.

      Parameters:
      m - IPL Identity message
      Returns:
      Integer containing the IPL device number
    • extractIplIdentitySlaveManufacturer

      Get the slave manufacturer number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method.

      NOTE: Not all IPL-capable devices implement a slave manufacturer number.

      Parameters:
      m - IPL Identity message
      Returns:
      Integer containing the IPL slave manufacturer number
    • extractIplIdentitySlaveDevice

      Get the slave device number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method.

      NOTE: Not all IPL-capable devices implement a slave device number.

      Parameters:
      m - IPL Identity message
      Returns:
      Integer containing the IPL slave device number
    • extractIplIdentityHostFrimwareRev

      Get the host firmware revision number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method.

      NOTE: Not all IPL-capable devices implement a host firmware revision number.

      Parameters:
      m - IPL Identity message
      Returns:
      String containing the IPL host firmware revision in the format x.y
    • extractIplIdentityHostFrimwareRevNum

      Get the host firmware revision number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method..

      NOTE: Not all IPL-capable devices implement a host firmware revision number.

      Parameters:
      m - IPL Identity message
      Returns:
      Integer containing the IPL host firmware revision
    • extractIplIdentitySlaveFrimwareRevNum

      Get the Slave firmware revision number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method..

      NOTE: Not all IPL-capable devices implement a Slave firmware revision number.

      Parameters:
      m - IPL Identity message
      Returns:
      Integer containing the IPL Slave firmware revision
    • extractIplIdentitySlaveFrimwareRev

      Get the slave firmware revision number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method..

      NOTE: Not all IPL-capable devices implement a slave firmware revision number.

      Parameters:
      m - IPL Identity message
      Returns:
      String containing the IPL slave firmware revision in the format x.y
    • extractIplIdentityHostSerialNumber

      Get the host serial number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method..

      NOTE: Not all IPL-capable devices implement a host serial number.

      Parameters:
      m - IPL Identity message
      Returns:
      Long containing the IPL host serial number
    • extractIplIdentitySlaveSerialNumber

      Get the slave serial number from an IPL Identity report message.

      The invoking method should ensure that message m is is an IPL Identity message before invoking this method.

      NOTE: Not all IPL-capable devices implement a slave serial number.

      Parameters:
      m - IPL Identity message
      Returns:
      Long containing the IPL slave serial number
    • interpretHostManufacturerDevice

      public static final String interpretHostManufacturerDevice(Integer hostMfr, Integer hostDevice, Integer slaveMfr, Integer slaveDevice)
      Interpret IPL Identity Host Manufacturer and Host Device number as a string.

      NOTE: Some IPL-capable devices cannot be completely determined based solely on Host Manufacturer number and Host Device number.

      NOTE: Some members of a device family do not support IPL. An interpreted IPL Host Manufacturer number and Host Device number might imply that all members do support IPL. As an example, UT4 and UT4R devices do not appear to support IPL, while UT4D appears to support IPL. This method will return "Digitrax UT4(x)" in response to appropriate Host Manufacturer number and appropriate Host Device number.

      Parameters:
      hostMfr - host manufacturer number
      hostDevice - host device number
      slaveMfr - slave manufacturer number
      slaveDevice - slave device number
      Returns:
      String containing Manufacturer name and Device model.
    • interpretHostManufacturerDevice

      public static final String interpretHostManufacturerDevice(Integer hostMfr, Integer hostDevice)
      Interpret IPL Identity Host Manufacturer and Host Device number as a string.

      NOTE: Some IPL-capable devices cannot be completely determined based solely on Host Manufacturer number and Host Device number.

      NOTE: Some members of a device family do not support IPL. An interpreted IPL Host Manufacturer number and Host Device number might imply that all members do support IPL. As an example, UT4 and UT4R devices do not appear to support IPL, while UT4D appears to support IPL. This method will return "Digitrax UT4(x)" in response to appropriate Host Manufacturer number and appropriate Host Device number.

      Parameters:
      hostMfr - host manufacturer number
      hostDevice - host device number
      Returns:
      String containing Manufacturer name and Device model.
    • interpretSlaveManufacturerDevice

      public static final String interpretSlaveManufacturerDevice(Integer slaveMfr, Integer slaveDevice)
      Interpret IPL Identity Slave Manufacturer and Slave Device number as a string.

      NOTE: Some IPL-capable devices may not be completely determined based solely on Slave Manufacturer number and Slave Device number.

      Parameters:
      slaveMfr - slave manufacturer number
      slaveDevice - slave device number
      Returns:
      String containing Slave Manufacturer name and Device model.
    • connect

      public void connect(LnTrafficController t)
      Connect this instance's LocoNetListener to the LocoNet Traffic Controller.
      Parameters:
      t - a LocoNet Traffic Controller
    • dispose

      public void dispose()
      Break connection with the LnTrafficController and stop timers.
    • message

      public void message(LocoNetMessage m)
      Process all incoming LocoNet messages to look for IPL operations. Ignores all other LocoNet messages.
      Specified by:
      message in interface LocoNetListener
      Parameters:
      m - incoming LocoNet message to be examined
    • isIplQueryTimerRunning

      public boolean isIplQueryTimerRunning()
    • isValidMfgDevice

      public static boolean isValidMfgDevice(int mfg, int deviceType)
    • getManufacturer

      @CheckForNull public static String getManufacturer(int manuf)
      provides string representation for an IPL manufacturer number
      Parameters:
      manuf - IPL device manufacturer code number
      Returns:
      manufacturer name, or null if no known manufacturer name
    • getDeviceName

      @CheckForNull public static String getDeviceName(int manuf, int device, int slaveManuf, int slave)