Skip to content

Commit

Permalink
add LDH35
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjacobsen committed Jan 11, 2022
1 parent 4646adf commit afb6b47
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
1 change: 1 addition & 0 deletions java/src/jmri/jmrix/lenz/XNetBundle.properties
Expand Up @@ -19,6 +19,7 @@ CSTypeLH200 = LH200
CSTypeCompact = Compact or Other
CSTypeMultiMaus = multiMaus
CSTypeZ21 = Z21
CSTypeLDH35 = LDH35
CSTypeLokMaus = LocoMouse II
# Strings for hardware interface types
InterfaceLabel = Interface:
Expand Down
47 changes: 24 additions & 23 deletions java/src/jmri/jmrix/lenz/XNetConstants.java
Expand Up @@ -66,7 +66,7 @@ private XNetConstants(){
in a Double Header */

public static final int CS_DH_ERROR_NONZERO_SPD = 0x86; /* One or both units
has a non-zero
has a non-zero
speed setting */

/* Service mode and Informational responses from the command station */
Expand All @@ -80,7 +80,7 @@ private XNetConstants(){
paged mode response */

public static final int CS_SOFTWARE_VERSION = 0x21; /*software version
is included with
is included with
the 0x63 group.*/

/* informational request response */
Expand All @@ -94,6 +94,7 @@ private XNetConstants(){
public static final int CS_TYPE_LH200 = 0x01; // Lenz LH200
public static final int CS_TYPE_COMPACT = 0x02; // Lenz Compact/Atlas Commander
public static final int CS_TYPE_LOKMAUSII = 0x04; // Roco LokMaus II
public static final int CS_TYPE_LDH35 = 0x07; // LDH
public static final int CS_TYPE_MULTIMAUS = 0x10; // Roco multiMAUS
public static final int CS_TYPE_Z21 = 0x12; // Roco z21

Expand All @@ -103,11 +104,11 @@ private XNetConstants(){
public static final int BC_EVERYTHING_STOP = 0x00; /* broadcast of
emergency stop */

/* Feedback - this is basically a bitmask. The second nibble Indicates
/* Feedback - this is basically a bitmask. The second nibble Indicates
how many address byte/data byte pairs follow the command */
public static final int BC_FEEDBACK = 0x40;

/* Accessory information response
/* Accessory information response
* NOTE: This is identical to the feedback {@link BC_FEEDBACK} when
* there is only one address byte/data byte pair
*/
Expand All @@ -122,7 +123,7 @@ private XNetConstants(){

public static final int LOCO_NOT_AVAILABLE_V2 = 0xA4; /* for XNet V2 */

/* Locomotive Information for V3
/* Locomotive Information for V3
NOTE: for version 3.6, 0xE4 and 0xE3 are used to send information
about functions 13-28 */
public static final int LOCO_INFO_NORMAL_UNIT = 0xE4;
Expand Down Expand Up @@ -173,11 +174,11 @@ private XNetConstants(){
public static final int CS_VERSION = 0x21;
public static final int CS_STATUS = 0x24;

/* the following sets the Command station Power up mode, it's
/* the following sets the Command station Power up mode, it's
used as the first two bytes of the command */
public static final int CS_SET_POWERMODE = 0x22;

/* the third byte of the Power up mode is set for either Auto or Manual
/* the third byte of the Power up mode is set for either Auto or Manual
startup */
public static final int CS_POWERMODE_AUTO = 0x04;
public static final int CS_POWERMODE_MANUAL = 0x00;
Expand All @@ -187,7 +188,7 @@ private XNetConstants(){
public static final int ALL_ESTOP = 0x80;

/* this is for a single locomotive. With version 3 of expressnet, this is
followed with a two byte address. For version 2, this should be followed
followed with a two byte address. For version 2, this should be followed
by a 1 byte address */
public static final int EMERGENCY_STOP_XNETV1V2 = 0x91;
public static final int EMERGENCY_STOP = 0x92;
Expand Down Expand Up @@ -221,8 +222,8 @@ private XNetConstants(){
Follow imediatly with address*/

public static final int LOCO_INFO_REQ_V2 = 0xA2; /* for version 1 or 2 of
XNet.
folow with address and
XNet.
folow with address and
Mode Selection bytes */
/* V3 Status requests */

Expand All @@ -236,11 +237,11 @@ private XNetConstants(){
function status request */

public static final int LOCO_INFO_REQ_FUNC_HI_ON = 0x09; /* ON/OFF
function status request
function status request
for Functions 13-28*/

public static final int LOCO_INFO_REQ_FUNC_HI_MOM = 0x08; /* momentary/constatant
function status request
function status request
for Functions 13-28*/

public static final int LOCO_STACK_SEARCH_FWD = 0x05; /* search forward in
Expand Down Expand Up @@ -294,18 +295,18 @@ private XNetConstants(){

public static final int LOCO_SET_FUNC_Group5 = 0x2C; /* set functions F21-F28*/

/* add a unit to a multi-unit set opcode requires addition of the
direction relative to the lead unit as the least significant bit
This is followed by the 2 byte unit address of the unit, and the 1
/* add a unit to a multi-unit set opcode requires addition of the
direction relative to the lead unit as the least significant bit
This is followed by the 2 byte unit address of the unit, and the 1
byte consist address */
public static final int LOCO_ADD_MULTI_UNIT_REQ = 0x40;

/* remove a unit from a multi-unit set This is followed by the 2
/* remove a unit from a multi-unit set This is followed by the 2
byte unit address of the unit, and the 1 byte consist address */
public static final int LOCO_REM_MULTI_UNIT_REQ = 0x42;

/* find out if a unit is part of a specifc multi-unit set These are
followed by the 1 byte consist address, and the 2 byte consist
/* find out if a unit is part of a specifc multi-unit set These are
followed by the 1 byte consist address, and the 2 byte consist
address (Forward and Backward refer to search direction) */
public static final int LOCO_IN_MULTI_UNIT_SEARCH_REQ = 0xE4; //This is the opcode

Expand All @@ -321,7 +322,7 @@ private XNetConstants(){

/* double headers for XNet V3. In V3, there is only one command.
The third and 4th bytes are the locomotive address of the lead unit,
the locomotive to add to the consist is the 5th and 6th byte. To
the locomotive to add to the consist is the 5th and 6th byte. To
Disolve the double header, use 00 for both bytes of the second address */
public static final int LOCO_DOUBLEHEAD = 0xE5;
public static final int LOCO_DOUBLEHEAD_BYTE2 = 0x43;
Expand All @@ -332,8 +333,8 @@ private XNetConstants(){
/* Write requests (second byte for above) */
public static final int OPS_MODE_PROG_WRITE_REQ = 0x30;

/* Address inquiry Multi Unit Request
this is used to find the next Multi Unit address known to the
/* Address inquiry Multi Unit Request
this is used to find the next Multi Unit address known to the
command station. FWD and BKWD refer to search direction */
public static final int CS_MULTI_UNIT_REQ = 0xE2; // This is the OpCode
/* These are byte 2 of the message */
Expand All @@ -352,7 +353,7 @@ private XNetConstants(){
public static final int LI_MESSAGE_RESPONSE_UNKNOWN_DATA_ERROR = 0x03;
/* Now, we have a response indicating what was sent was OK */
public static final int LI_MESSAGE_RESPONSE_SEND_SUCCESS = 0x04;
/* and a message indicating the LI10x doesn't have a timeslot on the
/* and a message indicating the LI10x doesn't have a timeslot on the
XpressNet (possibly too many devices connected) */
public static final int LI_MESSAGE_RESPONSE_TIMESLOT_ERROR = 0x05;
/* Last, there is an error for an LI10x buffer overflow */
Expand All @@ -365,7 +366,7 @@ private XNetConstants(){

/* request to the LI101 */
public static final int LI101_REQUEST = 0xF2;
/* The following are the two possible values for the second byte of a
/* The following are the two possible values for the second byte of a
request to the LI101 */
public static final int LI101_REQUEST_ADDRESS = 0x01;
public static final int LI101_REQUEST_BAUD = 0x02;
Expand Down
Expand Up @@ -116,7 +116,7 @@ void getSystemInfo() {
XNetMessage msg = XNetMessage.getCSVersionRequestMessage();
//Then send to the controller
tc.sendXNetMessage(msg, this);
/* Next, get the message to request the Computer Interface
/* Next, get the message to request the Computer Interface
Hardware/Software Version */
XNetMessage msg2 = XNetMessage.getLIVersionRequestMessage();
// Then send it to the controller
Expand Down Expand Up @@ -214,6 +214,8 @@ private void setCSVersionDisplay() {
CSType.setText(Bundle.getMessage("CSTypeZ21"));
} else if (cs_type == jmri.jmrix.lenz.XNetConstants.CS_TYPE_LOKMAUSII) {
CSType.setText(Bundle.getMessage("CSTypeLokMaus"));
} else if (cs_type == jmri.jmrix.lenz.XNetConstants.CS_TYPE_LDH35) {
CSType.setText(Bundle.getMessage("CSTypeLDH35"));
} else {
CSType.setText(Bundle.getMessage("StateUnknown")); // use shared key
}
Expand Down

0 comments on commit afb6b47

Please sign in to comment.