Class MarklinMessage
- All Implemented Interfaces:
Message
The MarklinReply class handles the response from the command station.
Packages of length 13 are interpreted as can-bus packages:
4 bytes Can-bus-ID (BigEndian or network order),
1-byte length and
8 bytes of data, if necessary with null bytes to fill in.
The message ID is divided into the areas of lower priority (priority), command (command), response and hash. The communication is based on the following format: Prio - 2 +2bit Command 8 bit Resp - 1 bit Hash - 16bit DLC - 4bit (ie CAN message length) CAN message 8 BYTES Can Message Bytes 0 to 3 are the address bytes, with byte 0 High, byte 3 low
-
Field Summary
FieldsFields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT, sourceLetterFields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongstatic MarklinMessageGenerate CAN BOOT command (0x1B) for Gleisbox activation.static MarklinMessageGenerate CAN BOOT command (0x1B) for entering bootloader mode.static MarklinMessagestatic MarklinMessagestatic MarklinMessagestatic MarklinMessagestatic MarklinMessagegetQryLocoDirection(int addr) static MarklinMessagegetQryLocoFunction(int addr, int funct) static MarklinMessagegetQryLocoSpeed(int addr) static MarklinMessagegetReadDirectCV(int cv) static MarklinMessagegetReadPagedCV(int cv) static MarklinMessagegetReadRegister(int reg) static MarklinMessagegetSetTurnout(int addr, int state, int power) static MarklinMessagegetWriteDirectCV(int cv, int val) static MarklinMessagegetWritePagedCV(int cv, int val) static MarklinMessagegetWriteRegister(int reg, int val) static MarklinMessagesensorPollMessage(int module) static MarklinMessagesetLocoDirection(int addr, int dir) static MarklinMessagesetLocoEmergencyStop(int addr) static MarklinMessagesetLocoFunction(int addr, int funct, int state) static MarklinMessagesetLocoSpeed(int addr, int speed) static MarklinMessagesetLocoSpeedSteps(int addr, int step) Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getSourceLetter, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setOpCode, setRetries, setTimeout, toStringMethods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCode, setElementMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrix.Message
toMonitorString
-
Field Details
-
MY_UID
-
-
Constructor Details
-
MarklinMessage
-
MarklinMessage
-
MarklinMessage
-
MarklinMessage
-
MarklinMessage
-
-
Method Details
-
getEnableMain
-
getKillMain
-
getCanBoot
Generate CAN BOOT command (0x1B) for Gleisbox activation.This command resets the Gleisbox/trackbox and initiates it to start passing commands to locos and accessories on the rails. Without this command on startup, the hardware does not respond to subsequent commands. This variant is used for normal operational startup of standalone Gleisbox devices when no CS2/MS2 is attached.
The packet uses DLC=5 with data byte 0 set to 0x11, which is the "magic value" that activates the Gleisbox for normal operations. This matches the behavior of Rocrail and the can2udp reference implementation (M_GLEISBOX_MAGIC_START_SEQUENCE).
- Returns:
- MarklinMessage containing the CAN BOOT activation command
- See Also:
-
getCanBootloaderMode
Generate CAN BOOT command (0x1B) for entering bootloader mode.This variant of the CAN BOOT command invokes the bootloader update sequence on Märklin devices for firmware updates. It is sent after a system reset with approximately 400ms wait time, putting the device into bootloader mode ready to receive firmware data.
This command uses DLC=0 (no data bytes) and should be followed by firmware data transfer packets if performing an actual firmware update. This is different from
getCanBoot()which activates the device for normal operations.Note: This command is intended for firmware update operations. For normal Gleisbox activation to run trains, use
getCanBoot()instead.- Returns:
- MarklinMessage containing the CAN BOOT bootloader invocation command
- See Also:
-
getSetTurnout
-
getQryLocoSpeed
-
setLocoSpeed
-
setLocoEmergencyStop
-
setLocoSpeedSteps
-
getQryLocoDirection
-
setLocoDirection
-
getQryLocoFunction
-
setLocoFunction
-
sensorPollMessage
-
getAddress
-
getProgMode
-
getExitProgMode
-
getReadPagedCV
-
getWritePagedCV
-
getReadRegister
-
getWriteRegister
-
getReadDirectCV
-
getWriteDirectCV
-