aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-10-02 14:28:43 -0700
committerGitHub <noreply@github.com>2022-10-02 14:28:43 -0700
commit61399de5dbc64ada1c9e5ec3d84be76c215fdc0c (patch)
tree72313f1b749d0771e38dbfcf539121a02d4b9ae0 /src/common
parent80a3a731237472d8d2141243ca322ccf3276483c (diff)
parent1485daff06b7e2aeb7077a4bdb1574956a4c3b82 (diff)
Merge pull request #8955 from german77/amiibo-rewritemainline-0-1188
core: nfp: Rewrite implementation to remove direct access from the frontend
Diffstat (limited to 'src/common')
-rw-r--r--src/common/input.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/common/input.h b/src/common/input.h
index 825b0d650d..bfa0639f5e 100644
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -76,6 +76,19 @@ enum class PollingError {
Unknown,
};
+// Nfc reply from the controller
+enum class NfcState {
+ Success,
+ NewAmiibo,
+ WaitingForAmiibo,
+ AmiiboRemoved,
+ NotAnAmiibo,
+ NotSupported,
+ WrongDeviceState,
+ WriteFailed,
+ Unknown,
+};
+
// Ir camera reply from the controller
enum class CameraError {
None,
@@ -202,6 +215,11 @@ struct CameraStatus {
std::vector<u8> data{};
};
+struct NfcStatus {
+ NfcState state{};
+ std::vector<u8> data{};
+};
+
// List of buttons to be passed to Qt that can be translated
enum class ButtonNames {
Undefined,
@@ -260,6 +278,7 @@ struct CallbackStatus {
BatteryStatus battery_status{};
VibrationStatus vibration_status{};
CameraStatus camera_status{};
+ NfcStatus nfc_status{};
};
// Triggered once every input change
@@ -312,6 +331,14 @@ public:
virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) {
return CameraError::NotSupported;
}
+
+ virtual NfcState SupportsNfc() const {
+ return NfcState::NotSupported;
+ }
+
+ virtual NfcState WriteNfcData([[maybe_unused]] const std::vector<u8>& data) {
+ return NfcState::NotSupported;
+ }
};
/// An abstract class template for a factory that can create input devices.