Class ReduxJNI

java.lang.Object
com.reduxrobotics.canand.ReduxJNI

public class ReduxJNI extends Object
Java side of the Redux device driver JNI wrapper. It is generally not necessary to directly interact with this class.
  • Field Details

    • DRIVER_YEAR

      public static final int DRIVER_YEAR
      Supported driver year
      See Also:
    • DRIVER_MAJOR_VERSION

      public static final int DRIVER_MAJOR_VERSION
      Supported driver major version
      See Also:
    • DRIVER_MINOR_VERSION

      public static final int DRIVER_MINOR_VERSION
      Supported driver minor version
      See Also:
  • Constructor Details

    • ReduxJNI

      public ReduxJNI()
  • Method Details

    • forceLoad

      public static void forceLoad() throws IOException
      Force load the library.
      Throws:
      IOException - thrown if the native library cannot be found
    • init

      public static int init()
      Starts the Redux CANlink server -- not usually needed to be called manually.
      Returns:
      0 on success, nonzero otherwise
    • sendCANMessage

      public static boolean sendCANMessage(CANBus bus, int messageID, byte[] data)
      Sends a CAN message. (At the moment, this more or less calls HAL_CAN_SendMessage under the hood, and does not support sending to non-Rio buses.)
      Parameters:
      bus - the bus to send on
      messageID - 29-bit full CAN message id
      data - payload of up to 8 bytes.
      Returns:
      success