aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/nfc/nfc_interface.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-02-23 20:32:32 -0500
committerGitHub <noreply@github.com>2024-02-23 20:32:32 -0500
commit6c40d75e47c7dc2d8ab5e11664cd40906f846de9 (patch)
treeb3af659a01c967e1a3082447a9ada02e5b055717 /src/core/hle/service/nfc/nfc_interface.cpp
parent975d6f1ec457f6c0e7bb6c667850099593b27e02 (diff)
parent0a0c257206b384fc9576d38d1904687a1a393f7f (diff)
Merge pull request #13140 from german77/yet-more-qlaunch
service: Stub multiple function for qlaunch
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>()};