summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nfc/nfc.cpp47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp
index c09d198ba..8fec97db8 100644
--- a/src/core/hle/service/nfc/nfc.cpp
+++ b/src/core/hle/service/nfc/nfc.cpp
@@ -4,6 +4,9 @@
4 4
5#include <memory> 5#include <memory>
6 6
7#include "common/logging/log.h"
8#include "core/hle/ipc_helpers.h"
9#include "core/hle/kernel/hle_ipc.h"
7#include "core/hle/service/nfc/nfc.h" 10#include "core/hle/service/nfc/nfc.h"
8#include "core/hle/service/service.h" 11#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h" 12#include "core/hle/service/sm/sm.h"
@@ -30,12 +33,21 @@ public:
30 explicit NFC_AM() : ServiceFramework{"nfc:am"} { 33 explicit NFC_AM() : ServiceFramework{"nfc:am"} {
31 // clang-format off 34 // clang-format off
32 static const FunctionInfo functions[] = { 35 static const FunctionInfo functions[] = {
33 {0, nullptr, "CreateAmInterface"}, 36 {0, &NFC_AM::CreateAmInterface, "CreateAmInterface"},
34 }; 37 };
35 // clang-format on 38 // clang-format on
36 39
37 RegisterHandlers(functions); 40 RegisterHandlers(functions);
38 } 41 }
42
43private:
44 void CreateAmInterface(Kernel::HLERequestContext& ctx) {
45 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
46 rb.Push(RESULT_SUCCESS);
47 rb.PushIpcInterface<IAm>();
48
49 LOG_DEBUG(Service_NFC, "called");
50 }
39}; 51};
40 52
41class MFIUser final : public ServiceFramework<MFIUser> { 53class MFIUser final : public ServiceFramework<MFIUser> {
@@ -69,12 +81,21 @@ public:
69 explicit NFC_MF_U() : ServiceFramework{"nfc:mf:u"} { 81 explicit NFC_MF_U() : ServiceFramework{"nfc:mf:u"} {
70 // clang-format off 82 // clang-format off
71 static const FunctionInfo functions[] = { 83 static const FunctionInfo functions[] = {
72 {0, nullptr, "CreateUserInterface"}, 84 {0, &NFC_MF_U::CreateUserInterface, "CreateUserInterface"},
73 }; 85 };
74 // clang-format on 86 // clang-format on
75 87
76 RegisterHandlers(functions); 88 RegisterHandlers(functions);
77 } 89 }
90
91private:
92 void CreateUserInterface(Kernel::HLERequestContext& ctx) {
93 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
94 rb.Push(RESULT_SUCCESS);
95 rb.PushIpcInterface<MFIUser>();
96
97 LOG_DEBUG(Service_NFC, "called");
98 }
78}; 99};
79 100
80class IUser final : public ServiceFramework<IUser> { 101class IUser final : public ServiceFramework<IUser> {
@@ -116,12 +137,21 @@ public:
116 explicit NFC_U() : ServiceFramework{"nfc:u"} { 137 explicit NFC_U() : ServiceFramework{"nfc:u"} {
117 // clang-format off 138 // clang-format off
118 static const FunctionInfo functions[] = { 139 static const FunctionInfo functions[] = {
119 {0, nullptr, "CreateUserInterface"}, 140 {0, &NFC_U::CreateUserInterface, "CreateUserInterface"},
120 }; 141 };
121 // clang-format on 142 // clang-format on
122 143
123 RegisterHandlers(functions); 144 RegisterHandlers(functions);
124 } 145 }
146
147private:
148 void CreateUserInterface(Kernel::HLERequestContext& ctx) {
149 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
150 rb.Push(RESULT_SUCCESS);
151 rb.PushIpcInterface<IUser>();
152
153 LOG_DEBUG(Service_NFC, "called");
154 }
125}; 155};
126 156
127class ISystem final : public ServiceFramework<ISystem> { 157class ISystem final : public ServiceFramework<ISystem> {
@@ -165,12 +195,21 @@ public:
165 explicit NFC_SYS() : ServiceFramework{"nfc:sys"} { 195 explicit NFC_SYS() : ServiceFramework{"nfc:sys"} {
166 // clang-format off 196 // clang-format off
167 static const FunctionInfo functions[] = { 197 static const FunctionInfo functions[] = {
168 {0, nullptr, "CreateSystemInterface"}, 198 {0, &NFC_SYS::CreateSystemInterface, "CreateSystemInterface"},
169 }; 199 };
170 // clang-format on 200 // clang-format on
171 201
172 RegisterHandlers(functions); 202 RegisterHandlers(functions);
173 } 203 }
204
205private:
206 void CreateSystemInterface(Kernel::HLERequestContext& ctx) {
207 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
208 rb.Push(RESULT_SUCCESS);
209 rb.PushIpcInterface<ISystem>();
210
211 LOG_DEBUG(Service_NFC, "called");
212 }
174}; 213};
175 214
176void InstallInterfaces(SM::ServiceManager& sm) { 215void InstallInterfaces(SM::ServiceManager& sm) {