com.dalsemi.comm
Class CanFrame

java.lang.Object
  |
  +--com.dalsemi.comm.CanFrame

public class CanFrame
extends java.lang.Object

This class represents a CAN Frame.


Field Summary
 byte[] data
           
 boolean extendedID
           
 int ID
           
 int length
           
 int messageCenter
           
 boolean remoteFrameRequest
           
 byte[] tempdata
           
 
Constructor Summary
CanFrame()
          Create a new CAN Frame with default parameters.
CanFrame(int ID, boolean extendedID, byte[] buf, int length)
          Create a new CAN Frame with specified parameters.
 
Method Summary
 byte[] getData()
          Get the data for the incoming or outgoing frame.
 boolean getExtendedID()
          Get the ID field type on a CAN Frame
 int getID()
          Get the ID field on a CAN Frame to be sent or already received.
 int getLength()
          Get the length of the data in the incoming or outgoing frame.
 int getMessageCenter()
          Get the message center where this frame was received, or where this frame will be sent.
 boolean getRemoteFrameRequest()
          Get the RTR bit in the frame to determine if it is a Remote Frame.
 void setData(byte[] buf)
          Set the data for the outgoing frame.
 void setExtendedID(boolean extendedID)
          Set the ID field type on a CAN Frame
 void setID(int ID)
          Set the ID field on a CAN Frame
 void setLength(int length)
          Set the length for the data in the outgoing frame.
 void setMessageCenter(int MC)
          Set the message center with which to send this CAN Frame
 void setRemoteFrameRequest(boolean RTR)
          Set 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

ID

public int ID

extendedID

public boolean extendedID

messageCenter

public int messageCenter

remoteFrameRequest

public boolean remoteFrameRequest

data

public byte[] data

tempdata

public byte[] tempdata

length

public int length
Constructor Detail

CanFrame

public CanFrame()
Create a new CAN Frame with default parameters.

CanFrame

public CanFrame(int ID,
                boolean extendedID,
                byte[] buf,
                int length)
Create a new CAN Frame with specified parameters.
Parameters:
ID - Identifier on frame
buf - Data for frame
length - Length of data
Method Detail

setID

public void setID(int ID)
Set the ID field on a CAN Frame
Parameters:
ID - Identifier on frame

getID

public int getID()
Get the ID field on a CAN Frame to be sent or already received.

setExtendedID

public void setExtendedID(boolean extendedID)
Set the ID field type on a CAN Frame
Parameters:
extendedID - true for extended ID, false for standard ID

getExtendedID

public boolean getExtendedID()
Get the ID field type on a CAN Frame
Returns:
true for extended ID, false for standard ID

setMessageCenter

public void setMessageCenter(int MC)
Set the message center with which to send this CAN Frame
Parameters:
MC - Message Center to use

getMessageCenter

public int getMessageCenter()
Get the message center where this frame was received, or where this frame will be sent.

setRemoteFrameRequest

public void setRemoteFrameRequest(boolean RTR)
Set the RTR bit in the frame to change this from a Data Frame to a Remote Frame.
Parameters:
RTR - true for Remote Frame, false for Data Frame.

getRemoteFrameRequest

public boolean getRemoteFrameRequest()
Get the RTR bit in the frame to determine if it is a Remote Frame.
Returns:
true for Remote Frame, false for Data Frame.

setData

public void setData(byte[] buf)
Set the data for the outgoing frame. Maximum data length is 8 bytes.
Parameters:
buf - Data to put in frame.

getData

public byte[] getData()
Get the data for the incoming or outgoing frame.

setLength

public void setLength(int length)
Set the length for the data in the outgoing frame. Maximum data length is 8 bytes.
Parameters:
len - Length of data in frame.

getLength

public int getLength()
Get the length of the data in the incoming or outgoing frame.