Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
public final class CanFrame
- Object
- CanFrame
One classic CAN frame: an identifier and up to eight data bytes.
Constructors
public CanFrame(int id, boolean extended, byte[] data) | Creates a frame. |
Methods
public int getId() | The identifier. |
public boolean isExtended() | true for a 29-bit identifier. |
public byte[] getData() | A copy of the payload. |
public int getLength() | The payload length. |
Inherited methods
Constructor details
CanFrame
public CanFrame(int id, boolean extended, byte[] data)Creates a frame.
Parameters
idint- an 11-bit identifier, or 29-bit when
extended extendedbooleantruefor a 29-bit identifierdatabyte[]- zero to eight payload bytes; the array is copied
Method details
getId
public int getId()The identifier.
isExtended
public boolean isExtended()true for a 29-bit identifier.getData
public byte[] getData()A copy of the payload.
getLength
public int getLength()The payload length.