WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
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
10#include "wpi/hal/Types.h"
12#include "wpi/util/string.h"
13
14typedef void (*HAL_OpModeOptionsCallback)(const char* name, void* param,
15 const HAL_OpModeOption* opmodes,
16 int32_t count);
17typedef void (*HAL_JoystickAxesCallback)(const char* name, void* param,
18 int32_t joystickNum,
19 const HAL_JoystickAxes* axes);
20typedef void (*HAL_JoystickPOVsCallback)(const char* name, void* param,
21 int32_t joystickNum,
22 const HAL_JoystickPOVs* povs);
23typedef void (*HAL_JoystickButtonsCallback)(const char* name, void* param,
24 int32_t joystickNum,
25 const HAL_JoystickButtons* buttons);
27 const char* name, void* param, int32_t joystickNum,
28 const HAL_JoystickTouchpads* touchpads);
30 const char* name, void* param, int32_t joystickNum,
31 const HAL_JoystickDescriptor* descriptor);
32typedef void (*HAL_JoystickLedsCallback)(const char* name, void* param,
33 int32_t joystickNum, int32_t leds);
35 const char* name, void* param, int32_t joystickNum, int32_t leftRumble,
36 int32_t rightRumble, int32_t leftTriggerRumble, int32_t rightTriggerRumble);
37typedef void (*HAL_MatchInfoCallback)(const char* name, void* param,
38 const HAL_MatchInfo* info);
39typedef void (*HAL_GameDataCallback)(const char* name, void* param,
40 const HAL_GameData* gameData);
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
47
49 void* param,
50 HAL_Bool initialNotify);
54
56 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
60
62 void* param,
63 HAL_Bool initialNotify);
67
69 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
73
75 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
79
81 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
85 HAL_AllianceStationID allianceStationId);
86
88 HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
91void HALSIM_SetDriverStationMatchTime(double matchTime);
92
94 void* param,
95 HAL_Bool initialNotify);
98void HALSIM_SetDriverStationOpMode(int64_t opmode);
99
101 void* param,
102 HAL_Bool initialNotify);
105
106void HALSIM_FreeOpModeOptionsArray(struct HAL_OpModeOption* arr, size_t length);
107
108int32_t HALSIM_RegisterJoystickAxesCallback(int32_t joystickNum,
110 void* param,
111 HAL_Bool initialNotify);
113void HALSIM_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes);
114void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
115
116int32_t HALSIM_RegisterJoystickPOVsCallback(int32_t joystickNum,
118 void* param,
119 HAL_Bool initialNotify);
121void HALSIM_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
122void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
123
125 int32_t joystickNum, HAL_JoystickButtonsCallback callback, void* param,
126 HAL_Bool initialNotify);
128void HALSIM_GetJoystickButtons(int32_t joystickNum,
129 HAL_JoystickButtons* buttons);
130void HALSIM_SetJoystickButtons(int32_t joystickNum,
131 const HAL_JoystickButtons* buttons);
132
134 int32_t joystickNum, HAL_JoystickTouchpadsCallback callback, void* param,
135 HAL_Bool initialNotify);
137void HALSIM_GetJoystickTouchpads(int32_t joystickNum,
138 HAL_JoystickTouchpads* touchpads);
139void HALSIM_SetJoystickTouchpads(int32_t joystickNum,
140 const HAL_JoystickTouchpads* touchpads);
141
143 int32_t joystickNum, HAL_JoystickDescriptorCallback callback, void* param,
144 HAL_Bool initialNotify);
146void HALSIM_GetJoystickDescriptor(int32_t joystickNum,
147 HAL_JoystickDescriptor* descriptor);
148void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
149 const HAL_JoystickDescriptor* descriptor);
150
151int32_t HALSIM_RegisterJoystickLedsCallback(int32_t joystickNum,
153 void* param,
154 HAL_Bool initialNotify);
156void HALSIM_GetJoystickLeds(int32_t joystickNum, int32_t* leds);
157void HALSIM_SetJoystickLeds(int32_t joystickNum, int32_t leds);
158
160 int32_t joystickNum, HAL_JoystickRumblesCallback callback, void* param,
161 HAL_Bool initialNotify);
163void HALSIM_GetJoystickRumbles(int32_t joystickNum, int32_t* leftRumble,
164 int32_t* rightRumble, int32_t* leftTriggerRumble,
165 int32_t* rightTriggerRumble);
166void HALSIM_SetJoystickRumbles(int32_t joystickNum, int32_t leftRumble,
167 int32_t rightRumble, int32_t leftTriggerRumble,
168 int32_t rightTriggerRumble);
169
171 void* param, HAL_Bool initialNotify);
175
177 void* param, HAL_Bool initialNotify);
180void HALSIM_SetGameData(const HAL_GameData* gameData);
181
182void HALSIM_SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state);
183void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value);
184void HALSIM_SetJoystickPOV(int32_t stick, int32_t pov, HAL_JoystickPOV value);
185void HALSIM_SetJoystickButtonsValue(int32_t stick, uint64_t buttons);
186void HALSIM_SetJoystickAxesAvailable(int32_t stick, uint16_t available);
187void HALSIM_SetJoystickPOVsAvailable(int32_t stick, uint8_t available);
188void HALSIM_SetJoystickButtonsAvailable(int32_t stick, uint64_t available);
189void HALSIM_GetJoystickAvailables(int32_t stick, uint16_t* axesAvailable,
190 uint64_t* buttonsAvailable,
191 uint8_t* povsAvailable);
192void HALSIM_SetJoystickTouchpadCounts(int32_t stick, uint8_t touchpadCount,
193 const uint8_t* fingerCount);
194void HALSIM_SetJoystickTouchpadFinger(int32_t stick, int32_t touchpad,
195 int32_t finger, HAL_Bool down, double x,
196 double y);
197
198void HALSIM_SetJoystickIsGamepad(int32_t stick, HAL_Bool isGamepad);
199void HALSIM_SetJoystickGamepadType(int32_t stick, int32_t type);
200void HALSIM_SetJoystickName(int32_t stick, const struct WPI_String* name);
202 int32_t supportedOutputs);
203
207void HALSIM_SetMatchNumber(int32_t matchNumber);
208void HALSIM_SetReplayNumber(int32_t replayNumber);
209
211 void* param,
212 HAL_Bool initialNotify);
213
215 void* param,
216 HAL_Bool initialNotify);
219
220#ifdef __cplusplus
221} // extern "C"
222#endif
void HALSIM_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs *povs)
void HALSIM_CancelDriverStationDsAttachedCallback(int32_t uid)
void HALSIM_SetJoystickIsGamepad(int32_t stick, HAL_Bool isGamepad)
void HALSIM_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes *axes)
void HALSIM_CancelJoystickAxesCallback(int32_t uid)
void HALSIM_CancelDriverStationEnabledCallback(int32_t uid)
void HALSIM_SetDriverStationMatchTime(double matchTime)
void HALSIM_SetJoystickButtonsValue(int32_t stick, uint64_t buttons)
void HALSIM_SetDriverStationOpMode(int64_t opmode)
int32_t HALSIM_RegisterOpModeOptionsCallback(HAL_OpModeOptionsCallback callback, void *param, HAL_Bool initialNotify)
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)
int32_t HALSIM_RegisterDriverStationNewDataCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state)
void HALSIM_CancelGameDataCallback(int32_t uid)
int32_t HALSIM_RegisterDriverStationMatchTimeCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
HAL_Bool HALSIM_GetDriverStationEnabled(void)
void(* HAL_JoystickTouchpadsCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickTouchpads *touchpads)
Definition DriverStationData.h:26
void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs *povs)
void HALSIM_FreeOpModeOptionsArray(struct HAL_OpModeOption *arr, size_t length)
HAL_Bool HALSIM_GetDriverStationEStop(void)
void HALSIM_GetMatchInfo(HAL_MatchInfo *info)
void HALSIM_SetJoystickTouchpadFinger(int32_t stick, int32_t touchpad, int32_t finger, HAL_Bool down, double x, double y)
void HALSIM_SetMatchInfo(const HAL_MatchInfo *info)
void(* HAL_MatchInfoCallback)(const char *name, void *param, const HAL_MatchInfo *info)
Definition DriverStationData.h:37
void HALSIM_SetDriverStationFmsAttached(HAL_Bool fmsAttached)
void HALSIM_CancelOpModeOptionsCallback(int32_t uid)
int32_t HALSIM_RegisterDriverStationOpModeCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickGamepadType(int32_t stick, int32_t type)
void(* HAL_JoystickPOVsCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickPOVs *povs)
Definition DriverStationData.h:20
int32_t HALSIM_RegisterJoystickLedsCallback(int32_t joystickNum, HAL_JoystickLedsCallback callback, void *param, HAL_Bool initialNotify)
int32_t HALSIM_RegisterJoystickRumblesCallback(int32_t joystickNum, HAL_JoystickRumblesCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_CancelMatchInfoCallback(int32_t uid)
void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value)
void HALSIM_GetJoystickLeds(int32_t joystickNum, int32_t *leds)
void(* HAL_JoystickDescriptorCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickDescriptor *descriptor)
Definition DriverStationData.h:29
HAL_Bool HALSIM_GetDriverStationFmsAttached(void)
int32_t HALSIM_RegisterJoystickAxesCallback(int32_t joystickNum, HAL_JoystickAxesCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetDriverStationRobotMode(HAL_RobotMode mode)
void HALSIM_SetMatchType(HAL_MatchType type)
int32_t HALSIM_RegisterJoystickDescriptorCallback(int32_t joystickNum, HAL_JoystickDescriptorCallback callback, void *param, HAL_Bool initialNotify)
HAL_AllianceStationID HALSIM_GetDriverStationAllianceStationId(void)
void HALSIM_SetJoystickPOVsAvailable(int32_t stick, uint8_t available)
void HALSIM_CancelJoystickDescriptorCallback(int32_t uid)
void HALSIM_CancelDriverStationAllianceStationIdCallback(int32_t uid)
void(* HAL_OpModeOptionsCallback)(const char *name, void *param, const HAL_OpModeOption *opmodes, int32_t count)
Definition DriverStationData.h:14
int32_t HALSIM_RegisterDriverStationFmsAttachedCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
HAL_RobotMode HALSIM_GetDriverStationRobotMode(void)
void HALSIM_SetMatchNumber(int32_t matchNumber)
void HALSIM_SetJoystickButtons(int32_t joystickNum, const HAL_JoystickButtons *buttons)
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_GetJoystickAvailables(int32_t stick, uint16_t *axesAvailable, uint64_t *buttonsAvailable, uint8_t *povsAvailable)
void HALSIM_SetReplayNumber(int32_t replayNumber)
void HALSIM_SetJoystickButtonsAvailable(int32_t stick, uint64_t available)
void HALSIM_CancelJoystickLedsCallback(int32_t uid)
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:23
void HALSIM_ResetDriverStationData(void)
double HALSIM_GetDriverStationMatchTime(void)
int32_t HALSIM_RegisterDriverStationRobotModeCallback(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickRumbles(int32_t joystickNum, int32_t leftRumble, int32_t rightRumble, int32_t leftTriggerRumble, int32_t rightTriggerRumble)
int64_t HALSIM_GetDriverStationOpMode(void)
void HALSIM_SetJoystickTouchpads(int32_t joystickNum, const HAL_JoystickTouchpads *touchpads)
void HALSIM_GetJoystickButtons(int32_t joystickNum, HAL_JoystickButtons *buttons)
int32_t HALSIM_RegisterGameDataCallback(HAL_GameDataCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_GetGameData(HAL_GameData *gameData)
void HALSIM_GetJoystickRumbles(int32_t joystickNum, int32_t *leftRumble, int32_t *rightRumble, int32_t *leftTriggerRumble, int32_t *rightTriggerRumble)
void HALSIM_SetJoystickAxesAvailable(int32_t stick, uint16_t available)
struct HAL_OpModeOption * HALSIM_GetOpModeOptions(int32_t *len)
void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetGameData(const HAL_GameData *gameData)
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_CancelJoystickTouchpadsCallback(int32_t uid)
void HALSIM_CancelJoystickButtonsCallback(int32_t uid)
void HALSIM_CancelDriverStationOpModeCallback(int32_t uid)
void HALSIM_SetDriverStationDsAttached(HAL_Bool dsAttached)
void HALSIM_SetJoystickTouchpadCounts(int32_t stick, uint8_t touchpadCount, const uint8_t *fingerCount)
void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes *axes)
void HALSIM_CancelJoystickRumblesCallback(int32_t uid)
void(* HAL_JoystickRumblesCallback)(const char *name, void *param, int32_t joystickNum, int32_t leftRumble, int32_t rightRumble, int32_t leftTriggerRumble, int32_t rightTriggerRumble)
Definition DriverStationData.h:34
void HALSIM_CancelDriverStationEStopCallback(int32_t uid)
void(* HAL_JoystickAxesCallback)(const char *name, void *param, int32_t joystickNum, const HAL_JoystickAxes *axes)
Definition DriverStationData.h:17
void HALSIM_CancelDriverStationRobotModeCallback(int32_t uid)
void HALSIM_SetDriverStationEnabled(HAL_Bool enabled)
void(* HAL_JoystickLedsCallback)(const char *name, void *param, int32_t joystickNum, int32_t leds)
Definition DriverStationData.h:32
void HALSIM_SetGameDataString(const struct WPI_String *name)
void(* HAL_GameDataCallback)(const char *name, void *param, const HAL_GameData *gameData)
Definition DriverStationData.h:39
void HALSIM_SetDriverStationEStop(HAL_Bool eStop)
void HALSIM_SetJoystickDescriptor(int32_t joystickNum, const HAL_JoystickDescriptor *descriptor)
void HALSIM_SetJoystickSupportedOutputs(int32_t stick, int32_t supportedOutputs)
void HALSIM_CancelJoystickPOVsCallback(int32_t uid)
int32_t HALSIM_RegisterJoystickTouchpadsCallback(int32_t joystickNum, HAL_JoystickTouchpadsCallback callback, void *param, HAL_Bool initialNotify)
void HALSIM_SetJoystickLeds(int32_t joystickNum, int32_t leds)
void HALSIM_GetJoystickTouchpads(int32_t joystickNum, HAL_JoystickTouchpads *touchpads)
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, HAL_JoystickPOV value)
void(* HAL_NotifyCallback)(const char *name, void *param, const struct HAL_Value *value)
Definition NotifyListener.h:9
@ name
Definition base.h:690
HAL_MatchType
Definition DriverStationTypes.h:48
HAL_RobotMode
Definition DriverStationTypes.h:55
HAL_AllianceStationID
Definition DriverStationTypes.h:31
int32_t HAL_Bool
Definition Types.h:75
Definition DriverStationTypes.h:152
Definition DriverStationTypes.h:93
Definition DriverStationTypes.h:127
Definition DriverStationTypes.h:157
Definition DriverStationTypes.h:121
Definition DriverStationTypes.h:146
Definition DriverStationTypes.h:165
Definition DriverStationTypes.h:177
A const UTF8 string.
Definition string.h:12