Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add missing HAL CAN javadocs (NFC) #6882

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ task generateJavaDocs(type: Javadoc) {
options.addBooleanOption("Xdoclint/package:" +
// TODO: v Document these, then remove them from the list
"-edu.wpi.first.hal," +
"-edu.wpi.first.hal.can," +
"-edu.wpi.first.hal.simulation," +
// TODO: ^ Document these, then remove them from the list
"-edu.wpi.first.math.proto," +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
public class CANInvalidBufferException extends RuntimeException {
private static final long serialVersionUID = -7993785672956997939L;

/** Constructs a new CANInvalidBufferException with no message. */
public CANInvalidBufferException() {
super();
}

/**
* Constructs a new CANInvalidBufferException with {@code msg} as its detail message.
*
* @param msg the message
*/
public CANInvalidBufferException(String msg) {
super(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
public class CANMessageNotAllowedException extends RuntimeException {
private static final long serialVersionUID = -638450112427013494L;

/**
* Constructs a new CANMessageNotAllowedException with {@code msg} as its detail message.
*
* @param msg the message
*/
public CANMessageNotAllowedException(String msg) {
super(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
public class CANMessageNotFoundException extends RuntimeException {
private static final long serialVersionUID = 8249780881928189975L;

/** Constructs a new CANMessageNotFoundException with no message. */
public CANMessageNotFoundException() {
super();
}

/**
* Constructs a new CANMessageNotFoundException with {@code msg} as its detail message.
*
* @param msg the message
*/
public CANMessageNotFoundException(String msg) {
super(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
public class CANNotInitializedException extends RuntimeException {
private static final long serialVersionUID = -5982895147092686594L;

/** Constructs a new CANNotInitializedException with no message. */
public CANNotInitializedException() {
super();
}

/**
* Constructs a new CANNotInitializedException with {@code msg} as its detail message.
*
* @param msg the message
*/
public CANNotInitializedException(String msg) {
super(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
import edu.wpi.first.hal.CANStreamMessage;
import java.io.IOException;

/**
* Exception indicating that a CAN stream overflowed at some point between reads, therefore some
* messages were lost. This exception contains any messages that were successfully read during the
* operation that threw the exception.
*/
public class CANStreamOverflowException extends IOException {
/** The messages. */
private final CANStreamMessage[] m_messages;
Expand All @@ -17,8 +22,8 @@ public class CANStreamOverflowException extends IOException {
/**
* Constructs a new CANStreamOverflowException.
*
* @param messages The messages
* @param messagesRead The length of messages read
* @param messages The messages that were read successfully.
* @param messagesRead The length of messages read successfully.
*/
@SuppressWarnings("PMD.ArrayIsStoredDirectly")
public CANStreamOverflowException(CANStreamMessage[] messages, int messagesRead) {
Expand All @@ -27,11 +32,22 @@ public CANStreamOverflowException(CANStreamMessage[] messages, int messagesRead)
this.m_messagesRead = messagesRead;
}

/**
* Gets the messages that were successfully read. Use {@link #getMessagesRead()} to determine how
* many messages in the returned array are valid.
*
* @return the messages
*/
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public CANStreamMessage[] getMessages() {
return m_messages;
}

/**
* Gets the count of messages that were successfully read.
*
* @return count of messages
*/
public int getMessagesRead() {
return m_messagesRead;
}
Expand Down
Loading