summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/npns
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/npns
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/npns')
-rw-r--r--src/core/hle/service/npns/npns.cpp42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/core/hle/service/npns/npns.cpp b/src/core/hle/service/npns/npns.cpp
index a162e5c54..e54827efe 100644
--- a/src/core/hle/service/npns/npns.cpp
+++ b/src/core/hle/service/npns/npns.cpp
@@ -3,22 +3,26 @@
#include <memory>
+#include "core/hle/kernel/k_event.h"
+#include "core/hle/service/cmif_serialization.h"
+#include "core/hle/service/kernel_helpers.h"
#include "core/hle/service/npns/npns.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
namespace Service::NPNS {
-class NPNS_S final : public ServiceFramework<NPNS_S> {
+class INpnsSystem final : public ServiceFramework<INpnsSystem> {
public:
- explicit NPNS_S(Core::System& system_) : ServiceFramework{system_, "npns:s"} {
+ explicit INpnsSystem(Core::System& system_)
+ : ServiceFramework{system_, "npns:s"}, service_context{system, "npns:s"} {
// clang-format off
static const FunctionInfo functions[] = {
{1, nullptr, "ListenAll"},
- {2, nullptr, "ListenTo"},
+ {2, C<&INpnsSystem::ListenTo>, "ListenTo"},
{3, nullptr, "Receive"},
{4, nullptr, "ReceiveRaw"},
- {5, nullptr, "GetReceiveEvent"},
+ {5, C<&INpnsSystem::GetReceiveEvent>, "GetReceiveEvent"},
{6, nullptr, "ListenUndelivered"},
{7, nullptr, "GetStateChangeEVent"},
{11, nullptr, "SubscribeTopic"},
@@ -59,12 +63,34 @@ public:
// clang-format on
RegisterHandlers(functions);
+
+ get_receive_event = service_context.CreateEvent("npns:s:GetReceiveEvent");
}
+
+ ~INpnsSystem() override {
+ service_context.CloseEvent(get_receive_event);
+ }
+
+private:
+ Result ListenTo(u32 program_id) {
+ LOG_WARNING(Service_AM, "(STUBBED) called, program_id={}", program_id);
+ R_SUCCEED();
+ }
+
+ Result GetReceiveEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) {
+ LOG_WARNING(Service_AM, "(STUBBED) called");
+
+ *out_event = &get_receive_event->GetReadableEvent();
+ R_SUCCEED();
+ }
+
+ KernelHelpers::ServiceContext service_context;
+ Kernel::KEvent* get_receive_event;
};
-class NPNS_U final : public ServiceFramework<NPNS_U> {
+class INpnsUser final : public ServiceFramework<INpnsUser> {
public:
- explicit NPNS_U(Core::System& system_) : ServiceFramework{system_, "npns:u"} {
+ explicit INpnsUser(Core::System& system_) : ServiceFramework{system_, "npns:u"} {
// clang-format off
static const FunctionInfo functions[] = {
{1, nullptr, "ListenAll"},
@@ -97,8 +123,8 @@ public:
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
- server_manager->RegisterNamedService("npns:s", std::make_shared<NPNS_S>(system));
- server_manager->RegisterNamedService("npns:u", std::make_shared<NPNS_U>(system));
+ server_manager->RegisterNamedService("npns:s", std::make_shared<INpnsSystem>(system));
+ server_manager->RegisterNamedService("npns:u", std::make_shared<INpnsUser>(system));
ServerManager::RunServer(std::move(server_manager));
}