|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.comm.CanFrame
The CANFrame
class is used with the CanBus
class to send and receive frames on the CAN Bus.
CanBus
Field Summary | |
byte[] |
data
Frame data area. |
boolean |
extendedID
Standard ID (11 bits) if false or Extended ID (29 bits) if true . |
int |
ID
Standard ID (11 bits) or Extended ID (29 bits) based on the value of extendedID . |
int |
length
Length of data area. |
int |
messageCenter
CAN Controller Message Center. |
boolean |
remoteFrameRequest
Remote Frame if true or Data Frame if false . |
Constructor Summary | |
CanFrame()
Creates a new CAN Frame with default parameters. |
|
CanFrame(int ID,
boolean extendedID,
byte[] buf,
int length)
Creates a new CAN Frame with specified parameters. |
Method Summary | |
byte[] |
getData()
Gets the data for the incoming or outgoing frame. |
boolean |
getExtendedID()
Gets the ID field type on a CAN Frame. |
int |
getID()
Gets the ID field on a CAN Frame to be sent or already received. |
int |
getLength()
Gets the length of the data in the incoming or outgoing frame. |
int |
getMessageCenter()
Gets the message center where this frame was received, or where this frame will be sent. |
boolean |
getRemoteFrameRequest()
Gets the RTR bit in the frame to determine if it is a Remote Frame. |
void |
setData(byte[] buf)
Sets the data for the outgoing frame. |
void |
setExtendedID(boolean extendedID)
Sets the ID field type on a CAN Frame. |
void |
setID(int ID)
Sets the ID field on a CAN Frame. |
void |
setLength(int length)
Sets the length for the data in the outgoing frame. |
void |
setMessageCenter(int MC)
Sets the message center from which to send this CAN Frame. |
void |
setRemoteFrameRequest(boolean RTR)
Sets the RTR bit in the frame to change this from a Data Frame to a Remote Frame. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public int ID
extendedID
.public boolean extendedID
false
or Extended ID (29 bits) if true
.public int messageCenter
public boolean remoteFrameRequest
true
or Data Frame if false
.public byte[] data
public int length
Constructor Detail |
public CanFrame()
ID = 0; extendedID = false; messageCenter = 0; remoteFrameRequest = false; data = new byte[8]; length = 0;
public CanFrame(int ID, boolean extendedID, byte[] buf, int length)
ID
- identifier on frameextendedID
- true
for extended ID (29 bit), or false
for
standard ID (11 bit)buf
- data for frame (maximum 8 bytes)length
- length of dataMethod Detail |
public void setID(int ID)
ID
- identifier on framepublic int getID()
public void setExtendedID(boolean extendedID)
extendedID
- true
for extended ID (29 bit), or false
for
standard ID (11 bit)public boolean getExtendedID()
true
for extended ID (29 bit), or false
for
standard ID (11 bit)public void setMessageCenter(int MC)
MC
- message Center to usepublic int getMessageCenter()
public void setRemoteFrameRequest(boolean RTR)
RTR
- true
for Remote Frame, false
for Data Framepublic boolean getRemoteFrameRequest()
true
for Remote Frame, false
for Data Framepublic void setData(byte[] buf)
buf
- data to put in framepublic byte[] getData()
public void setLength(int length)
len
- length of data in framepublic int getLength()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |