mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[hal, wpilib] Add RobotController.getComments() (#4463)
This commit is contained in:
@@ -35,6 +35,12 @@ std::string RobotController::GetSerialNumber() {
|
||||
return std::string(serialNum, len);
|
||||
}
|
||||
|
||||
std::string RobotController::GetComments() {
|
||||
char comments[65];
|
||||
size_t len = HAL_GetComments(comments, sizeof(comments));
|
||||
return std::string(comments, len);
|
||||
}
|
||||
|
||||
uint64_t RobotController::GetFPGATime() {
|
||||
int32_t status = 0;
|
||||
uint64_t time = HAL_GetFPGATime(&status);
|
||||
|
||||
@@ -294,6 +294,16 @@ void RoboRioSim::SetSerialNumber(std::string_view serialNumber) {
|
||||
HALSIM_SetRoboRioSerialNumber(serialNumber.data(), serialNumber.size());
|
||||
}
|
||||
|
||||
std::string RoboRioSim::GetComments() {
|
||||
char comments[65];
|
||||
size_t len = HALSIM_GetRoboRioComments(comments, sizeof(comments));
|
||||
return std::string(comments, len);
|
||||
}
|
||||
|
||||
void RoboRioSim::SetComments(std::string_view comments) {
|
||||
HALSIM_SetRoboRioComments(comments.data(), comments.size());
|
||||
}
|
||||
|
||||
void RoboRioSim::ResetData() {
|
||||
HALSIM_ResetRoboRioData();
|
||||
}
|
||||
|
||||
@@ -45,12 +45,19 @@ class RobotController {
|
||||
static int64_t GetFPGARevision();
|
||||
|
||||
/**
|
||||
* Returns the serial number of the roboRIO.
|
||||
* Return the serial number of the roboRIO.
|
||||
*
|
||||
* @return The serial number of the roboRIO.
|
||||
*/
|
||||
static std::string GetSerialNumber();
|
||||
|
||||
/**
|
||||
* Return the comments from the roboRIO web interface.
|
||||
*
|
||||
* @return The comments from the roboRIO web interface.
|
||||
*/
|
||||
static std::string GetComments();
|
||||
|
||||
/**
|
||||
* Read the microsecond-resolution timer on the FPGA.
|
||||
*
|
||||
|
||||
@@ -433,6 +433,20 @@ class RoboRioSim {
|
||||
*/
|
||||
static void SetSerialNumber(std::string_view serialNumber);
|
||||
|
||||
/**
|
||||
* Get the comments.
|
||||
*
|
||||
* @return The comments.
|
||||
*/
|
||||
static std::string GetComments();
|
||||
|
||||
/**
|
||||
* Set the comments.
|
||||
*
|
||||
* @param comments The comments.
|
||||
*/
|
||||
static void SetComments(std::string_view comments);
|
||||
|
||||
/**
|
||||
* Reset all simulation data.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user