diff options
Diffstat (limited to '')
| -rw-r--r-- | src/common/input.h | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/common/input.h b/src/common/input.h index 66fb15f0a..ea30770ae 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -86,7 +86,7 @@ enum class NfcState { | |||
| 86 | NewAmiibo, | 86 | NewAmiibo, |
| 87 | WaitingForAmiibo, | 87 | WaitingForAmiibo, |
| 88 | AmiiboRemoved, | 88 | AmiiboRemoved, |
| 89 | NotAnAmiibo, | 89 | InvalidTagType, |
| 90 | NotSupported, | 90 | NotSupported, |
| 91 | WrongDeviceState, | 91 | WrongDeviceState, |
| 92 | WriteFailed, | 92 | WriteFailed, |
| @@ -218,8 +218,22 @@ struct CameraStatus { | |||
| 218 | }; | 218 | }; |
| 219 | 219 | ||
| 220 | struct NfcStatus { | 220 | struct NfcStatus { |
| 221 | NfcState state{}; | 221 | NfcState state{NfcState::Unknown}; |
| 222 | std::vector<u8> data{}; | 222 | u8 uuid_length; |
| 223 | u8 protocol; | ||
| 224 | u8 tag_type; | ||
| 225 | std::array<u8, 10> uuid; | ||
| 226 | }; | ||
| 227 | |||
| 228 | struct MifareData { | ||
| 229 | u8 command; | ||
| 230 | u8 sector; | ||
| 231 | std::array<u8, 0x6> key; | ||
| 232 | std::array<u8, 0x10> data; | ||
| 233 | }; | ||
| 234 | |||
| 235 | struct MifareRequest { | ||
| 236 | std::array<MifareData, 0x10> data; | ||
| 223 | }; | 237 | }; |
| 224 | 238 | ||
| 225 | // List of buttons to be passed to Qt that can be translated | 239 | // List of buttons to be passed to Qt that can be translated |
| @@ -294,7 +308,7 @@ struct CallbackStatus { | |||
| 294 | BatteryStatus battery_status{}; | 308 | BatteryStatus battery_status{}; |
| 295 | VibrationStatus vibration_status{}; | 309 | VibrationStatus vibration_status{}; |
| 296 | CameraFormat camera_status{CameraFormat::None}; | 310 | CameraFormat camera_status{CameraFormat::None}; |
| 297 | NfcState nfc_status{NfcState::Unknown}; | 311 | NfcStatus nfc_status{}; |
| 298 | std::vector<u8> raw_data{}; | 312 | std::vector<u8> raw_data{}; |
| 299 | }; | 313 | }; |
| 300 | 314 | ||
| @@ -356,9 +370,30 @@ public: | |||
| 356 | return NfcState::NotSupported; | 370 | return NfcState::NotSupported; |
| 357 | } | 371 | } |
| 358 | 372 | ||
| 373 | virtual NfcState StartNfcPolling() { | ||
| 374 | return NfcState::NotSupported; | ||
| 375 | } | ||
| 376 | |||
| 377 | virtual NfcState StopNfcPolling() { | ||
| 378 | return NfcState::NotSupported; | ||
| 379 | } | ||
| 380 | |||
| 381 | virtual NfcState ReadAmiiboData([[maybe_unused]] std::vector<u8>& out_data) { | ||
| 382 | return NfcState::NotSupported; | ||
| 383 | } | ||
| 384 | |||
| 359 | virtual NfcState WriteNfcData([[maybe_unused]] const std::vector<u8>& data) { | 385 | virtual NfcState WriteNfcData([[maybe_unused]] const std::vector<u8>& data) { |
| 360 | return NfcState::NotSupported; | 386 | return NfcState::NotSupported; |
| 361 | } | 387 | } |
| 388 | |||
| 389 | virtual NfcState ReadMifareData([[maybe_unused]] const MifareRequest& request, | ||
| 390 | [[maybe_unused]] MifareRequest& out_data) { | ||
| 391 | return NfcState::NotSupported; | ||
| 392 | } | ||
| 393 | |||
| 394 | virtual NfcState WriteMifareData([[maybe_unused]] const MifareRequest& request) { | ||
| 395 | return NfcState::NotSupported; | ||
| 396 | } | ||
| 362 | }; | 397 | }; |
| 363 | 398 | ||
| 364 | /// An abstract class template for a factory that can create input devices. | 399 | /// An abstract class template for a factory that can create input devices. |