Package jmri.jmrix.powerline.simulator
Class SpecificMessage
java.lang.Object
jmri.jmrix.AbstractMessage
jmri.jmrix.AbstractMRMessage
jmri.jmrix.powerline.SerialMessage
jmri.jmrix.powerline.simulator.SpecificMessage
- All Implemented Interfaces:
Message
Contains the data payload of a serial packet.
The transmission protocol can come in one of several forms:
- If the interlocked parameter is false (default), the packet is just sent. If the response length is not zero, a reply of that length is expected.
- If the interlocked parameter is true, the transmission will require a CRC interlock, which will be automatically added. (Design note: this is done to make sure that the messages remain atomic)
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) intFields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUTFields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars -
Constructor Summary
ConstructorsConstructorDescriptionSpecificMessage(byte[] a, int l) Deprecated, for removal: This API element is subject to removal in a future version.5.13.5, unused, requires further development.SpecificMessage(int l) SpecificMessage(String m, int l) This ctor interprets the String as the exact sequence to send, byte-for-byte. -
Method Summary
Modifier and TypeMethodDescriptionstatic SpecificMessagegetExtCmd(int housecode, int devicecode, int function, int dimcode) static SpecificMessagegetInsteonAddress(int idhighbyte, int idmiddlebyte, int idlowbyte) static SpecificMessagegetInsteonFunction(int idhighbyte, int idmiddlebyte, int idlowbyte, int function, int flag, int cmd1, int cmd2) booleanstatic SerialMessagegetPoll(int addr) intstatic SpecificMessagegetX10Address(int housecode, int devicecode) create an Insteon message with the X10 addressstatic SpecificMessagegetX10AddressDim(int housecode, int devicecode, int dimcode) create an Insteon message with the X10 address and dim stepsstatic SpecificMessagegetX10Function(int housecode, int function) static SpecificMessagegetX10FunctionDim(int housecode, int function, int dimcode) voidsetInterlocked(boolean v) voidsetResponseLength(int l) Methods inherited from class jmri.jmrix.powerline.SerialMessage
getAddr, isPoll, isXmtMethods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setOpCode, setRetries, setTimeout, toStringMethods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCode, setElement
-
Field Details
-
interlocked
boolean interlocked -
responseLength
int responseLength
-
-
Constructor Details
-
SpecificMessage
-
SpecificMessage
This ctor interprets the String as the exact sequence to send, byte-for-byte.- Parameters:
m- messagel- response length in bytes
-
SpecificMessage
Deprecated, for removal: This API element is subject to removal in a future version.5.13.5, unused, requires further development.This ctor interprets the byte array as a sequence of characters to send.- Parameters:
a- Array of bytes to sendl- length expected reply
-
-
Method Details
-
setInterlocked
- Overrides:
setInterlockedin classSerialMessage
-
getInterlocked
- Overrides:
getInterlockedin classSerialMessage
-
toMonitorString
- Returns:
- a human-readable representation of the message.
-
setResponseLength
- Overrides:
setResponseLengthin classSerialMessage
-
getResponseLength
- Overrides:
getResponseLengthin classSerialMessage
-
getPoll
-
getX10Address
create an Insteon message with the X10 address- Parameters:
housecode- value of the housecode of X10 addressdevicecode- value of the devicecode of X10 address- Returns:
- message formated message with parameters
-
getX10AddressDim
create an Insteon message with the X10 address and dim steps- Parameters:
housecode- value of the housecode of X10 addressdevicecode- value of the devicecode of X10 addressdimcode- value of how dim to set the light- Returns:
- message formated message with parameters
-
getX10FunctionDim
-
getX10Function
-
getExtCmd
-
getInsteonAddress
-
getInsteonFunction
public static SpecificMessage getInsteonFunction(int idhighbyte, int idmiddlebyte, int idlowbyte, int function, int flag, int cmd1, int cmd2)
-