diff options
author | german77 <juangerman-13@hotmail.com> | 2022-12-26 11:11:01 -0600 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-19 18:05:22 -0600 |
commit | 527dad70976a158e94defc51707347e064a31099 (patch) | |
tree | d9e9e68799d0c051e8e6a8a2dda7170ea911831d /src/common/input.h | |
parent | e1a3bda4d9881cb99c36b64733b814a3bb437f13 (diff) |
input_common: Use DriverResult on all engines
Diffstat (limited to 'src/common/input.h')
-rw-r--r-- | src/common/input.h | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/src/common/input.h b/src/common/input.h index 1e5ba038d..d61cd7ca8 100644 --- a/src/common/input.h +++ b/src/common/input.h @@ -64,20 +64,19 @@ enum class CameraFormat { None, }; -// Vibration reply from the controller -enum class VibrationError { - None, - NotSupported, - Disabled, +// Different results that can happen from a device request +enum class DriverResult { + Success, + WrongReply, + Timeout, + UnsupportedControllerType, + HandleInUse, + ErrorReadingData, + ErrorWritingData, + NoDeviceDetected, InvalidHandle, - Unknown, -}; - -// Polling mode reply from the controller -enum class PollingError { - None, NotSupported, - InvalidHandle, + Disabled, Unknown, }; @@ -94,13 +93,6 @@ enum class NfcState { Unknown, }; -// Ir camera reply from the controller -enum class CameraError { - None, - NotSupported, - Unknown, -}; - // Hint for amplification curve to be used enum class VibrationAmplificationType { Linear, @@ -336,22 +328,24 @@ class OutputDevice { public: virtual ~OutputDevice() = default; - virtual void SetLED([[maybe_unused]] const LedStatus& led_status) {} + virtual DriverResult SetLED([[maybe_unused]] const LedStatus& led_status) { + return DriverResult::NotSupported; + } - virtual VibrationError SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) { - return VibrationError::NotSupported; + virtual DriverResult SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) { + return DriverResult::NotSupported; } virtual bool IsVibrationEnabled() { return false; } - virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) { - return PollingError::NotSupported; + virtual DriverResult SetPollingMode([[maybe_unused]] PollingMode polling_mode) { + return DriverResult::NotSupported; } - virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { - return CameraError::NotSupported; + virtual DriverResult SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { + return DriverResult::NotSupported; } virtual NfcState SupportsNfc() const { |