Class TPCANMsg

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class TPCANMsg
    extends java.lang.Object
    implements java.lang.Cloneable
    Defines a CAN message.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static byte MSGTYPE_EXTENDED
      Deprecated.
      Use enum TPCANMessageType instead
      static byte MSGTYPE_RTR
      Deprecated.
      Use enum TPCANMessageType instead
      static byte MSGTYPE_STANDARD
      Deprecated.
      Use enum TPCANMessageType instead
    • Constructor Summary

      Constructors 
      Constructor Description
      TPCANMsg()
      Default constructor
      TPCANMsg​(int id, byte type, byte length, byte[] data)
      Constructs a new message object.
      TPCANMsg​(int id, java.util.EnumSet<TPCANMessageType> type, byte length, byte[] data)
      Constructs a new message object.
    • Method Summary

      Modifier and Type Method Description
      java.lang.Object clone()
      Clones this message object.
      byte[] getData()
      Gets the data of this message.
      int getID()
      Gets the id of this message.
      byte getLength()
      Gets the length of this message.
      byte getType()
      Gets the type of this message.
      void setData​(byte[] data, byte length)
      Sets the data and length of this message.
      void setID​(int id)
      Sets the id of this message.
      void setLength​(byte length)
      Sets the length of this message.
      void setType​(byte type)
      Sets the type of this message.
      void setType​(java.util.EnumSet<TPCANMessageType> type)
      Sets the type of this message.
      void setType​(TPCANMessageType type)
      Sets the type of this message.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MSGTYPE_STANDARD

        @Deprecated
        public static final byte MSGTYPE_STANDARD
        Deprecated.
        Use enum TPCANMessageType instead
        11bit message type (standard)
      • MSGTYPE_RTR

        @Deprecated
        public static final byte MSGTYPE_RTR
        Deprecated.
        Use enum TPCANMessageType instead
        Remote request
      • MSGTYPE_EXTENDED

        @Deprecated
        public static final byte MSGTYPE_EXTENDED
        Deprecated.
        Use enum TPCANMessageType instead
        29bit message type (extended)
    • Constructor Detail

      • TPCANMsg

        public TPCANMsg()
        Default constructor
      • TPCANMsg

        public TPCANMsg​(int id,
                        byte type,
                        byte length,
                        byte[] data)
        Constructs a new message object.
        Parameters:
        id - the message id
        type - the message type
        length - the message length
        data - the message data
      • TPCANMsg

        public TPCANMsg​(int id,
                        java.util.EnumSet<TPCANMessageType> type,
                        byte length,
                        byte[] data)
        Constructs a new message object.
        Parameters:
        id - the message id
        type - the message type as an enumeration set
        length - the message length
        data - the message data
    • Method Detail

      • setID

        public void setID​(int id)
        Sets the id of this message.
        Parameters:
        id - the message id
      • setData

        public void setData​(byte[] data,
                            byte length)
        Sets the data and length of this message.
        Parameters:
        data - the message data
        length - the message length
      • setLength

        public void setLength​(byte length)
        Sets the length of this message.
        Parameters:
        length - the length of the message
      • setType

        public void setType​(byte type)
        Sets the type of this message.
        Parameters:
        type - the message type
      • setType

        public void setType​(TPCANMessageType type)
        Sets the type of this message.
        Parameters:
        type - the message type
      • setType

        public void setType​(java.util.EnumSet<TPCANMessageType> type)
        Sets the type of this message.
        Parameters:
        type - the message type
      • getID

        public int getID()
        Gets the id of this message.
        Returns:
        the message id
      • getData

        public byte[] getData()
        Gets the data of this message.
        Returns:
        the message data
      • getLength

        public byte getLength()
        Gets the length of this message.
        Returns:
        the message length
      • getType

        public byte getType()
        Gets the type of this message.
        Returns:
        the message type
      • clone

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