WPILibC++  2019.1.1-beta-2-41-gd65547e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
DriverStation.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2013-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <stdint.h>
11 
12 #include "hal/DriverStationTypes.h"
13 #include "hal/Types.h"
14 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
37 int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode,
38  const char* details, const char* location,
39  const char* callStack, HAL_Bool printMsg);
40 
49 int32_t HAL_GetControlWord(HAL_ControlWord* controlWord);
50 
57 HAL_AllianceStationID HAL_GetAllianceStation(int32_t* status);
58 
66 int32_t HAL_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes);
67 
75 int32_t HAL_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
76 
84 int32_t HAL_GetJoystickButtons(int32_t joystickNum,
85  HAL_JoystickButtons* buttons);
86 
99 int32_t HAL_GetJoystickDescriptor(int32_t joystickNum,
100  HAL_JoystickDescriptor* desc);
101 
108 HAL_Bool HAL_GetJoystickIsXbox(int32_t joystickNum);
109 
119 int32_t HAL_GetJoystickType(int32_t joystickNum);
120 
131 char* HAL_GetJoystickName(int32_t joystickNum);
132 
138 void HAL_FreeJoystickName(char* name);
139 
150 int32_t HAL_GetJoystickAxisType(int32_t joystickNum, int32_t axis);
151 
161 int32_t HAL_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
162  int32_t leftRumble, int32_t rightRumble);
163 
180 double HAL_GetMatchTime(int32_t* status);
181 
188 int32_t HAL_GetMatchInfo(HAL_MatchInfo* info);
189 
190 #ifndef HAL_USE_LABVIEW
191 
196 void HAL_ReleaseDSMutex(void);
197 
204 HAL_Bool HAL_IsNewControlData(void);
205 
209 void HAL_WaitForDSData(void);
210 
219 HAL_Bool HAL_WaitForDSDataTimeout(double timeout);
220 
226 void HAL_InitializeDriverStation(void);
227 
234 
243 
252 
261 
269 void HAL_ObserveUserProgramTest(void);
270 
271 #endif // HAL_USE_LABVIEW
272 
273 #ifdef __cplusplus
274 } // extern "C"
275 #endif
276 
HAL_Bool HAL_IsNewControlData(void)
Has a new control packet from the driver station arrived since the last time this function was called...
Definition: DriverStationTypes.h:90
Definition: DriverStationTypes.h:101
HAL_Bool HAL_GetJoystickIsXbox(int32_t joystickNum)
Gets is a specific joystick is considered to be an XBox controller.
int32_t HAL_GetJoystickAxisType(int32_t joystickNum, int32_t axis)
Gets the type of a specific joystick axis.
int32_t HAL_GetJoystickButtons(int32_t joystickNum, HAL_JoystickButtons *buttons)
Gets the buttons of a specific joystick.
int32_t HAL_GetJoystickType(int32_t joystickNum)
Gets the type of joystick connected.
int32_t HAL_SetJoystickOutputs(int32_t joystickNum, int64_t outputs, int32_t leftRumble, int32_t rightRumble)
Set joystick outputs.
void HAL_ReleaseDSMutex(void)
Releases the DS Mutex to allow proper shutdown of any threads that are waiting on it...
HAL_AllianceStationID HAL_GetAllianceStation(int32_t *status)
Gets the current alliance station ID.
void HAL_WaitForDSData(void)
Waits for the newest DS packet to arrive.
Definition: DriverStationTypes.h:78
int32_t HAL_GetMatchInfo(HAL_MatchInfo *info)
Gets info about a specific match.
void HAL_ObserveUserProgramStarting(void)
Sets the program starting flag in the DS.
char * HAL_GetJoystickName(int32_t joystickNum)
Gets the name of a joystick.
void HAL_ObserveUserProgramAutonomous(void)
Sets the autonomous enabled flag in the DS.
HAL_Bool HAL_WaitForDSDataTimeout(double timeout)
Waits for the newest DS packet to arrive.
int32_t HAL_GetJoystickDescriptor(int32_t joystickNum, HAL_JoystickDescriptor *desc)
Retrieves the Joystick Descriptor for particular slot.
void HAL_ObserveUserProgramTest(void)
Sets the test mode flag in the DS.
int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode, const char *details, const char *location, const char *callStack, HAL_Bool printMsg)
Sends an error to the driver station.
void HAL_ObserveUserProgramDisabled(void)
Sets the disabled flag in the DS.
int32_t HAL_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes *axes)
Gets the axes of a specific joystick.
Definition: DriverStationTypes.h:84
void HAL_ObserveUserProgramTeleop(void)
Sets the teleoperated enabled flag in the DS.
void HAL_InitializeDriverStation(void)
Initializes the driver station communication.
void HAL_FreeJoystickName(char *name)
Frees a joystick name received with HAL_GetJoystickName.
int32_t HAL_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs *povs)
Gets the POVs of a specific joystick.
double HAL_GetMatchTime(int32_t *status)
Returns the approximate match time.
Definition: DriverStationTypes.h:35
Definition: DriverStationTypes.h:72
int32_t HAL_GetControlWord(HAL_ControlWord *controlWord)
Gets the current control word of the driver station.