diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-23 19:38:43 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-24 01:58:50 +0100 |
commit | 015d666a4d1b38a0f4b9f66e55613881c0908f37 (patch) | |
tree | 094038539bef5bc7f1d02a6fa60a145e3e5580b0 /src/core/hle/service/nfc/common | |
parent | service: npns: Add ListenTo and GetReceiveEvent for QLaunch (diff) | |
download | yuzu-015d666a4d1b38a0f4b9f66e55613881c0908f37.tar yuzu-015d666a4d1b38a0f4b9f66e55613881c0908f37.tar.gz yuzu-015d666a4d1b38a0f4b9f66e55613881c0908f37.tar.bz2 yuzu-015d666a4d1b38a0f4b9f66e55613881c0908f37.tar.lz yuzu-015d666a4d1b38a0f4b9f66e55613881c0908f37.tar.xz yuzu-015d666a4d1b38a0f4b9f66e55613881c0908f37.tar.zst yuzu-015d666a4d1b38a0f4b9f66e55613881c0908f37.zip |
Diffstat (limited to 'src/core/hle/service/nfc/common')
-rw-r--r-- | src/core/hle/service/nfc/common/device_manager.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/service/nfc/common/device_manager.h | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/core/hle/service/nfc/common/device_manager.cpp b/src/core/hle/service/nfc/common/device_manager.cpp index 94a8243b5..2dd3e9f89 100644 --- a/src/core/hle/service/nfc/common/device_manager.cpp +++ b/src/core/hle/service/nfc/common/device_manager.cpp @@ -13,6 +13,7 @@ #include "core/hle/service/nfc/nfc_result.h" #include "core/hle/service/psc/time/steady_clock.h" #include "core/hle/service/service.h" +#include "core/hle/service/set/system_settings_server.h" #include "core/hle/service/sm/sm.h" #include "hid_core/hid_types.h" #include "hid_core/hid_util.h" @@ -32,6 +33,9 @@ DeviceManager::DeviceManager(Core::System& system_, KernelHelpers::ServiceContex } is_initialized = false; + + m_set_sys = + system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys", true); } DeviceManager ::~DeviceManager() { @@ -774,8 +778,8 @@ Result DeviceManager::CheckDeviceState(std::shared_ptr<NfcDevice> device) const } Result DeviceManager::IsNfcEnabled() const { - // TODO: This calls nn::settings::detail::GetNfcEnableFlag - const bool is_enabled = true; + bool is_enabled{}; + R_TRY(m_set_sys->GetNfcEnableFlag(&is_enabled)); if (!is_enabled) { return ResultNfcDisabled; } diff --git a/src/core/hle/service/nfc/common/device_manager.h b/src/core/hle/service/nfc/common/device_manager.h index c56a2fbda..6c0e6b255 100644 --- a/src/core/hle/service/nfc/common/device_manager.h +++ b/src/core/hle/service/nfc/common/device_manager.h @@ -15,6 +15,10 @@ #include "core/hle/service/service.h" #include "hid_core/hid_types.h" +namespace Service::Set { +class ISystemSettingsServer; +} + namespace Service::NFC { class NfcDevice; @@ -98,6 +102,7 @@ private: Core::System& system; KernelHelpers::ServiceContext service_context; Kernel::KEvent* availability_change_event; + std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys; }; } // namespace Service::NFC |