summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-06-23 15:27:00 +0200
committerGitHub <noreply@github.com>2023-06-23 15:27:00 +0200
commit87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77 (patch)
tree4239b5df2c866aa26e123719fe838bd6eb0e0394 /src/common
parentMerge pull request #10884 from liamwhite/spaghetti-vfs (diff)
parentinput_common: Implement native mifare support (diff)
downloadyuzu-87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77.tar
yuzu-87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77.tar.gz
yuzu-87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77.tar.bz2
yuzu-87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77.tar.lz
yuzu-87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77.tar.xz
yuzu-87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77.tar.zst
yuzu-87b9b5d10fa4a30c8eb56f9de44ba0c24d57ae77.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/input.h43
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 {
NewAmiibo,
WaitingForAmiibo,
AmiiboRemoved,
- NotAnAmiibo,
+ InvalidTagType,
NotSupported,
WrongDeviceState,
WriteFailed,
@@ -218,8 +218,22 @@ struct CameraStatus {
};
struct NfcStatus {
- NfcState state{};
- std::vector<u8> data{};
+ NfcState state{NfcState::Unknown};
+ u8 uuid_length;
+ u8 protocol;
+ u8 tag_type;
+ std::array<u8, 10> uuid;
+};
+
+struct MifareData {
+ u8 command;
+ u8 sector;
+ std::array<u8, 0x6> key;
+ std::array<u8, 0x10> data;
+};
+
+struct MifareRequest {
+ std::array<MifareData, 0x10> data;
};
// List of buttons to be passed to Qt that can be translated
@@ -294,7 +308,7 @@ struct CallbackStatus {
BatteryStatus battery_status{};
VibrationStatus vibration_status{};
CameraFormat camera_status{CameraFormat::None};
- NfcState nfc_status{NfcState::Unknown};
+ NfcStatus nfc_status{};
std::vector<u8> raw_data{};
};
@@ -356,9 +370,30 @@ public:
return NfcState::NotSupported;
}
+ virtual NfcState StartNfcPolling() {
+ return NfcState::NotSupported;
+ }
+
+ virtual NfcState StopNfcPolling() {
+ return NfcState::NotSupported;
+ }
+
+ virtual NfcState ReadAmiiboData([[maybe_unused]] std::vector<u8>& out_data) {
+ return NfcState::NotSupported;
+ }
+
virtual NfcState WriteNfcData([[maybe_unused]] const std::vector<u8>& data) {
return NfcState::NotSupported;
}
+
+ virtual NfcState ReadMifareData([[maybe_unused]] const MifareRequest& request,
+ [[maybe_unused]] MifareRequest& out_data) {
+ return NfcState::NotSupported;
+ }
+
+ virtual NfcState WriteMifareData([[maybe_unused]] const MifareRequest& request) {
+ return NfcState::NotSupported;
+ }
};
/// An abstract class template for a factory that can create input devices.