|
WPILibC++
2020.3.2
|
Functions | |
| HAL_SimDeviceHandle | HAL_CreateSimDevice (const char *name) |
| Creates a simulated device. More... | |
| void | HAL_FreeSimDevice (HAL_SimDeviceHandle handle) |
| Frees a simulated device. More... | |
| HAL_SimValueHandle | HAL_CreateSimValue (HAL_SimDeviceHandle device, const char *name, HAL_Bool readonly, const struct HAL_Value *initialValue) |
| Creates a value on a simulated device. More... | |
| HAL_SimValueHandle | HAL_CreateSimValueDouble (HAL_SimDeviceHandle device, const char *name, HAL_Bool readonly, double initialValue) |
| Creates a double value on a simulated device. More... | |
| HAL_SimValueHandle | HAL_CreateSimValueEnum (HAL_SimDeviceHandle device, const char *name, HAL_Bool readonly, int32_t numOptions, const char **options, int32_t initialValue) |
| Creates an enumerated value on a simulated device. More... | |
| HAL_SimValueHandle | HAL_CreateSimValueBoolean (HAL_SimDeviceHandle device, const char *name, HAL_Bool readonly, HAL_Bool initialValue) |
| Creates a boolean value on a simulated device. More... | |
| void | HAL_GetSimValue (HAL_SimValueHandle handle, struct HAL_Value *value) |
| Gets a simulated value. More... | |
| double | HAL_GetSimValueDouble (HAL_SimValueHandle handle) |
| Gets a simulated value (double). More... | |
| int32_t | HAL_GetSimValueEnum (HAL_SimValueHandle handle) |
| Gets a simulated value (enum). More... | |
| HAL_Bool | HAL_GetSimValueBoolean (HAL_SimValueHandle handle) |
| Gets a simulated value (boolean). More... | |
| void | HAL_SetSimValue (HAL_SimValueHandle handle, const struct HAL_Value *value) |
| Sets a simulated value. More... | |
| void | HAL_SetSimValueDouble (HAL_SimValueHandle handle, double value) |
| Sets a simulated value (double). More... | |
| void | HAL_SetSimValueEnum (HAL_SimValueHandle handle, int32_t value) |
| Sets a simulated value (enum). More... | |
| void | HAL_SetSimValueBoolean (HAL_SimValueHandle handle, HAL_Bool value) |
| Sets a simulated value (boolean). More... | |
HAL Simulator Device Framework. This enables creating simulation-only variables for higher level device access. For example, a device such as a SPI gyro can expose angle and rate variables to enable direct access from simulation extensions or user test code instead of requiring that the SPI bit-level protocol be implemented in simulation code.
| HAL_SimDeviceHandle HAL_CreateSimDevice | ( | const char * | name | ) |
Creates a simulated device.
The device name must be unique. 0 is returned if the device name already exists. If multiple instances of the same device are desired, recommend appending the instance/unique identifer in brackets to the base name, e.g. "device[1]".
0 is returned if not in simulation.
| name | device name |
| HAL_SimValueHandle HAL_CreateSimValue | ( | HAL_SimDeviceHandle | device, |
| const char * | name, | ||
| HAL_Bool | readonly, | ||
| const struct HAL_Value * | initialValue | ||
| ) |
Creates a value on a simulated device.
Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
| device | simulated device handle |
| name | value name |
| readonly | if the value should not be written from simulation side |
| initialValue | initial value |
|
inline |
Creates a boolean value on a simulated device.
Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
| device | simulated device handle |
| name | value name |
| readonly | if the value should not be written from simulation side |
| initialValue | initial value |
|
inline |
Creates a double value on a simulated device.
Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
| device | simulated device handle |
| name | value name |
| readonly | if the value should not be written from simulation side |
| initialValue | initial value |
| HAL_SimValueHandle HAL_CreateSimValueEnum | ( | HAL_SimDeviceHandle | device, |
| const char * | name, | ||
| HAL_Bool | readonly, | ||
| int32_t | numOptions, | ||
| const char ** | options, | ||
| int32_t | initialValue | ||
| ) |
Creates an enumerated value on a simulated device.
Enumerated values are always in the range 0 to numOptions-1.
Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
| device | simulated device handle |
| name | value name |
| readonly | if the value should not be written from simulation side |
| numOptions | number of enumerated value options (length of options) |
| options | array of option descriptions |
| initialValue | initial value (selection) |
| void HAL_FreeSimDevice | ( | HAL_SimDeviceHandle | handle | ) |
Frees a simulated device.
This also allows the same device name to be used again. This also frees all the simulated values created on the device.
| handle | simulated device handle |
| void HAL_GetSimValue | ( | HAL_SimValueHandle | handle, |
| struct HAL_Value * | value | ||
| ) |
Gets a simulated value.
| handle | simulated value handle |
| value | value (output parameter) |
|
inline |
Gets a simulated value (boolean).
| handle | simulated value handle |
|
inline |
Gets a simulated value (double).
| handle | simulated value handle |
|
inline |
Gets a simulated value (enum).
| handle | simulated value handle |
| void HAL_SetSimValue | ( | HAL_SimValueHandle | handle, |
| const struct HAL_Value * | value | ||
| ) |
Sets a simulated value.
| handle | simulated value handle |
| value | the value to set |
|
inline |
Sets a simulated value (boolean).
| handle | simulated value handle |
| value | the value to set |
|
inline |
Sets a simulated value (double).
| handle | simulated value handle |
| value | the value to set |
|
inline |
Sets a simulated value (enum).
| handle | simulated value handle |
| value | the value to set |