Class CANData

java.lang.Object
edu.wpi.first.hal.CANData

public class CANData extends Object
Represents a received CAN message.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final byte[]
    Contents of the CAN frame.
    int
    Length of the frame in bytes.
    long
    CAN frame timestamp in milliseconds.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    setData(int length, long timestamp)
    API used from JNI to set the data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • data

      public final byte[] data
      Contents of the CAN frame.
    • length

      public int length
      Length of the frame in bytes.
    • timestamp

      public long timestamp
      CAN frame timestamp in milliseconds.
  • Constructor Details

    • CANData

      public CANData()
      Default constructor.
  • Method Details

    • setData

      public byte[] setData(int length, long timestamp)
      API used from JNI to set the data.
      Parameters:
      length - Length of packet in bytes.
      timestamp - CAN frame timestamp in milliseconds.
      Returns:
      Buffer to place CAN frame data in.