[wpilib] Document simulation APIs (#3079)

- Remove sim checkstyle suppression
- Add [[nodiscard]] to C++ register callback functions
- Add a couple of missing sim functions

Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
Co-authored-by: Starlight220 <yotamshlomi@gmail.com>
This commit is contained in:
Peter Johnson
2021-01-11 21:55:45 -08:00
committed by GitHub
parent 26584ff145
commit 9c3b51ca0f
64 changed files with 4516 additions and 199 deletions

View File

@@ -38,30 +38,101 @@ class GenericHIDSim {
*/
void NotifyNewData();
/**
* Set the value of a given button.
*
* @param button the button to set
* @param value the new value
*/
void SetRawButton(int button, bool value);
/**
* Set the value of a given axis.
*
* @param axis the axis to set
* @param value the new value
*/
void SetRawAxis(int axis, double value);
/**
* Set the value of a given POV.
*
* @param pov the POV to set
* @param value the new value
*/
void SetPOV(int pov, int value);
/**
* Set the value of the default POV (port 0).
*
* @param value the new value
*/
void SetPOV(int value);
/**
* Set the axis count of this device.
*
* @param count the new axis count
*/
void SetAxisCount(int count);
/**
* Set the POV count of this device.
*
* @param count the new POV count
*/
void SetPOVCount(int count);
/**
* Set the button count of this device.
*
* @param count the new button count
*/
void SetButtonCount(int count);
/**
* Set the type of this device.
*
* @param type the new device type
*/
void SetType(GenericHID::HIDType type);
/**
* Set the name of this device.
*
* @param name the new device name
*/
void SetName(const char* name);
/**
* Set the type of an axis.
*
* @param axis the axis
* @param type the type
*/
void SetAxisType(int axis, int type);
/**
* Read the output of a button.
*
* @param outputNumber the button number
* @return the value of the button (true = pressed)
*/
bool GetOutput(int outputNumber);
/**
* Get the encoded 16-bit integer that passes button values.
*
* @return the button values
*/
int64_t GetOutputs();
/**
* Get the joystick rumble.
*
* @param type the rumble to read
* @return the rumble value
*/
double GetRumble(GenericHID::RumbleType type);
protected: