Class CANReceiveMessage

java.lang.Object
edu.wpi.first.hal.can.CANReceiveMessage

public class CANReceiveMessage extends Object
Represents a CAN message read from a stream.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final byte[]
    The message data.
    int
    The flags of the message.
    int
    The length of the data received (0-8 bytes).
    long
    Timestamp message was received, in microseconds (wpi time).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    setReceiveData(int length, int flags, 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
      The message data.
    • length

      public int length
      The length of the data received (0-8 bytes).
    • flags

      public int flags
      The flags of the message.
    • timestamp

      public long timestamp
      Timestamp message was received, in microseconds (wpi time).
  • Constructor Details

  • Method Details

    • setReceiveData

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