Class LnConstants

java.lang.Object
jmri.jmrix.loconet.LnConstants

public final class LnConstants
extends Object
Constants to represent values seen in LocoNet traffic.

Some, but not all, of the names have a convention where the first "word" gives the type of the constant:

  • CONSIST - Consist type codes
  • DEC - Decoder type codes
  • OPC - LocoNet op code
  • PCMD - Programming command
  • RE - Re-engineered, not from the LocoNet documentations
  • STAT1 - bits in status byte 1
  • STAT2 - bits in status byte 2

Slot Status byte definitions and macros

  • D7-SL_SPURGE : 1=SLOT purge en, ALSO adrSEL (INTERNAL use only) (not seen on NET!)
  • D6-SL_CONUP : CONDN/CONUP: bit encoding-Control double linked Consist List
    • 11=LOGICAL MID CONSIST , Linked up AND down
    • 10=LOGICAL CONSIST TOP, Only linked downwards
    • 01=LOGICAL CONSIST SUB-MEMBER, Only linked upwards
    • 00=FREE locomotive, no CONSIST indirection/linking
    ALLOWS "CONSISTS of CONSISTS". Uplinked means that Slot SPD number is now SLOT adr of SPD/DIR and STATUS of consist. i.e. is an Indirect pointer. This Slot has same BUSY/ACTIVE bits as TOP of Consist. TOP is loco with SPD/DIR for whole consist. (top of list).
  • D5-SL_BUSY: BUSY/ACTIVE: bit encoding for SLOT activity
    • 11=IN_USE loco adr in SLOT -REFRESHED
  • D4-SL_ACTIVE ;
    • 10=IDLE loco adr in SLOT -NOT refreshed
    • 01=COMMON loco adr IN SLOT-refreshed
    • 00=FREE SLOT, no valid DATA -not refreshed
  • D3-SL_CONDN : shows other SLOT Consist linked INTO this slot, see SL_CONUP
  • D2-SL_SPDEX ; 3 BITS for Decoder TYPE encoding for this SLOT
  • D1-SL_SPD14
    • 011=send 128 speed mode packets
  • D0-SL_SPD28
    • 010=14 step MODE
    • 001=28 step. Generate Trinary packets for this Mobile ADR
    • 000=28 step. 3 BYTE PKT regular mode
    • 111=128 Step decoder, Allow Advanced DCC consisting
    • 100=28 Step decoder ,Allow Advanced DCC consisting
Note that the values in this class have been taken from the llnmom C program of Ron W. Auld, which included some work of John Kabat. The symbol names are copied from the loconet.h file, CVS revision 1.1.1.1, program release 0.3.0 Those parts are (C) Copyright 2001 Ron W. Auld, and are used with direct permission of the copyright holder.

Most major comment blocks here are quotes from the Digitrax LocoNet(r) OPCODE SUMMARY found in the LocoNet(r) Personal Edition 1.

Al Silverstein provided the reverse-engineering effort for the OPC_MULTI_SENSE message.

Alain Le Marchand completed the list of constants for Uhlenbrock Intellibox-I and -II, from observations of Intellibox traffic.

Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission.