Package jmri.jmrix.rfid
Class RfidMessage
java.lang.Object
jmri.jmrix.AbstractMessage
jmri.jmrix.AbstractMRMessage
jmri.jmrix.rfid.RfidMessage
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
ConcentratorMessage,StandaloneMessage
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)
- Since:
- 2.11.4
-
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
ConstructorsModifierConstructorDescriptionprotectedSuppress the default ctor, as the length must always be specifiedRfidMessage(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.RfidMessage(int l) RfidMessage(String m, int l) This ctor interprets the String as the exact sequence to send, byte-for-byte. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the length of an expected responsevoidsetInterlocked(boolean v) final voidsetResponseLength(int l) Sets the length of an expected responseMethods 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, setElementMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrix.Message
toMonitorString
-
Field Details
-
interlocked
boolean interlocked -
responseLength
int responseLength
-
-
Constructor Details
-
RfidMessage
protected RfidMessage()Suppress the default ctor, as the length must always be specified -
RfidMessage
-
RfidMessage
This ctor interprets the String as the exact sequence to send, byte-for-byte.- Parameters:
m- String to sendl- length of expected response
-
RfidMessage
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 response
-
-
Method Details
-
setInterlocked
-
getInterlocked
-
setResponseLength
Sets the length of an expected response- Parameters:
l- length of expected response
-
getResponseLength
Returns the length of an expected response- Returns:
- length of expected response
-