Class TPCANMsgXL
java.lang.Object
peak.can.basic.TPCANMsgXL
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorTPCANMsgXL(int pid, byte vcid, EnumSet<TPCANMessageTypeXL> msgtype, short dlc, byte sdt, int af, byte rrs, byte sec, byte[] data) Constructs a new message object. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this message object.intgetAF()byte[]getData()Gets the data of this message.shortgetDlc()Gets the data length code of this message.shortGets the length of this message based on its DLC.static shortgetLengthFromDLC(EnumSet<TPCANMessageTypeXL> type, short dlc) Gets the length of a message based on a DLC.intgetPID()bytegetRRS()bytegetSDT()bytegetSEC()shortgetType()Gets the type of this message.Gets the type of this message.bytegetVCID()voidsetAF(int _AF) voidsetData(byte[] data, short length) Sets the data of this message.voidsetDlc(short dlc) Sets the data length code of this message.voidsetPID(int _PID) voidsetRRS(byte _RRS) voidsetSDT(byte _SDT) voidsetSEC(byte _SEC) voidsetType(short type) Sets the type of this message.voidsetType(EnumSet<TPCANMessageTypeXL> type) Sets the type of this message.voidsetVCID(byte _VCID)
-
Constructor Details
-
TPCANMsgXL
public TPCANMsgXL()Default constructor -
TPCANMsgXL
public TPCANMsgXL(int pid, byte vcid, EnumSet<TPCANMessageTypeXL> msgtype, short dlc, byte sdt, int af, byte rrs, byte sec, byte[] data) Constructs a new message object.- Parameters:
pid-vcid-msgtype-dlc-sdt-af-rrs-sec-data-
-
-
Method Details
-
setPID
public void setPID(int _PID) -
setVCID
public void setVCID(byte _VCID) -
setSDT
public void setSDT(byte _SDT) -
setAF
public void setAF(int _AF) -
setRRS
public void setRRS(byte _RRS) -
setSEC
public void setSEC(byte _SEC) -
setData
public void setData(byte[] data, short length) Sets the data of this message.- Parameters:
data- the message datalength- the message length
-
setDlc
public void setDlc(short dlc) Sets the data length code of this message.- Parameters:
dlc- the data length code of the message
-
setType
Sets the type of this message.- Parameters:
type- the message type
-
setType
public void setType(short type) Sets the type of this message.- Parameters:
type- the message type
-
getPID
public int getPID() -
getVCID
public byte getVCID() -
getSDT
public byte getSDT() -
getAF
public int getAF() -
getRRS
public byte getRRS() -
getSEC
public byte getSEC() -
getData
public byte[] getData()Gets the data of this message.- Returns:
- the message data
-
getDlc
public short getDlc()Gets the data length code of this message.- Returns:
- the message Data Length Code
-
getLengthFromDLC
public short getLengthFromDLC()Gets the length of this message based on its DLC.- Returns:
- the message length
-
getLengthFromDLC
Gets the length of a message based on a DLC.- Parameters:
type- CAN frame typedlc- data length code- Returns:
- the message length
-
getTypeEnum
Gets the type of this message.- Returns:
- the message type
-
getType
public short getType()Gets the type of this message.- Returns:
- the message type
-
clone
-