WPILibC++ 2025.0.0-alpha-1-14-g3b6f38d
DriverStationData.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 <cstddef>
8
9#include <wpi/string.h>
10
12#include "hal/Types.h"
14
15typedef void (*HAL_JoystickAxesCallback)(const char* name, void* param,
16 int32_t joystickNum,
17 const HAL_JoystickAxes* axes);
18typedef void (*HAL_JoystickPOVsCallback)(const char* name, void* param,
19 int32_t joystickNum,
20 const HAL_JoystickPOVs* povs);
21typedef void (*HAL_JoystickButtonsCallback)(const char* name, void* param,
22 int32_t joystickNum,
23 const HAL_JoystickButtons* buttons);
25 const char* name, void* param, int32_t joystickNum,
26 const HAL_JoystickDescriptor* descriptor);
27typedef void (*HAL_JoystickOutputsCallback)(const char* name, void* param,
28 int32_t joystickNum,
29 int64_t outputs, int32_t leftRumble,
30 int32_t rightRumble);
31typedef void (*HAL_MatchInfoCallback)(const char* name, void* param,
32 const HAL_MatchInfo* info);
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
40 void* param,
41 HAL_Bool initialNotify);
45
47 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
51
53 void* param,
54 HAL_Bool initialNotify);
58
60 void* param,
61 HAL_Bool initialNotify);
65
67 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
71
73 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
77
79 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
83 HAL_AllianceStationID allianceStationId);
84
86 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
89void HALSIM_SetDriverStationMatchTime(double matchTime);
90
91int32_t HALSIM_RegisterJoystickAxesCallback(int32_t joystickNum,
93 void* param,
94 HAL_Bool initialNotify);
96void HALSIM_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes);
97void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
98
99int32_t HALSIM_RegisterJoystickPOVsCallback(int32_t joystickNum,
101 void* param,
102 HAL_Bool initialNotify);
104void HALSIM_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
105void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
106
108 int32_t joystickNum, HAL_JoystickButtonsCallback callback, void* param,
109 HAL_Bool initialNotify);
111void HALSIM_GetJoystickButtons(int32_t joystickNum,
112 HAL_JoystickButtons* buttons);
113void HALSIM_SetJoystickButtons(int32_t joystickNum,
114 const HAL_JoystickButtons* buttons);
115
117 int32_t joystickNum, HAL_JoystickDescriptorCallback callback, void* param,
118 HAL_Bool initialNotify);
120void HALSIM_GetJoystickDescriptor(int32_t joystickNum,
121 HAL_JoystickDescriptor* descriptor);
122void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
123 const HAL_JoystickDescriptor* descriptor);
124
126 int32_t joystickNum, HAL_JoystickOutputsCallback callback, void* param,
127 HAL_Bool initialNotify);
129void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
130 int32_t* leftRumble, int32_t* rightRumble);
131void HALSIM_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
132 int32_t leftRumble, int32_t rightRumble);
133
135 void* param, HAL_Bool initialNotify);
139
140void HALSIM_SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state);
141void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value);
142void HALSIM_SetJoystickPOV(int32_t stick, int32_t pov, int32_t value);
143void HALSIM_SetJoystickButtonsValue(int32_t stick, uint32_t buttons);
144void HALSIM_SetJoystickAxisCount(int32_t stick, int32_t count);
145void HALSIM_SetJoystickPOVCount(int32_t stick, int32_t count);
146void HALSIM_SetJoystickButtonCount(int32_t stick, int32_t count);
147void HALSIM_GetJoystickCounts(int32_t stick, int32_t* axisCount,
148 int32_t* buttonCount, int32_t* povCount);
149
150void HALSIM_SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox);
151void HALSIM_SetJoystickType(int32_t stick, int32_t type);
152void HALSIM_SetJoystickName(int32_t stick, const struct WPI_String* name);
153void HALSIM_SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type);
154
155void HALSIM_SetGameSpecificMessage(const struct WPI_String* message);
158void HALSIM_SetMatchNumber(int32_t matchNumber);
159void HALSIM_SetReplayNumber(int32_t replayNumber);
160
162 void* param,
163 HAL_Bool initialNotify);
164
166 void* param,
167 HAL_Bool initialNotify);
170
171#ifdef __cplusplus
172} // extern "C"
173#endif
void HALSIM_SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox)
void HALSIM_CancelJoystickOutputsCallback(int32_t uid)
void HALSIM_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs *povs)
void HALSIM_CancelDriverStationDsAttachedCallback(int32_t uid)
void HALSIM_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes *axes)
void HALSIM_CancelJoystickAxesCallback(int32_t uid)
void HALSIM_CancelDriverStationEnabledCallback(int32_t uid)
int32_t HALSIM_RegisterDriverStationTestCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetDriverStationMatchTime(double matchTime)
void HALSIM_SetDriverStationAutonomous(HAL_Bool autonomous)
int32_t HALSIM_RegisterJoystickButtonsCallback(int32_t joystickNum, HAL_JoystickButtonsCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetEventName(const struct WPI_String *name)
int32_t HALSIM_RegisterJoystickPOVsCallback(int32_t joystickNum, HAL_JoystickPOVsCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_GetJoystickDescriptor(int32_t joystickNum, HAL_JoystickDescriptor *descriptor)
void HALSIM_SetDriverStationAllianceStationId(HAL_AllianceStationID allianceStationId)
HAL_Bool HALSIM_GetDriverStationDsAttached(void)
void(* HAL_JoystickOutputsCallback)(const char *name, void *param, int32_t joystickNum, int64_t outputs, int32_t leftRumble, int32_t rightRumble)
Definition: DriverStationData.h:27
int32_t HALSIM_RegisterDriverStationNewDataCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state)
int32_t HALSIM_RegisterDriverStationMatchTimeCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
HAL_Bool HALSIM_GetDriverStationEnabled(void)
void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs *povs)
HAL_Bool HALSIM_GetDriverStationEStop(void)
void HALSIM_GetMatchInfo(HAL_MatchInfo *info)
void HALSIM_SetMatchInfo(const HAL_MatchInfo *info)
void(* HAL_MatchInfoCallback)(const char *name, void *param, const HAL_MatchInfo *info)
Definition: DriverStationData.h:31
int32_t HALSIM_RegisterJoystickOutputsCallback(int32_t joystickNum, HAL_JoystickOutputsCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetDriverStationFmsAttached(HAL_Bool fmsAttached)
HAL_Bool HALSIM_GetDriverStationAutonomous(void)
void(* HAL_JoystickPOVsCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickPOVs *povs)
Definition: DriverStationData.h:18
void HALSIM_CancelMatchInfoCallback(int32_t uid)
void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value)
void(* HAL_JoystickDescriptorCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickDescriptor *descriptor)
Definition: DriverStationData.h:24
HAL_Bool HALSIM_GetDriverStationFmsAttached(void)
int32_t HALSIM_RegisterJoystickAxesCallback(int32_t joystickNum, HAL_JoystickAxesCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickAxisCount(int32_t stick, int32_t count)
void HALSIM_SetJoystickType(int32_t stick, int32_t type)
void HALSIM_SetMatchType(HAL_MatchType type)
int32_t HALSIM_RegisterJoystickDescriptorCallback(int32_t joystickNum, HAL_JoystickDescriptorCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickPOVCount(int32_t stick, int32_t count)
void HALSIM_SetDriverStationTest(HAL_Bool test)
HAL_AllianceStationID HALSIM_GetDriverStationAllianceStationId(void)
void HALSIM_CancelJoystickDescriptorCallback(int32_t uid)
void HALSIM_CancelDriverStationAllianceStationIdCallback(int32_t uid)
void HALSIM_GetJoystickCounts(int32_t stick, int32_t *axisCount, int32_t *buttonCount, int32_t *povCount)
int32_t HALSIM_RegisterDriverStationFmsAttachedCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_CancelDriverStationTestCallback(int32_t uid)
void HALSIM_SetMatchNumber(int32_t matchNumber)
void HALSIM_SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type)
void HALSIM_SetJoystickButtons(int32_t joystickNum, const HAL_JoystickButtons *buttons)
int32_t HALSIM_RegisterDriverStationAutonomousCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_NotifyDriverStationNewData(void)
void HALSIM_SetJoystickName(int32_t stick, const struct WPI_String *name)
int32_t HALSIM_RegisterDriverStationEStopCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetReplayNumber(int32_t replayNumber)
int32_t HALSIM_RegisterDriverStationEnabledCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void(* HAL_JoystickButtonsCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickButtons *buttons)
Definition: DriverStationData.h:21
void HALSIM_ResetDriverStationData(void)
double HALSIM_GetDriverStationMatchTime(void)
void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t *outputs, int32_t *leftRumble, int32_t *rightRumble)
void HALSIM_SetJoystickButtonCount(int32_t stick, int32_t count)
void HALSIM_GetJoystickButtons(int32_t joystickNum, HAL_JoystickButtons *buttons)
void HALSIM_SetJoystickButtonsValue(int32_t stick, uint32_t buttons)
void HALSIM_SetGameSpecificMessage(const struct WPI_String *message)
void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_CancelDriverStationNewDataCallback(int32_t uid)
int32_t HALSIM_RegisterDriverStationAllianceStationIdCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_CancelDriverStationFmsAttachedCallback(int32_t uid)
void HALSIM_CancelDriverStationMatchTimeCallback(int32_t uid)
void HALSIM_CancelJoystickButtonsCallback(int32_t uid)
HAL_Bool HALSIM_GetDriverStationTest(void)
void HALSIM_SetDriverStationDsAttached(HAL_Bool dsAttached)
void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes *axes)
void HALSIM_CancelDriverStationEStopCallback(int32_t uid)
void(* HAL_JoystickAxesCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickAxes *axes)
Definition: DriverStationData.h:15
void HALSIM_SetDriverStationEnabled(HAL_Bool enabled)
void HALSIM_SetJoystickOutputs(int32_t joystickNum, int64_t outputs, int32_t leftRumble, int32_t rightRumble)
void HALSIM_SetDriverStationEStop(HAL_Bool eStop)
void HALSIM_CancelDriverStationAutonomousCallback(int32_t uid)
void HALSIM_SetJoystickDescriptor(int32_t joystickNum, const HAL_JoystickDescriptor *descriptor)
void HALSIM_CancelJoystickPOVsCallback(int32_t uid)
int32_t HALSIM_RegisterMatchInfoCallback(HAL_MatchInfoCallback callback, void *param, HAL_Bool initialNotify)
int32_t HALSIM_RegisterDriverStationDsAttachedCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickPOV(int32_t stick, int32_t pov, int32_t value)
void(* HAL_NotifyCallback)(const char *name, void *param, const struct HAL_Value *value)
Definition: NotifyListener.h:9
HAL_MatchType
Definition: DriverStationTypes.h:53
HAL_AllianceStationID
Definition: DriverStationTypes.h:43
int32_t HAL_Bool
Definition: Types.h:73
constexpr auto count() -> size_t
Definition: base.h:1278
state
Definition: base.h:2361
type
Definition: base.h:646
constexpr const char * name(const T &)
Definition: DriverStationTypes.h:68
Definition: DriverStationTypes.h:81
Definition: DriverStationTypes.h:87
Definition: DriverStationTypes.h:75
Definition: DriverStationTypes.h:98
A const UTF8 string.
Definition: string.h:14