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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Internal use class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Supported driver major version
    static final int
    Supported driver minor version
    static final int
    Supported driver year
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Force load the library.
    static int
    Starts the Redux CANlink server -- not usually needed to be called manually.
    static boolean
    sendCANMessage(CANBus bus, int messageID, byte[] data)
    Sends a CAN message.
    static boolean
    sendCANMessage(CANBus bus, int messageID, long data, int length)
    Sends a CAN message using a long as the data medium.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
    • sendCANMessage

      public static boolean sendCANMessage(CANBus bus, int messageID, long data, int length)
      Sends a CAN message using a long as the data medium. (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, formatted as a little-endian long.
      length - data payload length.
      Returns:
      success