Package jmri.jmrix.can
Interface CanMutableFrame
-
- All Superinterfaces:
CanFrame
- All Known Implementing Classes:
CanMessage
,CanReply
public interface CanMutableFrame extends CanFrame
Base interface for mutable messages in a CANbus based message/reply protocol.It is expected that any CAN based system will be based upon basic CAN concepts such as ID/header (standard or extended), Normal and RTR frames and a data field.
"header" refers to the full 11 or 29 bit header; which mode is separately set via the "extended" parameter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
setData(byte[] d)
Set the CAN Frame data elements by byte array.default void
setData(int[] d)
Set the CAN Frame data elements by int array.void
setElement(int n, int v)
Get a single data byte in the frame.void
setExtended(boolean b)
Set if the CAN Frame header is extended.void
setHeader(int h)
Set the CAN Frame header.void
setNumDataElements(int n)
Set the number of data elements in the main CAN Frame body.void
setRtr(boolean b)
Set if the CAN Frame is an RTR Frame.-
Methods inherited from interface jmri.jmrix.can.CanFrame
appendHexElements, dataFramesEqual, extendedOrRtr, getElement, getHeader, getNumDataElements, getToString, isEqual, isExtended, isRtr, monString
-
-
-
-
Method Detail
-
setHeader
void setHeader(int h)
Set the CAN Frame header.- Parameters:
h
- new header value
-
setExtended
void setExtended(boolean b)
Set if the CAN Frame header is extended.- Parameters:
b
- true if extended, else false
-
setRtr
void setRtr(boolean b)
Set if the CAN Frame is an RTR Frame.- Parameters:
b
- true if RTR, else false
-
setNumDataElements
void setNumDataElements(int n)
Set the number of data elements in the main CAN Frame body.- Parameters:
n
- true number of data bytes, 0-8
-
setElement
void setElement(int n, int v)
Get a single data byte in the frame.- Parameters:
n
- the index, 0-7v
- the new value, 0-255
-
setData
default void setData(int[] d)
Set the CAN Frame data elements by int array.- Parameters:
d
- array of CAN Frame data bytes, max 8
-
setData
default void setData(byte[] d)
Set the CAN Frame data elements by byte array.- Parameters:
d
- array of CAN Frame data bytes, max 8
-
-