diff options
| author | 2023-07-01 15:01:11 -0700 | |
|---|---|---|
| committer | 2023-07-01 15:01:11 -0700 | |
| commit | 98685d48e3cb9f25f6919f004ec62cadf33afad2 (patch) | |
| tree | 9df2ce7f57370641589bfae7196c77b090bcbe0f /src/common/input.h | |
| parent | PR feedback + constification (diff) | |
| parent | Update translations (2023-07-01) (#10972) (diff) | |
| download | yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar.gz yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar.xz yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.zip | |
Merge remote-tracking branch 'origin/master' into ssl
Diffstat (limited to 'src/common/input.h')
| -rw-r--r-- | src/common/input.h | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/src/common/input.h b/src/common/input.h index 66fb15f0a..2c4ccea22 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -75,8 +75,10 @@ enum class DriverResult { | |||
| 75 | ErrorWritingData, | 75 | ErrorWritingData, |
| 76 | NoDeviceDetected, | 76 | NoDeviceDetected, |
| 77 | InvalidHandle, | 77 | InvalidHandle, |
| 78 | InvalidParameters, | ||
| 78 | NotSupported, | 79 | NotSupported, |
| 79 | Disabled, | 80 | Disabled, |
| 81 | Delayed, | ||
| 80 | Unknown, | 82 | Unknown, |
| 81 | }; | 83 | }; |
| 82 | 84 | ||
| @@ -86,7 +88,7 @@ enum class NfcState { | |||
| 86 | NewAmiibo, | 88 | NewAmiibo, |
| 87 | WaitingForAmiibo, | 89 | WaitingForAmiibo, |
| 88 | AmiiboRemoved, | 90 | AmiiboRemoved, |
| 89 | NotAnAmiibo, | 91 | InvalidTagType, |
| 90 | NotSupported, | 92 | NotSupported, |
| 91 | WrongDeviceState, | 93 | WrongDeviceState, |
| 92 | WriteFailed, | 94 | WriteFailed, |
| @@ -218,8 +220,22 @@ struct CameraStatus { | |||
| 218 | }; | 220 | }; |
| 219 | 221 | ||
| 220 | struct NfcStatus { | 222 | struct NfcStatus { |
| 221 | NfcState state{}; | 223 | NfcState state{NfcState::Unknown}; |
| 222 | std::vector<u8> data{}; | 224 | u8 uuid_length; |
| 225 | u8 protocol; | ||
| 226 | u8 tag_type; | ||
| 227 | std::array<u8, 10> uuid; | ||
| 228 | }; | ||
| 229 | |||
| 230 | struct MifareData { | ||
| 231 | u8 command; | ||
| 232 | u8 sector; | ||
| 233 | std::array<u8, 0x6> key; | ||
| 234 | std::array<u8, 0x10> data; | ||
| 235 | }; | ||
| 236 | |||
| 237 | struct MifareRequest { | ||
| 238 | std::array<MifareData, 0x10> data; | ||
| 223 | }; | 239 | }; |
| 224 | 240 | ||
| 225 | // List of buttons to be passed to Qt that can be translated | 241 | // List of buttons to be passed to Qt that can be translated |
| @@ -294,7 +310,7 @@ struct CallbackStatus { | |||
| 294 | BatteryStatus battery_status{}; | 310 | BatteryStatus battery_status{}; |
| 295 | VibrationStatus vibration_status{}; | 311 | VibrationStatus vibration_status{}; |
| 296 | CameraFormat camera_status{CameraFormat::None}; | 312 | CameraFormat camera_status{CameraFormat::None}; |
| 297 | NfcState nfc_status{NfcState::Unknown}; | 313 | NfcStatus nfc_status{}; |
| 298 | std::vector<u8> raw_data{}; | 314 | std::vector<u8> raw_data{}; |
| 299 | }; | 315 | }; |
| 300 | 316 | ||
| @@ -356,9 +372,30 @@ public: | |||
| 356 | return NfcState::NotSupported; | 372 | return NfcState::NotSupported; |
| 357 | } | 373 | } |
| 358 | 374 | ||
| 375 | virtual NfcState StartNfcPolling() { | ||
| 376 | return NfcState::NotSupported; | ||
| 377 | } | ||
| 378 | |||
| 379 | virtual NfcState StopNfcPolling() { | ||
| 380 | return NfcState::NotSupported; | ||
| 381 | } | ||
| 382 | |||
| 383 | virtual NfcState ReadAmiiboData([[maybe_unused]] std::vector<u8>& out_data) { | ||
| 384 | return NfcState::NotSupported; | ||
| 385 | } | ||
| 386 | |||
| 359 | virtual NfcState WriteNfcData([[maybe_unused]] const std::vector<u8>& data) { | 387 | virtual NfcState WriteNfcData([[maybe_unused]] const std::vector<u8>& data) { |
| 360 | return NfcState::NotSupported; | 388 | return NfcState::NotSupported; |
| 361 | } | 389 | } |
| 390 | |||
| 391 | virtual NfcState ReadMifareData([[maybe_unused]] const MifareRequest& request, | ||
| 392 | [[maybe_unused]] MifareRequest& out_data) { | ||
| 393 | return NfcState::NotSupported; | ||
| 394 | } | ||
| 395 | |||
| 396 | virtual NfcState WriteMifareData([[maybe_unused]] const MifareRequest& request) { | ||
| 397 | return NfcState::NotSupported; | ||
| 398 | } | ||
| 362 | }; | 399 | }; |
| 363 | 400 | ||
| 364 | /// An abstract class template for a factory that can create input devices. | 401 | /// An abstract class template for a factory that can create input devices. |