WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Alert Functions

Enumerations

enum  HAL_AlertLevel : int32_t {
  HAL_ALERT_HIGH = 0 , HAL_ALERT_ERROR = HAL_ALERT_HIGH , HAL_ALERT_MEDIUM = 1 , HAL_ALERT_WARNING = HAL_ALERT_MEDIUM ,
  HAL_ALERT_LOW = 2 , HAL_ALERT_INFO = HAL_ALERT_LOW
}
 Represents an alert's level of urgency. More...

Functions

HAL_AlertHandle HAL_CreateAlert (const struct WPI_String *group, const struct WPI_String *text, int32_t level, int32_t *status)
 Creates an alert.
void HAL_DestroyAlert (HAL_AlertHandle alertHandle)
 Destroys an alert.
void HAL_SetAlertActive (HAL_AlertHandle alertHandle, HAL_Bool active, int32_t *status)
 Sets whether the alert should be displayed.
HAL_Bool HAL_IsAlertActive (HAL_AlertHandle alertHandle, int32_t *status)
 Checks if an alert is active.
void HAL_SetAlertText (HAL_AlertHandle alertHandle, const struct WPI_String *text, int32_t *status)
 Updates the text of an alert.
void HAL_GetAlertText (HAL_AlertHandle alertHandle, struct WPI_String *text, int32_t *status)
 Gets the text of an alert.

Detailed Description

Enumeration Type Documentation

◆ HAL_AlertLevel

enum HAL_AlertLevel : int32_t

Represents an alert's level of urgency.

Enumerator
HAL_ALERT_HIGH 

High priority alert - displayed first with a red "X" symbol.

Use this type for problems which will seriously affect the robot's functionality and thus require immediate attention.

HAL_ALERT_ERROR 
HAL_ALERT_MEDIUM 

Medium priority alert - displayed second with a yellow "!" symbol.

Use this type for problems which could affect the robot's functionality but do not necessarily require immediate attention.

HAL_ALERT_WARNING 
HAL_ALERT_LOW 

Low priority alert - displayed last with a green "i" symbol.

Use this type for problems which are unlikely to affect the robot's functionality, or any other alerts which do not fall under the other categories.

HAL_ALERT_INFO 

Function Documentation

◆ HAL_CreateAlert()

HAL_AlertHandle HAL_CreateAlert ( const struct WPI_String * group,
const struct WPI_String * text,
int32_t level,
int32_t * status )

Creates an alert.

Parameters
groupGroup identifier
textText to be displayed when the alert is active
levelAlert urgency level (HAL_AlertLevel)
[out]statusError status variable. 0 on success.
Returns
the created alert

◆ HAL_DestroyAlert()

void HAL_DestroyAlert ( HAL_AlertHandle alertHandle)

Destroys an alert.

Parameters
alertHandlethe alert handle

◆ HAL_GetAlertText()

void HAL_GetAlertText ( HAL_AlertHandle alertHandle,
struct WPI_String * text,
int32_t * status )

Gets the text of an alert.

Parameters
alertHandlethe alert handle
textpointer to a WPI_String to be filled with the current text
[out]statusError status variable. 0 on success.

◆ HAL_IsAlertActive()

HAL_Bool HAL_IsAlertActive ( HAL_AlertHandle alertHandle,
int32_t * status )

Checks if an alert is active.

Parameters
alertHandlethe alert handle
[out]statusError status variable. 0 on success.
Returns
true if the alert is active

◆ HAL_SetAlertActive()

void HAL_SetAlertActive ( HAL_AlertHandle alertHandle,
HAL_Bool active,
int32_t * status )

Sets whether the alert should be displayed.

This method can be safely be called periodically.

Parameters
alertHandlethe alert handle
activetrue to display the alert, false to hide it
[out]statusError status variable. 0 on success.

◆ HAL_SetAlertText()

void HAL_SetAlertText ( HAL_AlertHandle alertHandle,
const struct WPI_String * text,
int32_t * status )

Updates the text of an alert.

Use this method to dynamically change the displayed alert, such as including more details about the detected problem.

Parameters
alertHandlethe alert handle
textnew text to be displayed when the alert is active
[out]statusError status variable. 0 on success.