WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
AlertData.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <stdint.h>
8
9#include "wpi/hal/Types.h"
10#include "wpi/util/string.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/** Information about an alert. */
21 int64_t activeStartTime; // 0 if not active
22 int32_t level; // HAL_AlertLevel
23};
24
25/**
26 * Gets the number of alerts. Note: this is not guaranteed to be consistent
27 * with the number of alerts returned by HALSIM_GetAlerts, so the latter's
28 * return value should be used to determine how many alerts were actually filled
29 * in.
30 *
31 * @return the number of alerts
32 */
33int32_t HALSIM_GetNumAlerts(void);
34
35/**
36 * Gets detailed information about each alert.
37 *
38 * @param arr array of information to be filled
39 * @param length length of arr
40 * @return Number of alerts; note: may be larger or smaller than passed-in
41 * length
42 */
43int32_t HALSIM_GetAlerts(struct HALSIM_AlertInfo* arr, int32_t length);
44
45/**
46 * Frees an array of alert information returned by HALSIM_GetAlerts.
47 *
48 * @param arr array to free
49 * @param length number of alerts in arr (as returned by HALSIM_GetAlerts)
50 */
51void HALSIM_FreeAlerts(struct HALSIM_AlertInfo* arr, int32_t length);
52
53/**
54 * Resets all alert simulation data.
55 */
57
58#ifdef __cplusplus
59} // extern "C"
60#endif
void HALSIM_FreeAlerts(struct HALSIM_AlertInfo *arr, int32_t length)
Frees an array of alert information returned by HALSIM_GetAlerts.
void HALSIM_ResetAlertData(void)
Resets all alert simulation data.
int32_t HALSIM_GetAlerts(struct HALSIM_AlertInfo *arr, int32_t length)
Gets detailed information about each alert.
int32_t HALSIM_GetNumAlerts(void)
Gets the number of alerts.
HAL_Handle HAL_AlertHandle
Definition Types.h:19
Information about an alert.
Definition AlertData.h:17
struct WPI_String text
Definition AlertData.h:20
int64_t activeStartTime
Definition AlertData.h:21
int32_t level
Definition AlertData.h:22
HAL_AlertHandle handle
Definition AlertData.h:18
struct WPI_String group
Definition AlertData.h:19
A const UTF8 string.
Definition string.h:12