Class to control a simulated generic joystick.
More...
#include <frc/simulation/GenericHIDSim.h>
|
| GenericHIDSim (const GenericHID &joystick) |
| Constructs from a GenericHID object.
|
|
| GenericHIDSim (int port) |
| Constructs from a joystick port number.
|
|
void | NotifyNewData () |
| Updates joystick data so that new values are visible to the user program.
|
|
void | SetRawButton (int button, bool value) |
| Set the value of a given button.
|
|
void | SetRawAxis (int axis, double value) |
| Set the value of a given axis.
|
|
void | SetPOV (int pov, int value) |
| Set the value of a given POV.
|
|
void | SetPOV (int value) |
| Set the value of the default POV (port 0).
|
|
void | SetAxisCount (int count) |
| Set the axis count of this device.
|
|
void | SetPOVCount (int count) |
| Set the POV count of this device.
|
|
void | SetButtonCount (int count) |
| Set the button count of this device.
|
|
void | SetType (GenericHID::HIDType type) |
| Set the type of this device.
|
|
void | SetName (const char *name) |
| Set the name of this device.
|
|
void | SetAxisType (int axis, int type) |
| Set the type of an axis.
|
|
bool | GetOutput (int outputNumber) |
| Read the output of a button.
|
|
int64_t | GetOutputs () |
| Get the encoded 16-bit integer that passes button values.
|
|
double | GetRumble (GenericHID::RumbleType type) |
| Get the joystick rumble.
|
|
Class to control a simulated generic joystick.
◆ GenericHIDSim() [1/2]
frc::sim::GenericHIDSim::GenericHIDSim |
( |
const GenericHID & | joystick | ) |
|
|
explicit |
Constructs from a GenericHID object.
- Parameters
-
joystick | joystick to simulate |
◆ GenericHIDSim() [2/2]
frc::sim::GenericHIDSim::GenericHIDSim |
( |
int | port | ) |
|
|
explicit |
Constructs from a joystick port number.
- Parameters
-
◆ GetOutput()
bool frc::sim::GenericHIDSim::GetOutput |
( |
int | outputNumber | ) |
|
Read the output of a button.
- Parameters
-
outputNumber | the button number |
- Returns
- the value of the button (true = pressed)
◆ GetOutputs()
int64_t frc::sim::GenericHIDSim::GetOutputs |
( |
| ) |
|
Get the encoded 16-bit integer that passes button values.
- Returns
- the button values
◆ GetRumble()
Get the joystick rumble.
- Parameters
-
- Returns
- the rumble value
◆ NotifyNewData()
void frc::sim::GenericHIDSim::NotifyNewData |
( |
| ) |
|
Updates joystick data so that new values are visible to the user program.
◆ SetAxisCount()
void frc::sim::GenericHIDSim::SetAxisCount |
( |
int | count | ) |
|
Set the axis count of this device.
- Parameters
-
◆ SetAxisType()
void frc::sim::GenericHIDSim::SetAxisType |
( |
int | axis, |
|
|
int | type ) |
Set the type of an axis.
- Parameters
-
axis | the axis |
type | the type |
◆ SetButtonCount()
void frc::sim::GenericHIDSim::SetButtonCount |
( |
int | count | ) |
|
Set the button count of this device.
- Parameters
-
count | the new button count |
◆ SetName()
void frc::sim::GenericHIDSim::SetName |
( |
const char * | name | ) |
|
Set the name of this device.
- Parameters
-
◆ SetPOV() [1/2]
void frc::sim::GenericHIDSim::SetPOV |
( |
int | pov, |
|
|
int | value ) |
Set the value of a given POV.
- Parameters
-
pov | the POV to set |
value | the new value |
◆ SetPOV() [2/2]
void frc::sim::GenericHIDSim::SetPOV |
( |
int | value | ) |
|
Set the value of the default POV (port 0).
- Parameters
-
◆ SetPOVCount()
void frc::sim::GenericHIDSim::SetPOVCount |
( |
int | count | ) |
|
Set the POV count of this device.
- Parameters
-
◆ SetRawAxis()
void frc::sim::GenericHIDSim::SetRawAxis |
( |
int | axis, |
|
|
double | value ) |
Set the value of a given axis.
- Parameters
-
axis | the axis to set |
value | the new value |
◆ SetRawButton()
void frc::sim::GenericHIDSim::SetRawButton |
( |
int | button, |
|
|
bool | value ) |
Set the value of a given button.
- Parameters
-
button | the button to set |
value | the new value |
◆ SetType()
Set the type of this device.
- Parameters
-
◆ m_port
int frc::sim::GenericHIDSim::m_port |
|
protected |
The documentation for this class was generated from the following file: