Package com.reduxrobotics.canand
Class ReduxJNI
java.lang.Object
com.reduxrobotics.canand.ReduxJNI
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Supported driver major versionstatic final int
Supported driver minor versionstatic final int
Supported driver year -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Force load the library.static int
init()
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.
-
Field Details
-
DRIVER_YEAR
public static final int DRIVER_YEARSupported driver year- See Also:
-
DRIVER_MAJOR_VERSION
public static final int DRIVER_MAJOR_VERSIONSupported driver major version- See Also:
-
DRIVER_MINOR_VERSION
public static final int DRIVER_MINOR_VERSIONSupported driver minor version- See Also:
-
-
Constructor Details
-
ReduxJNI
public ReduxJNI()
-
-
Method Details
-
forceLoad
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
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 onmessageID
- 29-bit full CAN message iddata
- payload of up to 8 bytes.- Returns:
- success
-