mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[hal] Expose CAN timestamp base clock (#5357)
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
public class CANAPIJNI extends JNIWrapper {
|
||||
public static native long getCANPacketBaseTime();
|
||||
|
||||
public static native int initializeCAN(int manufacturer, int deviceId, int deviceType);
|
||||
|
||||
public static native void cleanCAN(int handle);
|
||||
|
||||
@@ -6,16 +6,19 @@ package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public class CANData {
|
||||
/** Contents of the CAN frame. */
|
||||
public final byte[] data = new byte[8];
|
||||
/** Length of the frame in bytes. */
|
||||
public int length;
|
||||
/** CAN frame timestamp in milliseconds. */
|
||||
public long timestamp;
|
||||
|
||||
/**
|
||||
* API used from JNI to set the data.
|
||||
*
|
||||
* @param length Length of packet in bytes.
|
||||
* @param timestamp CAN frame timestamp in microseconds.
|
||||
* @return Buffer containing CAN frame.
|
||||
* @param timestamp CAN frame timestamp in milliseconds.
|
||||
* @return Buffer to place CAN frame data in.
|
||||
*/
|
||||
@SuppressWarnings("PMD.MethodReturnsInternalArray")
|
||||
public byte[] setData(int length, long timestamp) {
|
||||
|
||||
Reference in New Issue
Block a user