Class CANUpdateJNI
java.lang.Object
com.revrobotics.jni.RevJNIWrapper
com.revrobotics.jni.CANUpdateJNI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intIterateSWDL(int busId, String dfuFilePath, String binFilePath) Iterate through the SWDL process, allowing for progress updates.static voidResetSWDL(int busId) Close, free, and reset the SWDL state.static booleanSetSWDLDevices(int busId, int[] deviceIDlist) Set the list of devices to update.static booleanSWDLChecksumFailFramePresent(int busId) Check if the checksum fail frame is present in the last 5 seconds.
-
Constructor Details
-
CANUpdateJNI
public CANUpdateJNI()
-
-
Method Details
-
SetSWDLDevices
public static boolean SetSWDLDevices(int busId, int[] deviceIDlist) Set the list of devices to update.- Parameters:
deviceIDlist- The device IDs you wish to update as an array of integers.- Returns:
- True if the devices were set successfully, false if there was an error
-
ResetSWDL
public static void ResetSWDL(int busId) Close, free, and reset the SWDL state. This is called automatically when the SWDL process completes or fails, but can also be called to reset the state if you need to start over. -
IterateSWDL
Iterate through the SWDL process, allowing for progress updates. Devices must be set before calling this function. This function should be called repeatedly until it returns 100% or -1 (error). It resets state on error or completion. This function is not thread-safe, and only one thread should call it at a time.- Parameters:
dfuFilePath- The path to the DFU file.binFilePath- The path to the binary file.- Returns:
- The current progress percentage (0-100) or -1 if an error occurs.
-
SWDLChecksumFailFramePresent
public static boolean SWDLChecksumFailFramePresent(int busId) Check if the checksum fail frame is present in the last 5 seconds. A delay should be added before calling this function.- Returns:
- true if the checksum fail frame is present, false otherwise.
-