[hal] Expose CAN timestamp base clock (#5357)

This commit is contained in:
Ryan Blue
2023-06-07 12:54:03 -04:00
committed by GitHub
parent 91cbcea841
commit 1c00a52b67
9 changed files with 81 additions and 28 deletions

View File

@@ -172,4 +172,15 @@ public class CAN implements Closeable {
public boolean readPacketTimeout(int apiId, int timeoutMs, CANData data) {
return CANAPIJNI.readCANPacketTimeout(m_handle, apiId, timeoutMs, data);
}
/**
* Reads the current value of the millisecond-resolution timer that {@link CANData} timestamps are
* based on.
*
* @return Current value of timer used as a base time for {@link CANData} timestamps in
* milliseconds
*/
public static long getTimestampBaseTime() {
return CANAPIJNI.getCANPacketBaseTime();
}
}