summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfc/nfc_interface.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-02-24 02:32:32 +0100
committerGitHub <noreply@github.com>2024-02-24 02:32:32 +0100
commit6c40d75e47c7dc2d8ab5e11664cd40906f846de9 (patch)
treeb3af659a01c967e1a3082447a9ada02e5b055717 /src/core/hle/service/nfc/nfc_interface.cpp
parentMerge pull request #13141 from liamwhite/swap (diff)
parentservice: audio: Add missing logging properties of SetHeadphoneOutputLevelMode (diff)
downloadyuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar
yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.gz
yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.bz2
yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.lz
yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.xz
yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.zst
yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.zip
Diffstat (limited to 'src/core/hle/service/nfc/nfc_interface.cpp')
-rw-r--r--src/core/hle/service/nfc/nfc_interface.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/core/hle/service/nfc/nfc_interface.cpp b/src/core/hle/service/nfc/nfc_interface.cpp
index 3e2c7deab..c28e55431 100644
--- a/src/core/hle/service/nfc/nfc_interface.cpp
+++ b/src/core/hle/service/nfc/nfc_interface.cpp
@@ -13,13 +13,18 @@
#include "core/hle/service/nfc/nfc_result.h"
#include "core/hle/service/nfc/nfc_types.h"
#include "core/hle/service/nfp/nfp_result.h"
+#include "core/hle/service/set/system_settings_server.h"
+#include "core/hle/service/sm/sm.h"
#include "hid_core/hid_types.h"
namespace Service::NFC {
NfcInterface::NfcInterface(Core::System& system_, const char* name, BackendType service_backend)
: ServiceFramework{system_, name}, service_context{system_, service_name},
- backend_type{service_backend} {}
+ backend_type{service_backend} {
+ m_set_sys =
+ system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys", true);
+}
NfcInterface ::~NfcInterface() = default;
@@ -65,11 +70,11 @@ void NfcInterface::GetState(HLERequestContext& ctx) {
void NfcInterface::IsNfcEnabled(HLERequestContext& ctx) {
LOG_DEBUG(Service_NFC, "called");
- // TODO: This calls nn::settings::detail::GetNfcEnableFlag
- const bool is_enabled = true;
+ bool is_enabled{};
+ const auto result = m_set_sys->GetNfcEnableFlag(&is_enabled);
IPC::ResponseBuilder rb{ctx, 3};
- rb.Push(ResultSuccess);
+ rb.Push(result);
rb.Push(is_enabled);
}
@@ -212,6 +217,17 @@ void NfcInterface::AttachDeactivateEvent(HLERequestContext& ctx) {
rb.PushCopyObjects(out_event);
}
+void NfcInterface::SetNfcEnabled(HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ const auto is_enabled{rp.Pop<bool>()};
+ LOG_DEBUG(Service_NFC, "called, is_enabled={}", is_enabled);
+
+ const auto result = m_set_sys->SetNfcEnableFlag(is_enabled);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(result);
+}
+
void NfcInterface::ReadMifare(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto device_handle{rp.Pop<u64>()};