public class CANFrame
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_CAN_DATA
Maximum length of a CAN frame: 8 bytes.
|
Constructor and Description |
---|
CANFrame(CAN canInterface,
CANId id,
boolean rtr,
boolean errorMsg,
byte[] data)
Creates a CAN Frame with the given parameters.
|
CANFrame(CAN canInterface,
CANId id,
byte[] data)
Creates a CAN Frame with the given interface, ID, and data.
|
Modifier and Type | Method and Description |
---|---|
CAN |
getCAN()
Retrieves the CAN interface where this CAN frame was received or sent.
|
byte[] |
getData()
Retrieves the CAN frame's data.
|
int |
getDlc()
Retrieves the CAN frame's data length code.
|
CANId |
getId()
Retrieves the CAN frame's ID.
|
boolean |
isErrorMessage()
Retrieves if this is a error message frame.
|
boolean |
isRTR()
Retrieves if this is a remote transmission request (RTR).
|
public static final int MAX_CAN_DATA
public CANFrame(CAN canInterface, CANId id, byte[] data)
canInterface
- The CAN interface where this CAN frame was received
or sent.id
- The CAN frame's ID.data
- The CAN frame's data.java.lang.IllegalArgumentException
- if data.length >
8.java.lang.NullPointerException
- if canInterface == null
or
if id == null
or
if data == null
.CAN
,
CANId
public CANFrame(CAN canInterface, CANId id, boolean rtr, boolean errorMsg, byte[] data)
canInterface
- The CAN interface where this CAN frame was received
or sent.id
- The CAN frame's ID.rtr
- true
if this is a RTR, false
otherwise.errorMsg
- true
if this is a error message frame,
false
otherwise.data
- The CAN frame's data.java.lang.IllegalArgumentException
- if data.length >
8.java.lang.NullPointerException
- if canInterface == null
or
if id == null
or
if data == null
.CAN
,
CANId
public CAN getCAN()
CAN
public boolean isRTR()
true
if this is a RTR, false
otherwise.public boolean isErrorMessage()
true
if this is a error message, false
otherwise.public int getDlc()
public byte[] getData()