Class TPCANMsgXL

java.lang.Object
peak.can.basic.TPCANMsgXL
All Implemented Interfaces:
Cloneable

public class TPCANMsgXL extends Object implements Cloneable
Defines a CAN XL message.
  • 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 data
      length - 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

      public void setType(EnumSet<TPCANMessageTypeXL> type)
      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

      public static short getLengthFromDLC(EnumSet<TPCANMessageTypeXL> type, short dlc)
      Gets the length of a message based on a DLC.
      Parameters:
      type - CAN frame type
      dlc - data length code
      Returns:
      the message length
    • getTypeEnum

      public EnumSet<TPCANMessageTypeXL> 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

      public Object clone()
      Clones this message object.
      Overrides:
      clone in class Object
      Returns:
      The cloned message object.