summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfc/nfc_user.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2022-11-09 20:04:11 +0100
committergerman77 <juangerman-13@hotmail.com>2022-11-19 15:51:59 +0100
commit327d225c3e9da802a31735edc113891960942a3e (patch)
tree7febe12f94deba0de9217cff8ee48bc14991aead /src/core/hle/service/nfc/nfc_user.h
parentMerge pull request #9226 from Kelebek1/regs_regression (diff)
downloadyuzu-327d225c3e9da802a31735edc113891960942a3e.tar
yuzu-327d225c3e9da802a31735edc113891960942a3e.tar.gz
yuzu-327d225c3e9da802a31735edc113891960942a3e.tar.bz2
yuzu-327d225c3e9da802a31735edc113891960942a3e.tar.lz
yuzu-327d225c3e9da802a31735edc113891960942a3e.tar.xz
yuzu-327d225c3e9da802a31735edc113891960942a3e.tar.zst
yuzu-327d225c3e9da802a31735edc113891960942a3e.zip
Diffstat (limited to 'src/core/hle/service/nfc/nfc_user.h')
-rw-r--r--src/core/hle/service/nfc/nfc_user.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/core/hle/service/nfc/nfc_user.h b/src/core/hle/service/nfc/nfc_user.h
new file mode 100644
index 000000000..a5a4f12f9
--- /dev/null
+++ b/src/core/hle/service/nfc/nfc_user.h
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <array>
+#include <memory>
+#include <optional>
+
+#include "core/hle/service/kernel_helpers.h"
+#include "core/hle/service/service.h"
+
+namespace Service::NFC {
+class NfcDevice;
+
+class IUser final : public ServiceFramework<IUser> {
+public:
+ explicit IUser(Core::System& system_);
+ ~IUser();
+
+private:
+ enum class State : u32 {
+ NonInitialized,
+ Initialized,
+ };
+
+ void Initialize(Kernel::HLERequestContext& ctx);
+ void Finalize(Kernel::HLERequestContext& ctx);
+ void GetState(Kernel::HLERequestContext& ctx);
+ void IsNfcEnabled(Kernel::HLERequestContext& ctx);
+ void ListDevices(Kernel::HLERequestContext& ctx);
+ void GetDeviceState(Kernel::HLERequestContext& ctx);
+ void GetNpadId(Kernel::HLERequestContext& ctx);
+ void AttachAvailabilityChangeEvent(Kernel::HLERequestContext& ctx);
+ void StartDetection(Kernel::HLERequestContext& ctx);
+ void StopDetection(Kernel::HLERequestContext& ctx);
+ void GetTagInfo(Kernel::HLERequestContext& ctx);
+ void AttachActivateEvent(Kernel::HLERequestContext& ctx);
+ void AttachDeactivateEvent(Kernel::HLERequestContext& ctx);
+ void SendCommandByPassThrough(Kernel::HLERequestContext& ctx);
+
+ std::optional<std::shared_ptr<NfcDevice>> GetNfcDevice(u64 handle);
+
+ KernelHelpers::ServiceContext service_context;
+
+ std::array<std::shared_ptr<NfcDevice>, 10> devices{};
+
+ State state{State::NonInitialized};
+ Kernel::KEvent* availability_change_event;
+};
+
+} // namespace Service::NFC