Interface CanMutableFrame

All Superinterfaces:
CanFrame
All Known Implementing Classes:
CanMessage, CanReply

public interface CanMutableFrame
extends CanFrame
Base interface for mutable messages in a CANbus based message/reply protocol.

It is expected that any CAN based system will be based upon basic CAN concepts such as ID/header (standard or extended), Normal and RTR frames and a data field.

"header" refers to the full 11 or 29 bit header; which mode is separately set via the "extended" parameter

  • Method Details

    • setHeader

      void setHeader​(int h)
      Set the CAN Frame header.
      Parameters:
      h - new header value
    • setExtended

      void setExtended​(boolean b)
      Set if the CAN Frame header is extended.
      Parameters:
      b - true if extended, else false
    • setRtr

      void setRtr​(boolean b)
      Set if the CAN Frame is an RTR Frame.
      Parameters:
      b - true if RTR, else false
    • setNumDataElements

      void setNumDataElements​(int n)
      Set the number of data elements in the main CAN Frame body.
      Parameters:
      n - true number of data bytes, 0-8
    • setElement

      void setElement​(int n, int v)
      Get a single data byte in the frame.
      Parameters:
      n - the index, 0-7
      v - the new value, 0-255
    • setData

      default void setData​(int[] d)
      Set the CAN Frame data elements by int array.
      Parameters:
      d - array of CAN Frame data bytes, max 8
    • setData

      default void setData​(byte[] d)
      Set the CAN Frame data elements by byte array.
      Parameters:
      d - array of CAN Frame data bytes, max 8