public class TPCANMsg
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and 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 and 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.
|
Modifier and Type | Method and 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.
|
@Deprecated public static final byte MSGTYPE_STANDARD
@Deprecated public static final byte MSGTYPE_RTR
@Deprecated public static final byte MSGTYPE_EXTENDED
public TPCANMsg()
public TPCANMsg(int id, byte type, byte length, byte[] data)
id
- the message idtype
- the message typelength
- the message lengthdata
- the message datapublic TPCANMsg(int id, java.util.EnumSet<TPCANMessageType> type, byte length, byte[] data)
id
- the message idtype
- the message type as an enumeration setlength
- the message lengthdata
- the message datapublic void setID(int id)
id
- the message idpublic void setData(byte[] data, byte length)
data
- the message datalength
- the message lengthpublic void setLength(byte length)
length
- the length of the messagepublic void setType(byte type)
type
- the message typepublic void setType(TPCANMessageType type)
type
- the message typepublic void setType(java.util.EnumSet<TPCANMessageType> type)
type
- the message typepublic int getID()
public byte[] getData()
public byte getLength()
public byte getType()
public java.lang.Object clone()
clone
in class java.lang.Object