summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfc/nfc_interface.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-04-15 01:46:20 +0200
committergerman77 <juangerman-13@hotmail.com>2023-04-24 07:28:09 +0200
commita3fa64fcc489d2cc1776807a37db3464dcc32686 (patch)
tree2ec9e6abd4b588f6584ec41ea6edf816ad25c98c /src/core/hle/service/nfc/nfc_interface.h
parentMerge pull request #10074 from Kelebek1/fermi_blit (diff)
downloadyuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar
yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.gz
yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.bz2
yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.lz
yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.xz
yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.tar.zst
yuzu-a3fa64fcc489d2cc1776807a37db3464dcc32686.zip
Diffstat (limited to 'src/core/hle/service/nfc/nfc_interface.h')
-rw-r--r--src/core/hle/service/nfc/nfc_interface.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/core/hle/service/nfc/nfc_interface.h b/src/core/hle/service/nfc/nfc_interface.h
new file mode 100644
index 000000000..8c1bf5a59
--- /dev/null
+++ b/src/core/hle/service/nfc/nfc_interface.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 Interface : public ServiceFramework<Interface> {
+public:
+ explicit Interface(Core::System& system_, const char* name);
+ ~Interface();
+
+ void Initialize(HLERequestContext& ctx);
+ void Finalize(HLERequestContext& ctx);
+ void GetState(HLERequestContext& ctx);
+ void IsNfcEnabled(HLERequestContext& ctx);
+ void ListDevices(HLERequestContext& ctx);
+ void GetDeviceState(HLERequestContext& ctx);
+ void GetNpadId(HLERequestContext& ctx);
+ void AttachAvailabilityChangeEvent(HLERequestContext& ctx);
+ void StartDetection(HLERequestContext& ctx);
+ void StopDetection(HLERequestContext& ctx);
+ void GetTagInfo(HLERequestContext& ctx);
+ void AttachActivateEvent(HLERequestContext& ctx);
+ void AttachDeactivateEvent(HLERequestContext& ctx);
+ void SendCommandByPassThrough(HLERequestContext& ctx);
+
+private:
+ enum class State : u32 {
+ NonInitialized,
+ Initialized,
+ };
+
+ 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