Class SpecificMessage
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRMessage
-
- jmri.jmrix.powerline.SerialMessage
-
- jmri.jmrix.powerline.insteon2412s.SpecificMessage
-
- All Implemented Interfaces:
Message
public class SpecificMessage extends SerialMessage
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
Fields Modifier and Type Field Description (package private) booleaninterlocked(package private) intresponseLength-
Fields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Constructor Summary
Constructors Constructor Description SpecificMessage(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(java.lang.String m, int l)This ctor interprets the String as the exact sequence to send, byte-for-byte.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SpecificMessagegetInsteonAddress(int idhighbyte, int idmiddlebyte, int idlowbyte)static SpecificMessagegetInsteonFunction(int idhighbyte, int idmiddlebyte, int idlowbyte, int function, int flag, int cmd1, int cmd2)booleangetInterlocked()static SerialMessagegetPoll(int addr)intgetResponseLength()static 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)java.lang.StringtoMonitorString()-
Methods inherited from class jmri.jmrix.powerline.SerialMessage
getAddr, isPoll, isXmt
-
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setOpCode, setRetries, setTimeout, toString
-
Methods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCode, setElement
-
-
-
-
Field Detail
-
interlocked
boolean interlocked
-
responseLength
int responseLength
-
-
Constructor Detail
-
SpecificMessage
public SpecificMessage(int l)
-
SpecificMessage
public SpecificMessage(java.lang.String m, int l)
This ctor interprets the String as the exact sequence to send, byte-for-byte.- Parameters:
m- messagel- response length in bytes
-
SpecificMessage
@Deprecated(since="5.13.5", forRemoval=true) public SpecificMessage(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.This ctor interprets the byte array as a sequence of characters to send.- Parameters:
a- Array of bytes to sendl- length of expected reply
-
-
Method Detail
-
setInterlocked
public void setInterlocked(boolean v)
- Overrides:
setInterlockedin classSerialMessage
-
getInterlocked
public boolean getInterlocked()
- Overrides:
getInterlockedin classSerialMessage
-
toMonitorString
public java.lang.String toMonitorString()
- Returns:
- a human-readable representation of the message.
-
setResponseLength
public void setResponseLength(int l)
- Overrides:
setResponseLengthin classSerialMessage
-
getResponseLength
public int getResponseLength()
- Overrides:
getResponseLengthin classSerialMessage
-
getPoll
public static SerialMessage getPoll(int addr)
-
getX10Address
public static SpecificMessage getX10Address(int housecode, int devicecode)
create an Insteon message with the X10 address- Parameters:
housecode- X10 housecodedevicecode- X10 devicecode- Returns:
- message formated message
-
getX10AddressDim
public static SpecificMessage getX10AddressDim(int housecode, int devicecode, int dimcode)
create an Insteon message with the X10 address and dim steps- Parameters:
housecode- X10 housecodedevicecode- X10 devicecodedimcode- value for dimming- Returns:
- message formated message
-
getX10FunctionDim
public static SpecificMessage getX10FunctionDim(int housecode, int function, int dimcode)
-
getX10Function
public static SpecificMessage getX10Function(int housecode, int function)
-
getInsteonAddress
public static SpecificMessage getInsteonAddress(int idhighbyte, int idmiddlebyte, int idlowbyte)
-
getInsteonFunction
public static SpecificMessage getInsteonFunction(int idhighbyte, int idmiddlebyte, int idlowbyte, int function, int flag, int cmd1, int cmd2)
-
-